feat(): enable auto-merge on bump PRs#28
Conversation
d7d31f3 to
12f3688
Compare
Enable auto-merge (squash) on newly created bump/duckdb-* PRs so they merge automatically once all required status checks pass. Skipped on PR updates (idempotent runs) to avoid redundant gh calls. Requires repository setting "Allow auto-merge" and branch protection on main with required status checks configured.
12f3688 to
322672d
Compare
bengeois
left a comment
There was a problem hiding this comment.
Thanks for this PR, really helpful!
I was going through the configuration and ran into an issue with the required status checks: the matrix jobs each generate a separate check (Build DuckDB (3.10, x86_64), Build DuckDB (3.11, arm64), etc.), so you'd have to add every combination individually in the branch protection rule, and update it each time PYTHON_VERSIONS changes.
The standard fix is to add a small summary job that depends on the whole matrix and acts as a single gate:
all-builds-passed:
name: All builds passed
needs: [package-duckdb]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check matrix result
run: |
if [ "${{ needs.package-duckdb.result }}" != "success" ]; then
exit 1
fi
I would then only need to configure All builds passed as the required status check, one stable entry, regardless of how many matrix combinations exist.
What do you think ? Can you include this in your PR if you agree ?
Good point, it’s been added! |
|
Setup completed ✅ Thanks @Gudsfile 🙌 |
Follows up on #25.
Once the build matrix passes on a bump PR, auto-merge triggers automatically, no need to merge manually.
How it works
After
peter-evans/create-pull-requestopens a newbump/duckdb-X.Y.ZPR, the workflow callsgh pr merge --auto --mergeon it. The merge happens only when all required status checks pass. If any job fails (e.g. a Python version no longer supported by DuckDB), the PR stays open for review.Setup required
In addition to the setup described in #25:
main: configureBuild DuckDB(thepackage-duckdbmatrix jobs) as required status checksOpen question
Auto-merge is intentionally gated on the build matrix only. However, until
PYTHON_VERSIONSis managed automatically (detecting which Python versions DuckDB ships wheels for and which Lambda supports), a passing build does not guarantee complete coverage, it only validates the versions currently in the matrix.My approach would be to: keep "Require approvals" enabled on
mainso a reviewer can checkPYTHON_VERSIONSbefore merging. Auto-merge would still remove the need to click merge manually, but would wait for the approval first. Or check Python versions in the CI #29.