Skip to content

chore(ci): add republish workflow for re-publishing a release tag - #27611

Open
gwossum wants to merge 7 commits into
1.13from
gw/republish_1.13
Open

gwossum wants to merge 7 commits into
1.13from
gw/republish_1.13

Conversation

@gwossum

@gwossum gwossum commented Aug 28, 2026

Copy link
Copy Markdown
Member

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.

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.

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

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 v1 and v1.13, but .circleci/scripts/get-version only recognizes three-component tags. An accepted republish of such a tag therefore falls back to a 1.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-version select that tag: the script enumerates every tag pointing at HEAD and chooses the highest version. For the documented existing case where v1.9.0 and v1.9.1 share a commit, republishing v1.9.0 stamps the binaries as 1.9.1. Make get-version honor 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 targets influxdata/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.

Comment thread .circleci/config.yml Outdated
Comment thread releng/republish Outdated
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.

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

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

Comment thread .circleci/config.yml
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.
@gwossum
gwossum marked this pull request as ready for review September 1, 2026 18:45
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.
@gwossum
gwossum requested a review from devanbenz September 8, 2026 16:35

@devanbenz devanbenz 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.

This all seems okay to me. Just one comment.

Comment thread .circleci/config.yml
# 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"}}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when workflow is set to republish and release-ref is not set? Should we add a guard for that of some sort?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants