Skip to content

ci: Fix Release Version Resolution for Untagged and Resumed Runs - #233

Merged
danny-avila merged 2 commits into
mainfrom
lia/release-workflow-version-resolution
Sep 18, 2026
Merged

danny-avila merged 2 commits into
mainfrom
lia/release-workflow-version-resolution

Conversation

@lia-by-librechat

Copy link
Copy Markdown
Contributor

Fixes #228
Fixes #229

The release workflow resolved its version in one inline shell block under set -euo pipefail, where two paths could not succeed.

#228 — untagged main aborted version resolution. Filtering tags through grep made a no-match fatal. On the ordinary untagged tip of main, git tag --points-at HEAD | grep -E '^v[0-9]+...' exits 1, so the step died before reaching its skip handling or next-release-version.sh, and a deployable commit could not obtain a release version. Selecting stable tags now reads exit 1 as an empty answer while exit 2 and above still fail the release. That also lets the missing-previous-tag case report its own error instead of aborting anonymously.

#229 — a rerun could not resume publication. With a stable tag already pointing at HEAD and no release published, the version comes from that tag, and the following existence check then failed merely because the ref existed. It now compares the tag's commit against the release commit, so only a tag on some other commit is a collision. Create tag already tolerated a tag that exists, so the rest of the recovery path was correct.

Why it moved to a script. The block became .github/scripts/resolve-release-version.sh, beside the next-release-version.sh it calls, because neither defect was reachable by a test while the logic lived in workflow YAML. tests/release-version-resolution.sh now covers every path against throwaway repositories with a stubbed gh: automatic release, resumed release after tag creation, an already-published tag, a calculated tag held by another commit, a stale CI run, documentation-only ranges, dispatch with and without the v prefix, release candidates, dispatch from a topic branch, an existing dispatched version, a malformed version, and a pushed older patch tag that must not become latest. The step's env block is unchanged, so the workflow's inputs and outputs are the same.

docs/RELEASING.md already documents both behaviours ("a rerun also resumes publication if the tag was created before a later step failed"); this makes them true.

Verification

The release workflow resolved its version in one inline shell block under
`set -euo pipefail`, where two paths could not succeed.

Filtering tags through `grep` made a no-match fatal. On the ordinary untagged
tip of `main`, `git tag --points-at HEAD | grep -E '^v[0-9]+...'` exits 1, and
the step died before reaching its skip handling or `next-release-version.sh`, so
a deployable commit could not obtain a release version (#228). Selecting stable
tags now reads exit 1 as an empty answer while exit 2 and above still fail the
release, which also lets the missing-previous-tag case report its own error.

The rerun-resume path then rejected the tag it had itself chosen. With a stable
tag already pointing at `HEAD` and no release published, the version comes from
that tag, and the following existence check failed merely because the ref
existed (#229). It now compares the tag's commit against the release commit, so
only a tag on some other commit is a collision; `Create tag` already tolerates
a tag that exists.

The block moved into `.github/scripts/resolve-release-version.sh`, beside the
`next-release-version.sh` it calls, so `tests/release-version-resolution.sh` can
cover every path: automatic, resumed, skipped, dispatched, pushed-tag, and the
runs that must be refused, each against a throwaway repository with a stubbed
`gh`.
@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Ready for review at fdf2cfc44e8072a8e1ea59a45c5a79b40f24e7b8.

That head carries the whole change: .github/scripts/resolve-release-version.sh with both fixes, the release.yml step reduced to a call into it, tests/release-version-resolution.sh with 13 cases, and the CI lane that runs them.

Two things worth a reviewer's attention:

  1. The no-match contract. select_stable_tags accepts exit 1 from grep and re-raises exit 2 and above, so an untagged HEAD reads as "no stable tag" while a genuine grep failure still fails the release. This is the behaviour release workflow aborts version resolution on untagged commits #228 needed, and it is deliberately narrower than || true, which would have swallowed real errors.
  2. Which tag counts as a collision. For workflow_run, a tag equal to the resolved version is now a collision only when it resolves to a different commit. A tag on the release commit is the resumed release from release workflow cannot resume publication from an existing HEAD tag #229, and Create tag already skips creation when the ref exists.

The step's env block is unchanged, so the workflow's inputs and outputs are identical; only where the logic lives changed.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-18T03:24:13.146805Z d545362 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fdf2cfc44e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/scripts/resolve-release-version.sh
@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review

Please review the current PR head d545362. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: d545362ebe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila
danny-avila merged commit fd9a4fa into main Sep 18, 2026
10 checks passed
rschlaefli pushed a commit to uzh-bf/code-interpreter that referenced this pull request Sep 18, 2026
Records the post-merge Release failure on 55840f3, upstream's LibreChat-AI#228/LibreChat-AI#229 fix in
PR LibreChat-AI#233 (fd9a4fa, v1.2.0), the fork guard for the tagless fork, and the gated
dispositions left open (merging PR #25, cutting an initial stable tag). Also
adds PR #25 to the ledger's patch-index row.
rschlaefli pushed a commit to uzh-bf/code-interpreter that referenced this pull request Sep 18, 2026
Records the post-merge Release failure on 55840f3, upstream's LibreChat-AI#228/LibreChat-AI#229 fix in
PR LibreChat-AI#233 (fd9a4fa, v1.2.0), the never-publish policy for the tagless fork, and
the one remaining gate (merging PR #25).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release workflow cannot resume publication from an existing HEAD tag release workflow aborts version resolution on untagged commits

1 participant