-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add Version increment automation task #32
Conversation
Signed-off-by: pgodithi <[email protected]>
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.
Please fix the spelling in the comments:/
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 believe the function name should either change or you could change the logic to get the latest version. Thanks:)
build.gradle
Outdated
// versionIncrement: Task to auto increment to the next development iteration | ||
task versionIncrement { | ||
onlyIf { System.getProperty('newVersion') } | ||
doLast { | ||
ext.newVersion = System.getProperty('newVersion') | ||
println "Setting version to ${newVersion}." | ||
// String tokenization to support -SNAPSHOT | ||
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) | ||
} | ||
} |
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.
Is there a way you can make it so we dont need to explicitly declare the version? currently this solution is not "versionIncrement" it is actually a "versionChange" function.
Either validate that we are actually incrementing or perhaps getting the latest version and changing the code to reflect that.
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.
More like setVersion
?
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.
Hey @AmiStrn the expectation from this task is to make sure the required files are updated for plugins with a new version and auto raises a PR, instead requiring a manual PR to open. The comparison of the version is with OpenSearch Core and update the required files, so the validation comes by comparing against Core repo, I have added this task to the template to make sure the upcoming plugins do have this task and from automation end, we can just trigger this task globally for all plugins ./gradlew versionIncrement -DnewVersion=2.2.0-SNAPSHOT
which will auto raise a version increment PR to allow plugin teams to validate and merge.
@dblock @bbarani
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.
@prudhvigodithi All @AmiStrn is saying is that the task does one thing (set a version), but is used differently (increment the version). You should name the task to match what it does, not how it's used.
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.
True, my point is, the task updates the version (higher than the current one) to all the desired files, hence the name versionIncrement
should be justified, setVersion can be used something like to set the version property. Again I'm open for a change.
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.
Im sorry i was not clear.
The issue is precisely what @dblock understood.
You can potentially set to version 1.0 right? so it is not "increment", setVersion
would be more adequate, maybe updateVersion
?
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.
Thanks @AmiStrn,
The idea is to call this task via workflow, the workflow only compares with OpenSearch and updates the version, so it would be an increment as OpenSearch core version would be always ahead and with existing setup based on OpenSearch version plugins version is inferred. I'm good with updateVersion
.
Signed-off-by: pgodithi <[email protected]>
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.
Spelling
Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
Hello @dblock @AmiStrn @bbarani , if you are good with |
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.
Ok by me, @AmiStrn ?
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.
Lgtm:)
Signed-off-by: pgodithi [email protected]
Description
Gradle project: Add gradle task (versionIncrement) that support version increment automation.
Issues Resolved
Part of: opensearch-project/opensearch-build#1375
From solution: opensearch-project/opensearch-build#1375 (comment)
Related issue: opensearch-project/opensearch-plugins#155
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.