Skip to content

feat(scripts): open the decdn bump PR with scripts/open-decdn-bump.sh - #143

Merged
thiras merged 2 commits into
mainfrom
feat/open-decdn-bump
Oct 11, 2026
Merged

thiras merged 2 commits into
mainfrom
feat/open-decdn-bump

Conversation

@thiras

@thiras thiras commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

What

Opens the decdn bump PR automatically after each decdn/decdn release, instead of a hand-run pass through the checklist in ansible/roles/decdn_node/README.md § "Bumping the decdn release" once upstream-drift goes red.

scripts/open-decdn-bump.sh [--dry-run] [vX.Y.Z] follows sponsord's open-decdn-bump.sh. It works in a detached worktree at origin/main and commits, pushes and opens the PR with the maintainer's git identity and gh login, so CI runs on the PR. decdn's publish-crates.sh calls it after each release (companion decdn PR to follow).

A chart-only bump isn't possible: make test-scripts requires the chart's appVersion and Artifact Hub image to equal decdn_node_version and the onramp pins. So the PR moves every decdn pin at once.

  • Verified release facts.
    • SHA256SUMS and decdn-node-image-digest.txt must verify against the vendored decdn-release-KEYS.asc (a gpg homedir holding only those keys).
    • SHA256SUMS must list decdn-node-<version>-… archives, and the digest file must be exactly one ghcr.io/decdn/decdn-node@sha256:… line. This catches a signed file copied from another release.
    • The decdn tag clone must carry a signature from those keys.
  • scripts/bump_decdn.py (pinned / compare / rewrite / changelog) does checklist steps 1, 3, 4 and 5 and the collections' [Unreleased] entries. Every edit must match exactly once and every pin is read back afterwards. Digests are replaced in every tracked text file (changelogs excepted), which also moves the pin-pair copy in molecule/validation-sponsord.
  • Generated mirrors and KEYS (steps 2 and 6) come from the tag. The PR body lists what a person still has to do, and the script exits 1 when the PR needs work:
    • a schema-key change, with its diff (node.toml.j2 and values.config follow it by hand)
    • a KEYS change (the sponsord copy and SECURITY.md follow it)
    • any generator that failed
    • the real-binary make lint-helm check
    • prose that still names the old version
  • Idempotent. Nothing happens when the pin is at or past the release, or when a PR from bump/decdn-<tag> exists in any state.

Reviewer notes

  • Read scripts/open-decdn-bump.sh first, then scripts/bump_decdn.py.
  • Changelogs: the node and publisher collection changelogs each had a hand-written decdn-pin bullet. The node changelog had two that started the same way. I reworded them so each collection keeps exactly one bump-owned [Unreleased] entry, which a later bump rewrites in place; two such entries are refused. The chart changelog has no [Unreleased] section (0.1.1 is released), so it gets no entry. The PR title becomes that changelog's line.
  • Not in this PR: a --dry-run shell harness with a gh stub for the orchestration script.

Verification

  • make test-scripts: all pass.
  • python3 -m unittest discover -s scripts/tests -p 'test_*.py': 24 tests pass. Each guard, disabled on a copy of the tree, makes a test fail.
  • pre-commit on the changed files, and shellcheck: clean.
  • --dry-run v0.0.2 from a clone of a local origin whose main pins 0.0.1:
  • Against the real origin it reports "nothing to do" for v0.0.2 and for no tag (latest), and refuses a pre-release tag and a tag with no release.

🤖 Generated with Claude Code

scripts/open-decdn-bump.sh [--dry-run] [vX.Y.Z] moves every decdn/decdn
pin to a decdn release and opens the PR, in a detached worktree at
origin/main, with the maintainer's git identity and gh login (so CI runs).
decdn's publish-crates.sh runs it after each release, as it already runs
sponsord's bump.

- Release facts are verified before use: SHA256SUMS and
  decdn-node-image-digest.txt against the vendored KEYS, SHA256SUMS must
  list that version's archives, the digest file must name the decdn-node
  image, and the tag clone must carry a signature from KEYS.
- scripts/bump_decdn.py does the file edits (checklist steps 1, 3, 4 and
  5, and the collections' [Unreleased] entries). Every edit is anchored
  to one match and every pin is read back.
- The generated mirrors and KEYS come from the tag. A schema-key change,
  a KEYS change, a failed generator and stale prose are listed in the PR
  body; the script exits 1 when the PR needs work.
- Nothing happens when the pin is at or past the release, or when a PR
  from bump/decdn-<tag> exists in any state.

The node and publisher collection changelogs each keep one bump-owned
[Unreleased] entry, which a later bump rewrites in place.

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

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

Both execution paths can report success while the generated PR still has unresolved prose updates.

1 open finding
What changed in this PR

Automates opening PRs that update all decdn release pins while verifying release assets and regenerating mirrors.

Changes:

  • Adds release verification and PR orchestration.
  • Adds pin-rewriting helpers and unit tests.
  • Updates bump documentation and changelog templates.
File Description
scripts/​open-decdn-bump.sh Verifies releases and opens bump PRs.
scripts/​bump_decdn.py Rewrites and validates release pins.
scripts/​tests/​test_bump_decdn.py Tests rewrite and changelog logic.
tests/​scripts-test.sh Runs the new unit tests.
Makefile Documents the expanded test target.
CONTRIBUTING.md Documents automated bump workflow.
ansible/​roles/​decdn_node/​README.md Updates the release checklist.
ansible/​galaxy/​node/​CHANGELOG.md Establishes a reusable bump entry.
ansible/​galaxy/​publisher/​CHANGELOG.md Establishes a reusable onramp entry.
AGENTS.md Records the new automation.
.github/​workflows/​upstream-drift.yml Points drift remediation to the script.

🧠 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 scripts/open-decdn-bump.sh Resolved
@thiras
thiras merged commit fd09133 into main Oct 11, 2026
54 checks passed
@thiras
thiras deleted the feat/open-decdn-bump branch October 11, 2026 23:08
thiras added a commit to decdn/decdn that referenced this pull request Oct 11, 2026
* feat: open devops' decdn bump PR from publish-crates.sh

After the upload, publish-crates.sh clones decdn/devops and runs its
scripts/open-decdn-bump.sh <tag> (decdn/devops#143), which moves the
role, chart, Compose and onramp pins to the release and opens the PR with
the maintainer's gh login. sponsord's bump runs after it, so sponsord's
crates.io wait does not hold it up.

- The downstream block is one open_bump function shared by both repos:
  temporary clone, registry tokens unset, Ctrl-C handling and warn-only
  failures as before.
- DECDN_SKIP_DEVOPS_BUMP=1 skips the devops step; a typo in either skip
  switch stops the script before anything runs (new pytest).
- A pre-release opens no devops PR: devops pins vX.Y.Z releases only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: cite #2421 in the changelog entry

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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