-
Notifications
You must be signed in to change notification settings - Fork 143
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-67725 - Extending BranchBuildStrategies to allow setting last revision built + access to SCMEvent #291
base: master
Are you sure you want to change the base?
Conversation
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.
a very quick first pass check seems like this has the potential to break things.
I would also expect at least one downstream PR to demonstrate this new API.
ref: https://www.jenkins.io/doc/developer/extensions/branch-api/#branchbuildstrategy
I need to find some time to go through this in some more detail, but I do not have that time right now,
@CheckForNull SCMRevision lastBuiltRevision, | ||
@CheckForNull SCMRevision lastSeenRevision, | ||
@NonNull TaskListener listener){ | ||
throw new UnsupportedOperationException("Modern implementation accessed using legacy API method"); |
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.
this seems like a breaking change? if an Extension overrides this calss and updated to the modern way removing the over ride on this deprecated function - then any consumers that have not updated will not blow up at runtime?
If the extension can do something about it - then it would seem this method is just un-needed - or could be used to call the modern method using the
Util.isOverridden
trick.
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.
I actually followed the example of what the rest of the plugin extension did. IE - Line 111 was originally shipped with 2.0.17 while line 138 was shipped with 2.1.3. Basically everytime there is a new version, the previous version is set to UnsupportedOperationException
.
So the way I understand it the SPI method finds out dynamically which method is overridden (original, V2, V3, etc) and then calls that specific override. So the SPI method uses Util.isOverridden
to determine which API method to call.
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
Fair comment - I will either do a PR in one of the plugins that exists and/or create a plugin and link it here. |
See JENKINS-67725 for more context.
The basic use case:
Discussion
changesDetected
means.What is in the PR
timestamp
. If I create a plugin that requires only building forward(from now) I need to know when the event was generated. This gives me that ability.Please review at your convenience. This is ready.