ci: bump skill spec.version when Renovate bumps spec.ref#606
Closed
ci: bump skill spec.version when Renovate bumps spec.ref#606
Conversation
Today, dockyard's Renovate `customManagers` regex auto-bumps `spec.ref` in `skills/*/spec.yaml` to track upstream `main`, but `spec.version` is not touched — so the build pipeline pushes new content under the same OCI tag (silent re-pin), and downstream consumers (e.g. toolhive-catalog) quietly drift from the artifact bytes. This workflow runs on Renovate-authored PRs that touch `skills/**/spec.yaml`. For each file whose `spec.ref` changed (and whose `spec.version` did not), it patch-increments `spec.version` (X.Y.Z -> X.Y.Z+1) so the new ref publishes under a new, immutable OCI tag. Together with a corresponding post-upgrade workflow on the catalog side, this collapses the drift problem to a normal Renovate-driven flow: ref change -> new version -> new tag -> catalog sees the bump and rewrites its own pinned ref in lockstep. No accumulating sync workflow or scheduled job needed. The workflow fails (rather than silently rewriting) when the version isn't simple `X.Y.Z` semver or the substitution can't locate the line to update. Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
Member
Author
|
Let's hold on merging this until I figure out the right way :D |
Member
Author
|
Superseding with a smaller change: instead of a follow-up workflow that bumps spec.version, derive the OCI tag from spec.version + spec.ref so a single Renovate ref bump always produces a new immutable tag. New PR coming. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/renovate-post-upgrade.ymlthat runs on Renovate-authored PRs touchingskills/**/spec.yaml. For each file whosespec.refchanged (and whosespec.versiondid not), it patch-incrementsspec.version(e.g.0.1.0→0.1.1) and pushes the bump back to the same PR branch with DCO sign-off.Why
Dockyard's existing
customManagersregex inrenovate.jsonauto-bumpsspec.refto track upstreammain, butspec.versionstays unchanged. The build pipeline reads.spec.versionand tags the OCI artifact accordingly, so today the same:0.1.0tag gets republished with new bytes whenever Renovate moves the ref — a silent re-pin.Downstream consumers (most directly
stacklok/toolhive-catalog, which holds two pointers to the same content per skill: an OCI tag and a git ref) can't detect this with their own Renovatedockerdatasource because the tag string doesn't change. The catalog has been working around this manually (e.g. stacklok/toolhive-catalog#1179) and a parallel sync workflow has been proposed (stacklok/toolhive-catalog#1178).This workflow closes the drift at the source: any new ref also gets a new version, so a new tag is always published, and downstream Renovate-style flows can react normally. The catalog-side companion PR (stacklok/toolhive-catalog#1182) then rewrites its
refin lockstep with the new tag.Behavior
renovate[bot](if: github.actor == 'renovate[bot]'), so manual edits tospec.yamlby humans aren't auto-bumped — the maintainer is expected to choose the version.spec.refis unchanged or where the maintainer has already updatedspec.versionin the same PR.spec.versionisn't simpleX.Y.Zsemver (can't auto-bump unambiguously).Notes
secrets.GITHUB_TOKEN. As a side effect of how GitHub handlesGITHUB_TOKEN-authored pushes, the existing CI checks on the PR won't auto-rerun on the bump commit. The bump itself is mechanical (single-line version increment) and is validated by this workflow; if a maintainer wants a fresh CI run after the bump, an empty re-run via the Actions UI suffices.pull_requestevent'sgithub.actorisgithub-actions[bot], notrenovate[bot], so theifgate skips it.Test plan
skills/*/spec.yaml(or simulate one viaworkflow_dispatchafter a manual ref bump on a test branch) and confirm:spec.versionline;build-skills.yml(post-merge) tags the new artifact under the bumped version.spec.yamldoes not trigger the bump.