-
Notifications
You must be signed in to change notification settings - Fork 23
ci: Do not auto-approve cargo minor bumps #356
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
base: mainline
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,15 @@ jobs: | |
| with: | ||
| github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| - name: Approve a PR | ||
| # Hold back cargo minors and majors: the openjd-* crates are 0.x, where | ||
| # cargo treats a minor as breaking, so those most need a human to look. | ||
| # `update-type` is the highest change in the PR, so a grouped cargo PR | ||
| # containing a minor is held back too. Scoped to cargo because the pip | ||
| # and github-actions groups bundle minor with patch, so gating on patch | ||
| # alone would stop auto-approving nearly every PR from them. | ||
| if: >- | ||
| steps.metadata.outputs.package-ecosystem != 'cargo' || | ||
| steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition still auto-approves pip and github-actions majors. Per The rationale in the comment ("gating on patch alone would stop auto-approving nearly every PR from them") argues against gating on patch for those ecosystems, but it does not argue for auto-approving their majors. A major-level gate costs nothing on the grouped PRs, since those are minor+patch only and so can never report if: >-
steps.metadata.outputs.update-type != 'version-update:semver-major' &&
(steps.metadata.outputs.package-ecosystem != 'cargo' ||
steps.metadata.outputs.update-type == 'version-update:semver-patch')The existing |
||
| run: gh pr review --approve "$PR_URL" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
|
|
||
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.
The gate is scoped to
cargo, but.github/dependabot.ymlonly configurespipandgithub-actions— there is nopackage-ecosystem: cargoentry, even thoughCargo.toml/rust-bindings/Cargo.tomlexist. So for Dependabot version updates this condition never fires (no cargo PRs are ever opened), and it only has an effect on Dependabot security update PRs, which are raised independently ofdependabot.yml.Not wrong, but worth being explicit about: if the intent is to actually review cargo 0.x minors, the companion change is adding a
cargoecosystem block todependabot.yml. Otherwise a reader will assume this gate is doing more than it currently does.