-
Notifications
You must be signed in to change notification settings - Fork 23
ci: Add cargo to dependabot so openjd-rs releases open their own PR #336
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 | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,25 @@ updates: | |||||||||||||||||||||||||||||||||||||
| update-types: | ||||||||||||||||||||||||||||||||||||||
| - "minor" | ||||||||||||||||||||||||||||||||||||||
| - "patch" | ||||||||||||||||||||||||||||||||||||||
| - package-ecosystem: "cargo" | ||||||||||||||||||||||||||||||||||||||
| directory: "/" # Workspace root; rust-bindings is discovered as a member | ||||||||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||||||||
| interval: "weekly" | ||||||||||||||||||||||||||||||||||||||
| day: "monday" | ||||||||||||||||||||||||||||||||||||||
| commit-message: | ||||||||||||||||||||||||||||||||||||||
| prefix: "chore(deps):" | ||||||||||||||||||||||||||||||||||||||
| # Patch bumps are combined into a single PR. Minor bumps do not match this | ||||||||||||||||||||||||||||||||||||||
| # group and so each get their own individual PR, because every crate this | ||||||||||||||||||||||||||||||||||||||
| # package depends on is pre-1.0: for a 0.x crate cargo treats a minor bump | ||||||||||||||||||||||||||||||||||||||
|
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. "every crate this package depends on is pre-1.0" is not accurate, and it is the premise the grouping choice rests on. Per
For the three 1.x crates a minor bump is explicitly non-breaking under cargo's semver rules, so the "0.x minor == breaking, so isolate it" rationale does not apply to them — yet they are excluded from If the intent is "isolate only the genuinely-breaking 0.x minors", consider adding a second group that sweeps up the 1.x minors, e.g.: groups:
cargo-patch:
patterns: ["*"]
update-types: ["patch"]
cargo-stable-minor:
patterns: ["tokio", "uuid", "serde_json"]
update-types: ["minor"]Otherwise the comment should just be corrected to say most deps are pre-1.0 and the per-PR split is being accepted for all minors for simplicity.
Contributor
Author
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. Correct, and fixed in #355, which supersedes this PR. Verified against One correction to the table: it is reading an older mainline. Current pins are Not taking the suggested fix. A groups:
cargo-patch:
patterns: ["*"]
update-types: ["patch"]
cargo-minor:
patterns: ["*"]
exclude-patterns: ["openjd-*"]
update-types: ["minor"]Dependabot places a dependency in the first group it matches, so an Checked by simulating those documented rules over 19 cases — |
||||||||||||||||||||||||||||||||||||||
| # as breaking, so openjd-expr 0.3 -> 0.4 deserves its own review rather | ||||||||||||||||||||||||||||||||||||||
| # than riding along with a 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. The stated goal — "openjd-expr 0.3 -> 0.4 deserves its own review rather than riding along with a patch" — is defeated by if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: dependabot/fetch-metadata@v3
id: metadata
- run: gh pr review --approve "$PR_URL"So the isolated-PR-per-minor-bump split buys separation but not review: a
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'(That is a change to
Contributor
Author
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. Correct. Raised as #356 rather than fixed here, because it is a change to a different file that also affects the existing pip and github-actions PRs. Verified: no One severity correction: there is no auto-merge workflow in Not taking the suggested condition as written. A global if: >-
steps.metadata.outputs.package-ecosystem != 'cargo' ||
steps.metadata.outputs.update-type == 'version-update:semver-patch'That holds cargo minors, cargo majors, and any cargo group containing a minor, and leaves pip and github-actions exactly as they are today. #356 also names the gap it deliberately leaves: a pip or github-actions major is still auto-approved. |
||||||||||||||||||||||||||||||||||||||
| groups: | ||||||||||||||||||||||||||||||||||||||
| cargo-patch: | ||||||||||||||||||||||||||||||||||||||
| patterns: | ||||||||||||||||||||||||||||||||||||||
| - "*" | ||||||||||||||||||||||||||||||||||||||
| update-types: | ||||||||||||||||||||||||||||||||||||||
| - "patch" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - package-ecosystem: "github-actions" | ||||||||||||||||||||||||||||||||||||||
| directory: "/" # Location of package manifests | ||||||||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
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.
Enabling the
cargoecosystem will make every Dependabot Rust PR fail CI, because Dependabot updatesCargo.lockbut cannot regenerateTHIRD-PARTY-LICENSES.txt.The
third_party_licensesjob in.github/workflows/rust_quality.ymlrunsscripts/check_third_party_licenses.sh, which renders the Rust section fromCargo.lockviacargo about generateand then hard-fails on any diff:The committed file embeds exact crate versions (
** tokio; version 1.53.1,** memchr; version 2.8.3, ...), so a bump of any crate — including a transitive patch bump inside thecargo-patchgroup — changes the rendered output and trips the check. There is no path for a bot-authored PR to fix this on its own, so cargo Dependabot PRs will land permanently red and need a manualscripts/check_third_party_licenses.sh --updatecommit pushed onto each one.Worth deciding up front which way to go, e.g.:
contents: write) that runs--updateand commits back to the Dependabot branch, ordependabot[bot]-authored PRs, orNote this is specific to cargo: the existing
pipgroup only bumpsrequirements-*.txt(dev/test), which the script does not include since it resolves Python deps from the installed wheel's runtime closure.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.
Correct, and already known — the PR description covers it under "The one manual step this leaves", measured the same way. Taking the "decide up front" point, though, so here is the decision and the reason none of the three options is the right one.
The diagnosis is scoped too narrowly. The check is already non-hermetic, with no cargo involved. The Python section is regenerated by resolving
pyproject.tomlinto a fresh venv, andpyproject.tomldeclarespydantic >= 2.10, < 3— unpinned. The committed file records:PyPI serves 2.13.5 today, so
third_party_licensesis green by coincidence of timing. The next pydantic patch release reddens it on every PR from every author. So the closing note here — that this is specific to cargo because the pip group only touchesrequirements-*.txt— holds for what dependabot bumps, but not for what the script resolves.That rules out option 2. Making the check advisory for
dependabot[bot]leaves the Python side untouched and would mask the broader failure.Option 1 is also not as cheap as it reads: a dependabot
pull_requestgets a read-only token, so committing back needspull_request_targetor a PAT, and the script builds a wheel from PR head — a write-capable token running PR-authored build code.So: option 3 for now, with the manual step moved out of the PR description and into a comment in
dependabot.yml(#355), since a description is not where anyone will look after merge. Fixing the check properly — regenerate-and-commit for any author, or pinning the Python resolve — is worth its own PR and would subsume the cargo case rather than special-casing it.