-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Auto-increment next development iteration. #1816
Conversation
Can one of the admins verify this patch? |
Signed-off-by: dblock <[email protected]>
2a456cc
to
8b2e0af
Compare
Signed-off-by: dblock <[email protected]>
8b2e0af
to
960ef55
Compare
✅ Gradle Check success 90bb9d61278e5ceecde7ee26bc6d82ffa89f27cd |
✅ Gradle Check success 2a456cce8d1467042fa81ad0bddca8aabeb3ac2a |
✅ Gradle Check success 8b2e0afeb82868d1c4ddebec40fbf6dcb096bd72 |
|
start gradle check |
@saratvemulapalli @andrross could i get a CR on this please since we’re not done making log4j patch releases any time soon … |
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
base: ${{ env.BASE }} | ||
branch: 'create-pull-request/patch-${{ env.BASE }}' |
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 bot will have problems creating a branch on OpenSearch as it doesn't have permissions to create one. Only maintainers on OpenSearch can.
This is the similar problem @VachaShah was trying solve for auto-backport workflow.
To quickly test out:
- On the fork you could enable branch protection
- Try running the workflow
The bot should have to create its own fork to solve this problem or we have to fiddle with the permissions.
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.
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.
Yup that should solve it.
AFAIK it was enabled because of a CVE on github. @CEHENKLE might have more details.
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.
On opensearch-build branch protection is only on "root" branches, "*". Can I just change it in this repo?
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 it was because of https://medium.com/cider-sec/bypassing-required-reviews-using-github-actions-6e1b29135cc7.
I am in line with you to relax branch protection rules only to main
and release branches.
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.
Can we use https://github.com/marketplace/actions/version-increment to handle the version calculation?
I've seen it and I am not sold. It's possible, but we have a lot of different version types to modify to do an actual version increment. |
@saratvemulapalli I relaxed branch protection to only |
Seems like we are going to be doing a lot of copypasta from this POC. Shame we couldn't leverage a library to centralize and validate this effort more easily. |
I agree, but this one is particularly long because OpenSearch has so many places where it needs code changes on a version increment along with 3 branches. Theoretically we can author a common GHA that extracts and increments the version (or use a thirdparty one as suggested), then find a more data-driven mechanism to apply changes like a patch. Open to suggestions towards that, but I also think automated > manual so even if this is pretty messy it's well self-contained in 1 GHA. |
base: main | ||
branch: 'create-pull-request/patch-main' | ||
commit-message: Added bwc version ${{ env.NEXT_VERSION }} | ||
delete-branch: 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.
@VachaShah you could use this for auto-backport workflow.
This should solve the problem of stale branches after the PR is merged.
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 @saratvemulapalli ! I just created a PR to fix the auto-backport workflow.
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 is a great start, thanks @dblock !
I wish there was a better than a lot of bash magic, may be gradle.
We can always make it better.
* Auto-increment next development iteration. Signed-off-by: dblock <[email protected]> * Make bwc increments on X.Y and main branches. Signed-off-by: dblock <[email protected]> (cherry picked from commit 7a38109)
* Auto-increment next development iteration. Signed-off-by: dblock <[email protected]> * Make bwc increments on X.Y and main branches. Signed-off-by: dblock <[email protected]>
* Auto-increment next development iteration. Signed-off-by: dblock <[email protected]> * Make bwc increments on X.Y and main branches. Signed-off-by: dblock <[email protected]> Signed-off-by: dblock <[email protected]>
* Auto-increment next development iteration. Signed-off-by: dblock <[email protected]> * Make bwc increments on X.Y and main branches. Signed-off-by: dblock <[email protected]> Signed-off-by: dblock <[email protected]> Co-authored-by: Daniel Doubrovkine (dB.) <[email protected]>
Signed-off-by: dblock [email protected]
Description
Adds a workflow that increments the version of OpenSearch whenever a new X.Y.Z tag is pushed.
To test this I pushed a 1.2.4 tag to my branch,
git tag -d 1.2.4 ; git tag 1.2.4 ; git push origin :1.2.4 ; git push origin --tags
. That's what would happen if we were to release 1.2.4 tomorrow.[AUTO] Incremented version to 1.2.5. dblock/OpenSearch#2
[AUTO] [1.x] Added bwc version 1.2.5. dblock/OpenSearch#3
[AUTO] [main] Added bwc version 1.2.5. dblock/OpenSearch#6
The new workflow produces 3 PRs similar to #1758 and backport PRs into main, and 1.x. It removes the manual steps that start triggering the whole automation to produce the next patch release.
It's possible that this implementation could be done differently/better using gradle, and potentially reused by other components "as is", but I think it's a good enough start because it saves a bunch of manual work.
Issues Resolved
Part of opensearch-project/opensearch-build#1375.
Check List
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.