Conversation
Add a republish workflow for rebuilding and republishing a release tag if the original source build succeeded, but other parts of the CI pipeline failed. This allows those parts that are not integral to building the binaries to be fixed and release performed without needing to move the tag or burn a release number. The republish workflow takes its source from a release tag and its configuration from the branch it is triggered against. A new 'release-ref' parameter names the tag, and 'checkout_source' replaces plain 'checkout' throughout, detaching to that tag so get-version derives VERSION from it exactly as it does on a tag build. releng/republish triggers the workflow through the CircleCI API. The workflow could also be triggered directly from the CircleCI UI.
There was a problem hiding this comment.
🟡 Changes recommended
Shell injection and incorrect release-version resolution could compromise or mislabel republished artifacts.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a CircleCI workflow and release-engineering utility to rebuild and republish existing release tags.
Changes:
- Adds source-tag checkout and release metadata handling.
- Adds approval-gated republish jobs.
- Adds a CLI for validating and triggering republishing.
File summaries
| File | Description |
|---|---|
.circleci/config.yml |
Defines republish parameters, commands, and workflow. |
releng/republish |
Validates and triggers republish pipelines. |
Review details
Suppressed comments (3)
.circleci/config.yml:42
- This validation accepts abbreviated tags such as
v1andv1.13, but.circleci/scripts/get-versiononly recognizes three-component tags. An accepted republish of such a tag therefore falls back to a1.x-<sha>version instead of rebuilding the requested release. Require all three version components here.
if ! echo "${REF}" | grep -Eq '^v[0-9]+(\.[0-9]+)?(\.[0-9]+)?$' ; then
.circleci/config.yml:69
- Checking out the requested tag's commit does not make
get-versionselect that tag: the script enumerates every tag pointing atHEADand chooses the highest version. For the documented existing case wherev1.9.0andv1.9.1share a commit, republishingv1.9.0stamps the binaries as1.9.1. Makeget-versionhonor an explicit tag and set that tag before invoking it.
# After checkout_source, HEAD is the release tag, so get-version
# derives VERSION from it exactly as it does on a tag build.
releng/republish:188
- The tag, commit, branch, and configuration are all verified against the local
origin, but this request always targetsinfluxdata/influxdb. In a normal fork clone, the confirmation can therefore describe the fork while CircleCI builds the official repository's different refs. Verify that the selected remote is the official repository (or perform all resolution against a dedicated official remote) before triggering the request.
ENDPOINT="https://circleci.com/api/v2/project/${PROJECT_SLUG}/pipeline"
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Use release-ref parameter through envvar for safety. Also fix an indentation issue in the package step.
Tighten release tag detection so that it requires a major, minor, and patch version number (e.g. "v1.13.0"). Previously tags with missing prelease versions (e.g. "v1.13") and minor versions (e.g. "v1") would match.
Make republish script's preflight checks more robust. Also, include republish CircleCI pipeline ID in post-trigger message.
There was a problem hiding this comment.
🟡 Changes recommended
Shared-commit tags can produce incorrectly versioned binaries, and rebuilt artifacts can publish before tests pass.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.circleci/config.yml:668
- This gate can be approved while every rebuilt test job is still running or has failed, because none is a dependency. The republish may use a changed CI configuration and defaults to a newer floating builder, so the original release's test results do not validate these new artifacts. Require the package, static, Flux, and unit-test jobs before permitting publication.
- hold_publish:
type: approval
requires:
- sign_packages
- changelog
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
The binaries built by the republish CI pipeline will now always match the tag given by the release-ref parameter. Previously, if a commit had multiple tags and the release-ref was for an earlier tag, the binaries would be built with the latest tag but the packages would be built with the release-ref version.
The changelog header now reflects `release-ref` for a `republish` pipeline run. Previously, the header would be for the branch that `republish` was run from instead of the binary source's tag.
devanbenz
left a comment
There was a problem hiding this comment.
This all seems okay to me. Just one comment.
| # https://circleci.com/api/v2/project/gh/influxdata/influxdb/pipeline \ | ||
| # -H "Circle-Token: ${CIRCLE_TOKEN}" \ | ||
| # -H 'Content-Type: application/json' \ | ||
| # -d '{"branch":"1.13","parameters":{"workflow":"republish","release-ref":"v1.13.0"}}' |
There was a problem hiding this comment.
What happens when workflow is set to republish and release-ref is not set? Should we add a guard for that of some sort?
Add a republish workflow for rebuilding and republishing a release tag if the original source build succeeded, but other parts of the CI pipeline failed. This allows those parts that are not integral to building the binaries to be fixed and release performed without needing to move the tag or burn a release number.
The republish workflow takes its source from a release tag and its configuration from the branch it is triggered against. A new 'release-ref' parameter names the tag, and 'checkout_source' replaces plain 'checkout' throughout, detaching to that tag so get-version derives VERSION from it exactly as it does on a tag build.
releng/republish triggers the workflow through the CircleCI API. The workflow could also be triggered directly from the CircleCI UI.