Skip to content
Snippets Groups Projects

Fixed retrieval of repos based on different providers + hook updates

Merged Martin Lowe requested to merge github/fork/autumnfound/malowe/master/project-repos into master

Updated rb hook for gitlab to use production endpoint since it is live. Added gitlab + github repo members of the Project object. RElies on changes that are currently in staging. Changed logic for retrieving projects to contextually change where it looks for repositories based on the request provider.

Signed-off-by: Martin Lowe martin.lowe@eclipse-foundation.org

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
301 294 }
302 295
296 /**
297 * Retrieves projects valid for the current request, or an empty list if no data
298 * or matching project repos could be found.
299 *
300 * @param req the current request
301 * @return list of matching projects for the current request, or an empty list
302 * if none found.
303 */
304 private List<Project> retrieveProjectsForRequest(ValidationRequest req) {
305 String repoUrl = req.getRepoUrl();
306 // check for all projects that make use of the given repo
307 @SuppressWarnings("unchecked")
308 Optional<List<Project>> cachedProjects = cache.get("projects", () -> projects.getProject(),
309 (Class<List<Project>>) (Object) List.class);
  • Martin Lowe
    Martin Lowe @malowe started a thread on commit 4db9648f
  • 301 294 }
    302 295
    296 /**
    297 * Retrieves projects valid for the current request, or an empty list if no data
    298 * or matching project repos could be found.
    299 *
    300 * @param req the current request
    301 * @return list of matching projects for the current request, or an empty list
    302 * if none found.
    303 */
    304 private List<Project> retrieveProjectsForRequest(ValidationRequest req) {
    305 String repoUrl = req.getRepoUrl();
    306 // check for all projects that make use of the given repo
    307 @SuppressWarnings("unchecked")
    308 Optional<List<Project>> cachedProjects = cache.get("projects", () -> projects.getProject(),
    309 (Class<List<Project>>) (Object) List.class);
    • Author Maintainer

      If you are wondering about the double cast, that's because you can't directly reference a typed generic for casting. In order to get the proper typed generic, casting shenanigans were needed.

  • Created by mbarbero

    Review: Approved

  • Please register or sign in to reply
    Loading