Skip to content

release: fix stdout pollution in update-workflow-branches --print-branch#166128

Open
celiala wants to merge 1 commit intocockroachdb:masterfrom
celiala:fix-update-workflow-stdout-leak
Open

release: fix stdout pollution in update-workflow-branches --print-branch#166128
celiala wants to merge 1 commit intocockroachdb:masterfrom
celiala:fix-update-workflow-stdout-leak

Conversation

@celiala
Copy link
Collaborator

@celiala celiala commented Mar 19, 2026

This PR prevents version-parse warnings from contaminating the PR title for updating the update_releases workflow. See original PR title for #166125

image

Problem

When the TeamCity script captures the release branch name via:

RELEASE_BRANCH=$("$RELEASE_BIN" update-workflow-branches --print-branch)

progress messages and version-parse warnings were written to stdout instead of stderr, contaminating RELEASE_BRANCH. This produced malformed PR titles like:

workflows: run `update_releases` on `Finding latest release branch...
WARNING: cannot parse version from branch release-1.0: invalid version string 'v1.0.0'
WARNING: cannot parse version from branch release-2.0: invalid version string 'v2.0.0'
release-26.2`

instead of:

workflows: run `update_releases` on `release-26.2`

Fix

  • Route all progress/diagnostic output to os.Stderr
  • Remove the WARNING for branches like release-1.0/release-2.0 that use pre-semver naming — they're silently skipped (the correct latest branch is still found)
  • When --print-branch is set, suppress the "Finding latest release branch..." message entirely (no progress output needed in capture mode)

Epic: None
Release note: None
Release justification: non-production (release infra) change.

When --print-branch is used, the command previously wrote progress
messages ("Finding latest release branch...") and version-parse warnings
to stdout. The shell script captures stdout into RELEASE_BRANCH, so
those messages were prepended to the branch name, producing a malformed
PR title.

Fix by routing all progress/diagnostic output to stderr. The WARNING for
branches like release-1.0 and release-2.0 (which use a pre-semver naming
scheme) is removed entirely; those branches are silently skipped since
the correct latest branch is still found.

Fixes cockroachdb#166125.

Epic: None
Release note: None
Release justification: non-production (release infra) change.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@blathers-crl
Copy link

blathers-crl bot commented Mar 19, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@trunk-io
Copy link
Contributor

trunk-io bot commented Mar 19, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@celiala celiala marked this pull request as ready for review March 19, 2026 02:54
@celiala celiala requested a review from a team as a code owner March 19, 2026 02:54
@celiala celiala requested a review from rail March 19, 2026 02:54
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.

3 participants