-
Notifications
You must be signed in to change notification settings - Fork 268
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-14155]Use the lastest changed tag as default #157
base: master
Are you sure you want to change the base?
Conversation
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
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.
merge conflict
Closed and Open to relaunch CI |
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.
Just a concern about the binary compatibility
} | ||
|
||
@DataBoundConstructor | ||
public ListSubversionTagsParameterDefinition(String name, String tagsDir, String credentialsId, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName) { | ||
public ListSubversionTagsParameterDefinition(String name, String tagsDir, String credentialsId, String tagsFilter, String defaultValue, boolean useLatestTag, String maxTags, boolean reverseByDate, boolean reverseByName) { |
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 dunno exactly the guideline for this plugin, but from my PoV it's better to use @DataBoundSetter
when you add field instead of putting that in the constructor.
private final String maxTags; | ||
private static final String SVN_BRANCHES = "branches"; | ||
private static final String SVN_TAGS = "tags"; | ||
private static final String SVN_TRUNK = "trunk"; | ||
|
||
@Deprecated | ||
public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName, String uuid) { | ||
this(name, tagsDir, null, tagsFilter, defaultValue, maxTags, reverseByDate, reverseByName); | ||
public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, boolean useLatestTag, String maxTags, boolean reverseByDate, boolean reverseByName, String uuid) { |
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.
Those additions will result in breaking the binary compatibility. Is it required to pass by the constructor ? I think a simple use of a setter / putting a default value would be sufficient.
@@ -173,6 +181,10 @@ public DescriptorImpl getDescriptor() { | |||
return (DescriptorImpl) super.getDescriptor(); | |||
} | |||
|
|||
@Nonnull public List<String> getTags(@Nullable Job context) { | |||
return getTags(context, "", isReverseByDate()); | |||
} |
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.
👍 to think about compatibility
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.
Feel free to request my review again if Wadeck's comments are addressed.
In a recent commit (5012326 - [JENKINS-14155] Automatically select the first option of tags listing…"), support was added to select the latest changed tag as default value. For this to work, the repository URL (of the subversion tag parameters) must point to the tags directory (e.g. foo/tags). If you want to also include trunk and branches (i.e. setting the repository URL to foo/), you cannot benefit from the "use the latest tag" feature.
This branch extends the recent functionality, such that one can use a repository URL pointing to the top level directory (foo) while still using the latest changed tag from the tags sub directory as default.
To this end a new checkbox "Use latest tag" is added below the "Default value" text box.