-
Notifications
You must be signed in to change notification settings - Fork 69
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
chore(ci): add automatic merging of the release tag MONGOSH-2018 #2379
Conversation
The new system requires us to manually merge into main. This automates it through a workflow
beb6548
to
539413b
Compare
694f3f1
to
f3beb5d
Compare
f3beb5d
to
21963c2
Compare
on: | ||
push: | ||
tags: | ||
- 'mongosh@[0-9]+.[0-9]+.*' |
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.
We can still enforce the 3 components:
- 'mongosh@[0-9]+.[0-9]+.*' | |
- 'mongosh@[0-9]+\.[0-9]+\.[0-9]+.*' |
Though I'm not sure how strict we have to be here - I don't really expect we'll be pushing malformed mongosh@...
tags
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.
not sure escaping is right, this isn't proper regex but confusingly GitHub thing: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
if git rev-parse "release/v${{ steps.version-match.outputs.group1 }}" >/dev/null 2>&1; then | ||
echo "Error: Branch release/v$RELEASE_TAG already exists" | ||
echo "If this version has already been released consider using a different one." | ||
exit 1 | ||
fi |
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 redundant now, since we're not pushing that branch, there's no way for it to exist - is there?
fi | ||
|
||
if git rev-parse "release/v${{ steps.version-match.outputs.group1 }}" >/dev/null 2>&1; then | ||
echo "Error: Branch release/v$RELEASE_TAG already exists" |
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.
release/
is actually reserved as a prefix for releases we kick off from other release lines (e.g. if we wanted to do a 1.x.x release now, we'd do it from a release/v1.x.x
branch) – maybe call this package-release/
or something similar?
|
||
- name: Merge release tag into main | ||
run: | | ||
git merge ${{ github.ref }} -m "chore(release): merge changes from ${{ github.ref_name }}" |
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.
also added a message seems otherwise it may either prompt us to do it or use the default which maybe isn't best? ideally it'd fast-forward but I think because of the changelog bumps etc this may not always be the case.
on: | ||
push: | ||
tags: | ||
- 'mongosh@[0-9]+.[0-9]+.[0-9]+*' |
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.
- 'mongosh@[0-9]+.[0-9]+.[0-9]+*' | |
- 'mongosh@[0-9]+.[0-9]+.[0-9]+' |
I assume this is a regexp, in which case +*
would be equivalent to just *
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.
Oh, and, as Nikola suggested above, shouldn't it be
- 'mongosh@[0-9]+.[0-9]+.[0-9]+*' | |
- 'mongosh@[0-9]+\.[0-9]+\.[0-9]+' |
then?
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.
It's GitHub regex-esque pattern: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
I think the idea is to allow -rc0..
though if it's just this we can also do
- 'mongosh@[0-9]+.[0-9]+.[0-9]+'
- 'mongosh@[0-9]+.[0-9]+.[0-9]-rc.[0-9]+'
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 am not sure how escapes would work but GitHub Docs themselves don't use them and use i.e v[12].[0-9]+.[0-9]+
d21b0ba
to
d62c756
Compare
Going to go ahead with merge to test it and can follow up if other changes are needed. |
The new system requires us to manually merge into main. This automates it through a workflow.
It can also be triggered manually with a workflow dispatch.