Skip to content

ci(release): open sponsord's decdn bump PR after publishing crates - #2399

Merged
thiras merged 6 commits into
mainfrom
ci/start-sponsord-bump
Oct 9, 2026
Merged

thiras merged 6 commits into
mainfrom
ci/start-sponsord-bump

Conversation

@thiras

@thiras thiras commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

publish-crates.sh now ends by opening the PR that pins decdn/sponsord to the release it just published. It clones sponsord into a temporary directory and runs .github/scripts/open-decdn-bump.sh <tag> (decdn/sponsord#56), using the maintainer's gh login, git identity and cargo. No GitHub App or extra secret is needed, and the PR runs CI normally.

  • Index lag: the sponsord script waits for crates.io itself, so it runs even when the index hasn't caught up yet.
  • If it can't finish: a clone failure, exit 3 (crates.io isn't serving the release yet) or any other failure prints the command to run later from a sponsord checkout. The publish still exits 0.
  • Skipping: a DECDN_REPO other than decdn/decdn opens nothing. DECDN_SKIP_SPONSORD_BUMP=1/true/yes skips it, using the same check as sign-release.sh. That flag is read before any upload.
  • Cleanup: the clone is removed by the script's existing EXIT trap.

Merge decdn/sponsord#56 first. Until then the clone has no open-decdn-bump.sh; the script warns and still exits 0 (tested).

Test plan

  • bash -n and shellcheck clean
  • Ran the downstream block under set -euo pipefail with a stub gh that clones a fake script, in seven cases: success, script exit 1, exit 3, script missing, clone failure, skip flag, forked REPO. Every case exits 0, prints the right line, and removes the clone.
  • Flag parsing: '', 0, false and no run the bump; 1, TRUE and yes skip it; a typo stops the script before any upload.
  • pre-commit

🤖 Generated with Claude Code

publish-crates.sh ends by running
`gh workflow run bump-decdn.yml -R decdn/sponsord --ref main`. That
workflow (decdn/sponsord) waits for crates.io to serve the release and
opens the PR that pins sponsord to it.

A failed start prints the command and leaves the exit code at 0, like
the rest of the post-publish section. A DECDN_REPO other than
decdn/decdn starts nothing, and DECDN_SKIP_SPONSORD_BUMP=1 skips it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 14:50
@thiras thiras self-assigned this Oct 9, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The skip flag incorrectly treats false non-empty values such as 0 as enabled.

1 open finding
What changed in this PR

Adds automatic triggering of sponsord’s dependency-bump workflow after publishing deCDN crates.

Changes:

  • Triggers bump-decdn.yml after publication.
  • Supports fork and explicit-skip safeguards.
  • Documents the workflow and recovery behavior.
File Description
.github/​scripts/​publish-crates.sh Adds downstream workflow dispatch.
RELEASING.md Documents the automated bump process.
CHANGELOG.md Records the release automation change.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/scripts/publish-crates.sh Resolved
A bare [[ -n ]] test made DECDN_SKIP_SPONSORD_BUMP=0 skip the sponsord
bump. The flag now uses sign-release.sh's rule: 1/true/yes enable,
0/false/no/empty do not, anything else stops the script. It is parsed
before the upload, so a typo never fails the post-publish section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sponsord opens its decdn bump PR from a local script now, not from a
workflow with a GitHub App token. publish-crates.sh clones
decdn/sponsord into a temporary directory and runs
`open-decdn-bump.sh <tag>`, with the maintainer's gh login and cargo.
Exit 3 (crates.io does not serve the release yet) and any other failure
print the command to run later from a sponsord checkout; the publish
still exits 0. The clone goes in the EXIT trap's cleanup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras thiras changed the title ci(release): start sponsord's decdn bump after publishing crates ci(release): open sponsord's decdn bump PR after publishing crates Oct 9, 2026
thiras and others added 2 commits October 9, 2026 18:23
publish-crates.sh runs sponsord's open-decdn-bump.sh from a fresh clone
of its main, as the maintainer. That script needs gh and cargo, not the
crates.io token, so the subshell unsets CARGO_REGISTRY_TOKEN and every
CARGO_REGISTRIES_*_TOKEN before running it. The comment and RELEASING.md
state the trust this step extends to sponsord's main, and that
DECDN_SKIP_SPONSORD_BUMP=1 leaves the run to a reviewed checkout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- WORKTREE and SPONSORD_DIR start empty before the EXIT trap. An
  inherited SPONSORD_DIR was rm -rf'd on any exit before the bump step,
  and an inherited WORKTREE was passed to `git worktree remove --force`.
- A failed `mktemp -d` warns instead of exiting 1 after the publish.
- Ctrl-C while sponsord's script waits for crates.io stops that script
  only. This shell traps INT around it, prints the command to run later
  and exits 0.
- A clone without an executable open-decdn-bump.sh gets its own warning.
  Exit 1 tells the operator to look for "==> Opened <url>": the PR may
  be open with a lock that needs work, where a re-run does nothing.
- Comments and RELEASING.md describe the step as it is: org admins can
  bypass sponsord's ruleset, only the cargo registry tokens are unset,
  the crates.io wait is bounded, only DECDN_REPO marks a fork, and the
  push uses git credentials (Python 3.11+ and a credential helper over
  https).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras merged commit 975b62e into main Oct 9, 2026
29 checks passed
@thiras
thiras deleted the ci/start-sponsord-bump branch October 9, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants