-
Notifications
You must be signed in to change notification settings - Fork 354
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
[JENKINS-55927] Hook event should not trigger Branch Indexing #908
Open
Dohbedoh
wants to merge
13
commits into
jenkinsci:master
Choose a base branch
from
Dohbedoh:JENKINS-55927
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0018451
[JENKINS-55927] Hook event should not trigger Branch Indexing
Dohbedoh 5321736
[JENKINS-55927] Remove javadoc typo
Dohbedoh 89eaa77
Merge branch 'master' into JENKINS-55927
Dohbedoh e745215
[JENKINS-55927] Disable the behavior by default. Add properties to re…
Dohbedoh d91fb40
Merge branch 'master' into JENKINS-55927
Dohbedoh 101d3b5
Merge branch 'master' into JENKINS-55927
Dohbedoh 2fb95c7
Merge branch 'master' into JENKINS-55927
Dohbedoh 756bb42
Merge branch 'master' into JENKINS-55927
Dohbedoh 5f842ac
Merge branch 'master' into JENKINS-55927
Dohbedoh 78f8552
Merge branch 'master' into JENKINS-55927
Dohbedoh a35cfac
Merge branch 'master' into JENKINS-55927
Dohbedoh 796da9a
Merge branch 'master' into JENKINS-55927
Dohbedoh ba8c034
[JENKINS-55927] Update deprecation description
Dohbedoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,7 @@ | |
* Abstract hook processor. | ||
* | ||
* Add new hook processors by extending this class and implement {@link #process(HookEventType, String, BitbucketType, String)}, | ||
* extract owner and repository name from the hook payload and then call {@link #scmSourceReIndex(String, String)} | ||
* to launch a branch/PR reindexing on the matching SCMSource. | ||
* extract details from the hook payload and then fire an {@link jenkins.scm.api.SCMEvent} to dispatch it to the SCM API. | ||
*/ | ||
public abstract class HookProcessor { | ||
|
||
|
@@ -86,10 +85,11 @@ | |
/** | ||
* To be called by implementations once the owner and the repository have been extracted from the payload. | ||
* | ||
* @deprecated Branch Indexing should not be triggered directly. But through {@link jenkins.scm.api.SCMSourceEvent}. | ||
* @param owner the repository owner as configured in the SCMSource | ||
* @param repository the repository name as configured in the SCMSource | ||
*/ | ||
protected void scmSourceReIndex(final String owner, final String repository) { | ||
Check warning on line 92 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/HookProcessor.java ci.jenkins.io / Java Compilercompiler:compile
|
||
try (ACLContext context = ACL.as(ACL.SYSTEM)) { | ||
boolean reindexed = false; | ||
for (SCMSourceOwner scmOwner : SCMSourceOwners.all()) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in JIRA issue I think these changes will cause to the user that have setup "Discover pull requests" strategies different than "The current pull request revision" they never get a build for PRs which target branch is the same branch subject of the merged.
If I understand correct the configuration in the JIRA issue the reported would trigger manual reindex to update all PRs. Than this should be archived using a build strategies to ignore some specific index events (maybe already implemented in other plugins)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JIRA mentions the
Received hook from Bitbucket. Processing push event on
log line. per my reading, this is really coming from the event subscriber / hook processors (entry point isBitbucketSCMSourcePushHookReceiver
). It would happen regardless of the multibranch configuration as far as I can tell.