feat(bump-manifest-image): add reusable image-bump PR action#149
Closed
Piotr1215 wants to merge 1 commit into
Closed
feat(bump-manifest-image): add reusable image-bump PR action#149Piotr1215 wants to merge 1 commit into
Piotr1215 wants to merge 1 commit into
Conversation
The infrastructure repo's dispatch receivers (salesforce-actions-server, license-server, and now revops-events-api) each inline ~120 lines of the same logic: parse a release tag, semver-compare against the current manifest, skip pre-releases for prod, rewrite the image tag, open a PR, optionally auto-merge. That duplication is exactly what this repo exists to absorb — shared CI logic belongs here, with callers reusing it rather than hand-rolling shell in every workflow. Extract the flow into a single composite action with the logic in tested src/*.sh scripts (bats), a third-party pin on create-pull-request, and the standard README/Makefile/CI wiring. revops-events-api is the first consumer; the salesforce/license receivers can migrate onto it next. The auto-merge step authenticates with the caller-supplied PAT, not GITHUB_TOKEN, so the merge event still triggers downstream workflows (e.g. a deploy notification) — a GITHUB_TOKEN merge would emit no events. References DEVOPS-951
Contributor
Author
|
Closing — bump-manifest-image is the wrong abstraction. The X-release -> Y-PR pattern is already covered by the repository-dispatch action, and the target repo should compose existing reusable actions (semver-validation, peter-evans) rather than a new bespoke action. Reworking infra to do that. |
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.
What
New composite action
bump-manifest-imagethat opens an image-bump PR for a single environment: parse tag, semver-compare against the current manifest, skip pre-releases for prod, rewrite theimage:tag withyq, open a PR viapeter-evans/create-pull-request(SHA-pinned), and optionally enable auto-merge.Why
The infrastructure dispatch receivers (
salesforce-actions-server,license-server, and nowrevops-events-api) each inline ~120 lines of this identical logic. Per the org rule that shared CI logic lives here and callers reuse it, this extracts the flow into one tested action.revops-events-apiis the first consumer (infra caller: loft-sh/infrastructure#293); salesforce/license can migrate next.Structure (follows the
auto-approve-bot-prspattern)src/resolve-version.sh,src/should-update.sh,src/apply-bump.sh— logictest/*.bats(14 tests) + fixture —make test-bump-manifest-imageREADME.mdwith auto-doc markers, Makefile target, path-filtered CI workflowChecks
make test-bump-manifest-image— 14/14 passmake check-docs— up to datemake lint(actionlint + zizmor) — no findingsFollow-up
On merge, tag
bump-manifest-image/v1so consumers can pin@bump-manifest-image/v1. The infra PR references that tag and is blocked until it exists.References DEVOPS-951