Port Old Bash to New Go CI Tool - #23540
Conversation
|
✅ No conflicts with other open PRs targeting |
| "#wip", | ||
| "#bugfix", | ||
| "#internal", | ||
| } |
There was a problem hiding this comment.
do we need some mechanism to validate/expand this list automatically, when what release process expects changes?
There was a problem hiding this comment.
The tags list was previously stored in the shell script, so I think this is a lateral move at-worst.
There was a problem hiding this comment.
I've slightly improved it further by moving it to a golden file, tags.txt, instead of directly in code.
facea06 to
89920d2
Compare
89920d2 to
8639ad2
Compare
8639ad2 to
a04336e
Compare
7ddd53d to
cd7898b
Compare
cd7898b to
1a26b6b
Compare
1a26b6b to
036d4b7
Compare
036d4b7 to
271269c
Compare
271269c to
700902a
Compare
700902a to
f5e830e
Compare
f5e830e to
e8de231
Compare
7e583e9 to
e8de231
Compare
e8de231 to
f161e3a
Compare
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM — This ports CI-critical workflow logic from bash to a Go CLI (tools/ci) and wires it into multiple GitHub Actions workflows. While the logic itself is small, any mismatch in CLI behavior/outputs can break CI pipelines.
Summary:
Ports the legacy “resolve Chainlink image” and “changeset tag checking” bash scripts to the ci Go tool, updates workflows to use the new commands, and removes the old scripts and their dedicated workflow tests.
Changes:
- Add
ci image resolve(plus unit tests) to compute public/SDLC ECR image URIs and setresolved_imageoutput. - Add
ci changeset check-tags(plus unit tests) to validate changeset semver frontmatter and detect allowed release tags. - Update workflows to call the new Go CLI and delete the legacy bash scripts and the resolver bash test workflow.
Areas needing scrupulous human review:
ci changeset check-tagsinput contract vsdorny/paths-filteroutput format (*_filesmay include multiple paths).- GitHub Actions output behavior (ensuring outputs go to
GITHUB_OUTPUTfile only when expected; avoid polluting stdout in non-Actions runs). - Workflow integration points (
legacy-*-tests.yml,changeset.yml) to confirm step outputs are still consumed as intended.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/ci/README.md | Documents new ci image resolve and ci changeset check-tags commands. |
| tools/ci/internal/image/image.go | Implements image URI resolution for public vs SDLC ECR. |
| tools/ci/internal/image/image_test.go | Unit tests for image URI resolution + normalization/validation. |
| tools/ci/internal/changeset/tags.txt | Adds canonical allowed changeset tags list (embedded). |
| tools/ci/internal/changeset/changeset.go | Implements frontmatter semver validation + tag detection using embedded tags list. |
| tools/ci/internal/changeset/changeset_test.go | Golden test for allowed tags + functional tests for CheckTags. |
| tools/ci/go.mod | Adds YAML dependency for changeset frontmatter parsing. |
| tools/ci/go.sum | Updates checksums for new YAML dependency and transitive modules. |
| tools/ci/cmd/root.go | Registers new image and changeset command groups. |
| tools/ci/cmd/image.go | Adds ci image resolve command (flags/env + JSON + GitHub output). |
| tools/ci/cmd/image_test.go | CLI-level tests for ci image resolve output + GITHUB_OUTPUT writing. |
| tools/ci/cmd/changeset.go | Adds ci changeset check-tags command (file arg/env + JSON + outputs). |
| tools/ci/cmd/changeset_test.go | CLI-level tests for ci changeset check-tags JSON/human modes + outputs. |
| .github/workflows/resolve-chainlink-image-tests.yml | Removes legacy bash-based resolver test workflow. |
| .github/workflows/legacy-system-tests.yml | Switches resolver step to ci image resolve (after setting up CI CLI). |
| .github/workflows/legacy-non-functional-tests.yml | Switches resolver step to ci image resolve (after setting up CI CLI). |
| .github/workflows/changeset.yml | Switches changeset tag check step to ci changeset check-tags (after setting up CI CLI). |
| .github/scripts/resolve-chainlink-image.sh | Deletes legacy bash resolver implementation. |
| .github/scripts/resolve-chainlink-image_test.sh | Deletes legacy bash resolver tests. |
| .github/scripts/check-changeset-tags.sh | Deletes legacy bash changeset tag checker. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|





Intent
Port a few low-risk bash scripts over to the new Go CI tool (
tools/ci) to prove the concept works end-to-end before migrating more of the critical-path CI flow. This is the first in a series of ports toward replacing untested bash embedded in workflows with a tested Go CLI.Big Changes
ci image resolvereplacesresolve-chainlink-image.shA new
imagecommand (withresolvesubcommand) replaces.github/scripts/resolve-chainlink-image.sh. Domain logic lives ininternal/image(pure function: options in,(resolvedURI, error)out, with trimming/lowercasing/validation), andcmd/image.gois a thin cobra shell that reads flags with env fallbacks and renders human or--jsonoutput. WhenGITHUB_OUTPUTis set, it writesresolved_imageviainternal/ghaction.This moves untested bash (and its bespoke bash test harness + dedicated workflow) into Go with a proper test suite, matching the tool's
internal/cmdseparation and dual-output conventions.ci changeset check-tagsreplacescheck-changeset-tags.shA new
changesetcommand (withcheck-tagssubcommand) replaces.github/scripts/check-changeset-tags.sh.internal/changesetparses changeset frontmatter (validating thechainlinksemver), scans content for release tags loaded from an embeddedtags.txt, and returns aResult. A golden test (TestAllowedTags) guards the exact tag set against unintentional drift.This replaces an unvalidated inline tag list with an embedded golden file, and adds real tests where the shell script had none.
Small Changes
legacy-non-functional-tests.yml,legacy-system-tests.yml, andchangeset.ymlto invokeci image resolve/ci changeset check-tagsvia a newsetup-ci-cliaction instead of running the bash scripts inline..github/scripts/resolve-chainlink-image.sh,resolve-chainlink-image_test.sh,check-changeset-tags.sh, and theresolve-chainlink-image-tests.ymlworkflow (all superseded by the Go commands and tests).tools/ci/README.md.gopkg.in/yaml.v3dependency for changeset frontmatter parsing.Callouts
changesetoutput consistency —changeset.gounconditionally callsSetOutputwhileimage.goguards onGITHUB_OUTPUT. Local human output may pick uphas_tags=/found_tags=lines. Worth deciding on a single convention.CHANGESET_FILE_PATHcomes fromdorny/paths-filter(list-files: shell) and can contain multiple space-separated paths; a single path is currently assumed, which can produce confusingos.Statfailures. This is a known follow-up, not addressed in this port.