Skip to content

Commit

Permalink
Add project key to cache key
Browse files Browse the repository at this point in the history
If a requests is sent with a project key, and the key is not part of the cache key, following requests for other projects will result in the cached repositories for the first project, leading to wrong results
  • Loading branch information
thomas-boehm-tractive committed Mar 27, 2024
1 parent 4733e8c commit 52aafe2
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ public List<BitbucketCloudRepository> getRepositories(@CheckForNull UserRoleInRe
.set("pagelen", MAX_PAGE_LENGTH);
if (StringUtils.isNotBlank(projectKey)) {
template.set("q", "project.key=" + "\"" + projectKey + "\""); // q=project.key="<projectKey>"
cacheKey.append("::").append(projectKey);

Check warning on line 771 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 771 is not covered by tests
}
if (role != null && authenticator != null) {
template.set("role", role.getId());
Expand Down

0 comments on commit 52aafe2

Please sign in to comment.