Skip to content
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

Allow auto merge binding PRs #988

Merged
merged 26 commits into from
Oct 20, 2023
Merged

Allow auto merge binding PRs #988

merged 26 commits into from
Oct 20, 2023

Conversation

qinsoon
Copy link
Member

@qinsoon qinsoon commented Oct 18, 2023

This PR allows auto merging related binding PRs once the mmtk-core PR is merged. It also adds some docs for MMTk team about merging process. The PR closes #205.

@qinsoon
Copy link
Member Author

qinsoon commented Oct 18, 2023

binding-refs
OPENJDK_BINDING_REPO=qinsoon/mmtk-openjdk
OPENJDK_BINDING_REF=update-mmtk-core-pr-988

@qinsoon
Copy link
Member Author

qinsoon commented Oct 18, 2023

Most of the workflow is tested, and works fine. See https://github.com/mmtk/mmtk-core/actions/runs/6556991187. The workflows can update the mmtk dependency and turn on auto merging in the testing PR in OpenJDK (mmtk/mmtk-openjdk#254).

One thing that is not tested yet is the merge commit hash. It is acquired with github.event.pull_request.merge_commit_sha. According to the documents (https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request), the merge_commit_sha should be "the SHA of the squashed commit on the base branch". We will only know if it works fine after we actually merge a pull request.

@qinsoon qinsoon marked this pull request as ready for review October 18, 2023 06:58
@qinsoon qinsoon added the PR-testing Run binding tests for the pull request (deprecated: use PR-extended-testing instead) label Oct 18, 2023
@qinsoon qinsoon requested review from wks and caizixian October 19, 2023 04:23
@qinsoon
Copy link
Member Author

qinsoon commented Oct 19, 2023

I think the current approach may not work if a mmtk-core PR is opened from a fork. The workflow needs to access secrets.CI_ACCESS_TOKEN which is probably not available if the PR is opened from a fork. I can try change the trigger from "closed pull_request" to "push to master". In that case, the workflow is always triggered from the upstream repo.

Copy link
Collaborator

@wks wks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some problems in the Python script replace-mmtk-dep.py that should be changed.

.github/scripts/replace-mmtk-dep.py Outdated Show resolved Hide resolved
.github/scripts/replace-mmtk-dep.py Outdated Show resolved Hide resolved
.github/scripts/replace-mmtk-dep.py Outdated Show resolved Hide resolved
@qinsoon
Copy link
Member Author

qinsoon commented Oct 20, 2023

I think the current approach may not work if a mmtk-core PR is opened from a fork. The workflow needs to access secrets.CI_ACCESS_TOKEN which is probably not available if the PR is opened from a fork. I can try change the trigger from "closed pull_request" to "push to master". In that case, the workflow is always triggered from the upstream repo.

I changed the workflow trigger. It should be fine now.

Copy link
Collaborator

@wks wks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qinsoon
Copy link
Member Author

qinsoon commented Oct 20, 2023

I changed the way how to update the lock file. It now uses cargo build instead of cargo generate-lockfile, as genearte-lockfile may update the version of dependencies. If a dependency does not comply with semantic versioning, we may end up with a broken build. Use cargo build won't have such an issue.

I don't plan to make any further changes to the PR unless requested.

@qinsoon qinsoon added this pull request to the merge queue Oct 20, 2023
Merged via the queue into master with commit 06a2e5d Oct 20, 2023
20 checks passed
@qinsoon qinsoon deleted the auto-merge-binding-prs branch October 20, 2023 11:20
qinsoon added a commit to mmtk/mmtk-openjdk that referenced this pull request Oct 20, 2023
This PR updates mmtk-core to mmtk/mmtk-core#988.
Once mmtk/mmtk-core#988 is merged, this PR
should be updated to the new mmtk-core commit, and will be auto merged
(if all the requirements for auto merging is met).

---------

Co-authored-by: mmtkgc-bot <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Oct 23, 2023
We saw the auto merging workflow (added in
#988) failed in
https://github.com/mmtk/mmtk-core/actions/runs/6587030083/job/17896533403.
The error message was `GraphQL: Head branch is out of date. Review and
try the merge again. (mergePullRequest)`. It is likely caused by the
issue https://github.com/orgs/community/discussions/24462: When a PR
gets updated, Github has a process to determine if the PR is mergable.
If we attempt to enable auto merge before the process is done, the merge
will fail with the error message above. This PR adds a delay and retry
for enabling auto merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-testing Run binding tests for the pull request (deprecated: use PR-extended-testing instead)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automating merging PRs from bindings for mmtk-core updates
2 participants