Skip to content

fix(ci): auto-release never detects feat/fix once the log exceeds the pipe buffer - #556

Merged
Weegy merged 1 commit into
mainfrom
fix/auto-release-bump-detection
Jul 31, 2026
Merged

fix(ci): auto-release never detects feat/fix once the log exceeds the pipe buffer#556
Weegy merged 1 commit into
mainfrom
fix/auto-release-bump-detection

Conversation

@Weegy

@Weegy Weegy commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem

The release pipeline has not cut a release since v0.56.0 (2026-06-30), despite 19 feat:/fix: commits landing on main. Every auto-release run since has succeeded while logging No feat/fix commits since v0.56.0 — skipping release, which also skipped publish-images and desktop-apps (no images, no desktop installers for a month).

Root cause

The bump detection piped the entire git log into grep -q:

elif printf '%s\n' "$msgs" | grep -qE '^feat(\(.+\))?:'; then

grep -q exits at the first match. If printf still has data buffered at that point, it gets EPIPE. Under set -o pipefail the pipeline's exit status is that failed writer, not grep's 0 — so the condition evaluates as no match precisely because there was a match.

Below ~64 KiB (the pipe buffer) printf completes before grep exits, so the pipeline is correct and the workflow worked for months. Past that threshold it inverts. And it wedges permanently rather than intermittently: no release → no new tag → a longer commit range on the next run.

The tell is visible in the log of run 30552280319printf: write error: Broken pipe on script lines 13 and 15, which map to exactly the feat and fix grep lines:

latest tag: v0.56.0 (range: v0.56.0..HEAD)
...: line 13: printf: write error: Broken pipe
...: line 15: printf: write error: Broken pipe
No feat/fix commits since v0.56.0 — skipping release.

Reproduced deterministically against the real range (655 KiB of log): bump=[] with 19 matching commits present.

Fix

  • Write the log to a file and let grep read the file. A file read cannot EPIPE, so the pipefail interaction disappears at the source rather than being papered over (e.g. by dropping pipefail or adding || true, both of which would mask genuine failures).
  • Report the range's commit count on the skip path. No feat/fix among 0 commits is a normal skip; among 19 commits is visibly wrong. This class of bug was silent for a month because the message was plausible either way.

.github/workflows/auto-release.yml was the only occurrence of the pattern in CI. The | grep -q uses in desktop-apps.yml read tiny codesign/file output and are unaffected.

Verification

Replayed the real v0.56.0..main range with the fixed script, mutations (git tag/git push/gh release create) stubbed:

latest tag: v0.56.0 (range: v0.56.0..origin/main)
Releasing v0.57.0 (bump=minor)
STUB git tag v0.57.0
STUB gh release create v0.57.0
GITHUB_OUTPUT -> new_tag=v0.57.0
  • generate-changelog.mjs notes v0.56.0 main exits 0 and produces 39 lines across Added / Changed / Fixed.
  • new_tag is set, so publish-images and desktop-apps are no longer skipped.

Note on merging

Merging this PR is itself a push to main, so it will trigger auto-release and cut v0.57.0 covering the full month of accumulated commits — one release with the complete backlog rather than the 19 individual ones that were missed. Images and desktop installers will build for it.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

… pipe buffer

The bump detection piped the whole `git log` into `grep -q`. `grep -q`
exits at the first match, so once the log outgrows the 64 KiB pipe buffer
the still-writing `printf` gets EPIPE — and under `set -o pipefail` that
failed writer, not grep's 0, becomes the pipeline's exit status. The
condition therefore reads as "no match" precisely BECAUSE there was a
match.

This wedges permanently rather than intermittently: no release means no
new tag, which means a longer commit range next time. The last release
was v0.56.0 on 2026-06-30; every run since has logged "No feat/fix
commits" while 19 feat/fix commits sat in the range (655 KiB of log).
The run at 30552280319 shows the tell in its log — "printf: write error:
Broken pipe" on exactly the feat and fix grep lines.

Have grep read a file instead; a file read cannot EPIPE. Also report the
range's commit count on the skip path, so "no feat/fix among 19 commits"
is visibly wrong in the log rather than silently plausible.

Verified by replaying the real v0.56.0..main range: bump=minor, next tag
v0.57.0, changelog generates 39 lines across Added/Changed/Fixed, and
new_tag is set so publish-images and desktop-apps stop being skipped.
@Weegy
Weegy enabled auto-merge (squash) July 31, 2026 04:43
@Weegy
Weegy merged commit 1152d7a into main Jul 31, 2026
7 checks passed
@Weegy
Weegy deleted the fix/auto-release-bump-detection branch August 14, 2026 06:53
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.

1 participant