Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JENKINS-69221 - Scan GitLab project fails on MR from private repository: 404 Project Not Found #393

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,22 @@
if (fork && !forkMrSources.containsKey(mr.getSourceProjectId())) {
// This is a hack to get the path with namespace of source project for forked
// mrs
originProjectPath = gitLabApi
.getProjectApi()
.getProject(mr.getSourceProjectId())
.getPathWithNamespace();
forkMrSources.put(mr.getSourceProjectId(), originProjectPath);
try {
originProjectPath = gitLabApi
.getProjectApi()
.getProject(mr.getSourceProjectId())
.getPathWithNamespace();
forkMrSources.put(mr.getSourceProjectId(), originProjectPath);
} catch (GitLabApiException e) {
if (e.getHttpStatus() == 404) {
listener.getLogger()
.format(
"%nIgnoring merge requests as source project not found, Please check permission on source repo...%n");
continue;
} else {
throw e;
}
}

Check warning on line 455 in src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 446-455 are not covered by tests
} else if (fork) {
originProjectPath = forkMrSources.get(mr.getSourceProjectId());
}
Expand Down
Loading