JENKINS-67725 - Extending BranchBuildStrategies to allow setting last revision built + access to SCMEvent#291
Conversation
jtnord
left a comment
There was a problem hiding this comment.
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.
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.
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
changesDetectedmeans.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.