Skip to content

Commit 753f71c

Browse files
authored
Fix auto merge branches (#1230)
This PR changes the auto merge workflow. For each binding, the workflow now allows inputs for base repo and base ref. This change is mostly for the Julia binding which uses `dev` instead of `master` as the default branch. #1221 only changed for the correctness testing, this PR made corresponding changes for auto merge.
1 parent 59ea62e commit 753f71c

File tree

3 files changed

+63
-7
lines changed

3 files changed

+63
-7
lines changed

.github/workflows/auto-merge-inner.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
ref:
1616
required: true
1717
type: string
18+
# The upstream branch where the binding PR is targeting, such as master, dev
19+
base_ref:
20+
required: true
21+
type: string
1822
# The core commit hash that the binding should be using.
1923
core_commit:
2024
required: true
@@ -35,7 +39,7 @@ jobs:
3539
- name: Check input conditions
3640
id: check-input
3741
run: |
38-
if [[ "${{ inputs.repo }}" == ${{ inputs.base_repo }} ]] && [[ "${{ inputs.ref }}" == "master" ]]; then
42+
if [[ "${{ inputs.repo }}" == ${{ inputs.base_repo }} ]] && [[ "${{ inputs.ref }}" == "${{ inputs.base_ref }}" ]]; then
3943
echo "Conditions not met"
4044
echo "skip=true" >> $GITHUB_OUTPUT
4145
else

.github/workflows/auto-merge.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
needs: [get-merged-pr, binding-refs]
3737
with:
3838
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
39-
base_repo: mmtk/mmtk-openjdk
39+
base_repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo_default }}
4040
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
41+
base_ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref_default }}
4142
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
4243
update_lockfile: cargo build
4344
secrets: inherit
@@ -47,8 +48,9 @@ jobs:
4748
needs: [get-merged-pr, binding-refs]
4849
with:
4950
repo: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo }}
50-
base_repo: mmtk/mmtk-jikesrvm
51+
base_repo: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo_default }}
5152
ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref }}
53+
base_ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref_default }}
5254
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
5355
# `cargo generate-lockfile` will update other dependencies. We avoid using it for the bindings.
5456
# But we do not have a good option for JikesRVM. The Rust project in JikesRVM needs some source files
@@ -62,8 +64,9 @@ jobs:
6264
needs: [get-merged-pr, binding-refs]
6365
with:
6466
repo: ${{ needs.binding-refs.outputs.v8_binding_repo }}
65-
base_repo: mmtk/mmtk-v8
67+
base_repo: ${{ needs.binding-refs.outputs.v8_binding_repo_default }}
6668
ref: ${{ needs.binding-refs.outputs.v8_binding_ref }}
69+
base_ref: ${{ needs.binding-refs.outputs.v8_binding_ref_default }}
6770
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
6871
update_lockfile: cargo build --features nogc
6972
secrets: inherit
@@ -73,19 +76,24 @@ jobs:
7376
needs: [get-merged-pr, binding-refs]
7477
with:
7578
repo: ${{ needs.binding-refs.outputs.julia_binding_repo }}
76-
base_repo: mmtk/mmtk-julia
79+
base_repo: ${{ needs.binding-refs.outputs.julia_binding_repo_default }}
7780
ref: ${{ needs.binding-refs.outputs.julia_binding_ref }}
81+
base_ref: ${{ needs.binding-refs.outputs.julia_binding_ref_default }}
7882
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
79-
update_lockfile: cargo build --features immix
83+
# `cargo generate-lockfile` will update other dependencies. We avoid using it for the bindings.
84+
# mmtk-julia uses bindgen during building and requires the Julia repo. This is a similar situation
85+
# as mmtk-jikesrvm. To make thigns simpler, we just use `cargo generate-lockfile`.
86+
update_lockfile: cargo generate-lockfile
8087
secrets: inherit
8188

8289
check-merge-ruby-pr:
8390
uses: ./.github/workflows/auto-merge-inner.yml
8491
needs: [get-merged-pr, binding-refs]
8592
with:
8693
repo: ${{ needs.binding-refs.outputs.ruby_binding_repo }}
87-
base_repo: mmtk/mmtk-ruby
94+
base_repo: ${{ needs.binding-refs.outputs.ruby_binding_repo_default }}
8895
ref: ${{ needs.binding-refs.outputs.ruby_binding_ref }}
96+
base_ref: ${{ needs.binding-refs.outputs.ruby_binding_ref_default }}
8997
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
9098
update_lockfile: cargo build
9199
secrets: inherit

.github/workflows/pr-binding-refs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,67 @@ on:
3838
openjdk_binding_repo:
3939
description: "The repository of OpenJDK binding, such as {user}/{repo}"
4040
value: ${{ jobs.binding-refs.outputs.openjdk_binding_repo}}
41+
openjdk_binding_repo_default:
42+
description: "The default repository of OpenJDK binding, such as {user}/{repo}"
43+
value: ${{ jobs.binding-refs.outputs.openjdk_binding_repo_default }}
4144
openjdk_binding_ref:
4245
description: "The git ref of OpenJDK binding, such as sha and branch name"
4346
value: ${{ jobs.binding-refs.outputs.openjdk_binding_ref}}
47+
openjdk_binding_ref_default:
48+
description: "The default git ref of OpenJDK binding, such as sha and branch name"
49+
value: ${{ jobs.binding-refs.outputs.openjdk_binding_ref_default }}
50+
4451
jikesrvm_binding_repo:
4552
description: "The repository of JikesRVM binding, such as {user}/{repo}"
4653
value: ${{ jobs.binding-refs.outputs.jikesrvm_binding_repo}}
54+
jikesrvm_binding_repo_default:
55+
description: "The default repository of JikesRVM binding, such as {user}/{repo}"
56+
value: ${{ jobs.binding-refs.outputs.jikesrvm_binding_repo_default }}
4757
jikesrvm_binding_ref:
4858
description: "The git ref of JikesRVM binding, such as sha and branch name"
4959
value: ${{ jobs.binding-refs.outputs.jikesrvm_binding_ref}}
60+
jikesrvm_binding_ref_default:
61+
description: "The default git ref of JikesRVM binding, such as sha and branch name"
62+
value: ${{ jobs.binding-refs.outputs.jikesrvm_binding_ref_default }}
63+
5064
v8_binding_repo:
5165
description: "The repository of V8 binding, such as {user}/{repo}"
5266
value: ${{ jobs.binding-refs.outputs.v8_binding_repo}}
67+
v8_binding_repo_default:
68+
description: "The default repository of V8 binding, such as {user}/{repo}"
69+
value: ${{ jobs.binding-refs.outputs.v8_binding_repo_default }}
5370
v8_binding_ref:
5471
description: "The git ref of V8 binding, such as sha and branch name"
5572
value: ${{ jobs.binding-refs.outputs.v8_binding_ref}}
73+
v8_binding_ref_default:
74+
description: "The default git ref of V8 binding, such as sha and branch name"
75+
value: ${{ jobs.binding-refs.outputs.v8_binding_ref_default }}
76+
5677
julia_binding_repo:
5778
description: "The repository of Julia binding, such as {user}/{repo}"
5879
value: ${{ jobs.binding-refs.outputs.julia_binding_repo}}
80+
julia_binding_repo_default:
81+
description: "The default repository of Julia binding, such as {user}/{repo}"
82+
value: ${{ jobs.binding-refs.outputs.julia_binding_repo_default }}
5983
julia_binding_ref:
6084
description: "The git ref of Julia binding, such as sha and branch name"
6185
value: ${{ jobs.binding-refs.outputs.julia_binding_ref}}
86+
julia_binding_ref_default:
87+
description: "The default git ref of Julia binding, such as sha and branch name"
88+
value: ${{ jobs.binding-refs.outputs.julia_binding_ref_default }}
89+
6290
ruby_binding_repo:
6391
description: "The repository of Ruby binding, such as {user}/{repo}"
6492
value: ${{ jobs.binding-refs.outputs.ruby_binding_repo}}
93+
ruby_binding_repo_default:
94+
description: "The default repository of Ruby binding, such as {user}/{repo}"
95+
value: ${{ jobs.binding-refs.outputs.ruby_binding_repo_default }}
6596
ruby_binding_ref:
6697
description: "The git ref of Ruby binding, such as sha and branch name"
6798
value: ${{ jobs.binding-refs.outputs.ruby_binding_ref}}
99+
ruby_binding_ref_default:
100+
description: "The default git ref of Ruby binding, such as sha and branch name"
101+
value: ${{ jobs.binding-refs.outputs.ruby_binding_ref_default }}
68102

69103
jobs:
70104
binding-refs:
@@ -82,15 +116,25 @@ jobs:
82116
RUBY_BINDING_REF_DEFAULT: master
83117
outputs:
84118
openjdk_binding_repo: ${{ steps.print.outputs.openjdk_binding_repo }}
119+
openjdk_binding_repo_default: ${{ env.OPENJDK_BINDING_REPO_DEFAULT }}
85120
openjdk_binding_ref: ${{ steps.print.outputs.openjdk_binding_ref }}
121+
openjdk_binding_ref_default: ${{ env.OPENJDK_BINDING_REF_DEFAULT }}
86122
jikesrvm_binding_repo: ${{ steps.print.outputs.jikesrvm_binding_repo }}
123+
jikesrvm_binding_repo_default: ${{ env.JIKESRVM_BINDING_REPO_DEFAULT }}
87124
jikesrvm_binding_ref: ${{ steps.print.outputs.jikesrvm_binding_ref }}
125+
jikesrvm_binding_ref_default: ${{ env.JIKESRVM_BINDING_REF_DEFAULT }}
88126
v8_binding_repo: ${{ steps.print.outputs.v8_binding_repo }}
127+
v8_binding_repo_default: ${{ env.V8_BINDING_REPO_DEFAULT }}
89128
v8_binding_ref: ${{ steps.print.outputs.v8_binding_ref }}
129+
v8_binding_ref_default: ${{ env.V8_BINDING_REF_DEFAULT }}
90130
julia_binding_repo: ${{ steps.print.outputs.julia_binding_repo }}
131+
julia_binding_repo_default: ${{ env.JULIA_BINDING_REPO_DEFAULT }}
91132
julia_binding_ref: ${{ steps.print.outputs.julia_binding_ref }}
133+
julia_binding_ref_default: ${{ env.JULIA_BINDING_REF_DEFAULT }}
92134
ruby_binding_repo: ${{ steps.print.outputs.ruby_binding_repo }}
135+
ruby_binding_repo_default: ${{ env.RUBY_BINDING_REPO_DEFAULT }}
93136
ruby_binding_ref: ${{ steps.print.outputs.ruby_binding_ref }}
137+
ruby_binding_ref_default: ${{ env.RUBY_BINDING_REF_DEFAULT }}
94138
steps:
95139
- name: Check binding revisions
96140
uses: qinsoon/[email protected]

0 commit comments

Comments
 (0)