-
Notifications
You must be signed in to change notification settings - Fork 204
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
PHPC-2375: Manually merge up version bump commits #1586
Conversation
23d0d0a
to
238bb74
Compare
@@ -62,6 +62,7 @@ jobs: | |||
app_id: ${{ vars.APP_ID }} | |||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |||
submodules: true | |||
fetch-depth: 0 |
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.
Noted that this fetches the full history (secure-checkout/action.yml).
|
||
- name: "Determine branch to merge up to" | ||
id: get-next-branch | ||
uses: alcaeus/automatic-merge-up-action/get-next-branch@main |
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.
Do you intend to merge this to mongodb-labs/drivers-github-tools
at some point? If so, should there be a TODO?
Edit: I didn't realize alcaeus/automatic-merge-up-action existed already. Looks pretty involved (beyond the small actions in the DBX repo), so I understand if you want to leave this as-is. I think you should probably target a tag instead of @main
, though.
Side note: WTF is dist/get-next-branch/index.js 20 KLOC? I assume you didn't write that yourself.
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'll keep the action separate for the time being. Once I've confirmed this works I'll tag the current state at v1 and update all of our repositories accordingly.
As for the 20 KLOC, all of the dependencies are compiled into a single file so that running the action from a workflow doesn't require installing them manually. The main dependencies are the actions toolkit that makes dealing with inputs, outputs, and the GitHub API easier.
.github/workflows/release.yml
Outdated
- name: "Push tag and release branch" | ||
run: | | ||
git push origin ${RELEASE_BRANCH} | ||
git push origin ${{ inputs.version }} |
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.
Alternatively, would git push origin tag ${{ inputs.version }}
be less ambiguous? I picked that up while reading the git-push docs and https://stackoverflow.com/q/5195859
I also noted the advice in the SO thread to avoid using --tags
, which we historically did (see: RELEASING.md). It appears that tag-version/action.yml is still doing that, so perhaps you'd like to revisit that at some point so it only explicitly pushes one tag.
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.
TIL tag <name>
is a thing. Updated to ensure what we're pushing is a tag ref.
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 with this as-is. You can decide to implement any feedback.
PHPC-2375
This PR adds logic to automatically merge up changes to the next release branch. This is necessary as the pull request for the merge-up action will always have a conflict due to the version already having changed in the next branch.
If the branch detection logic finds a newer branch to merge to (which it always should as we're releasing from version branches), it runs a
git merge --strategy=ours
in this next branch, then pushes those changes before pushing the release branch. By pushing the next branch before the release branch, the merge-up action discovers that there are no commits to be merged from the release branch into the next branch and will not create a merge-up pull request.Note that if the release branch contains changes that have not been merged up yet, those changes will be marked as merged without applying them. I can add logic to detect this and prevent a release, but this case shouldn't come up very often as we're quite diligent about merging the merge-up pull requests so I've decided against it for the time being.