fix(ci): avoid SIGPIPE noise polluting semver-level JSON output#2157
Conversation
Replace 'echo "$VAR" | grep' pipelines with here-strings. With large public-api diffs, 'grep -q' exits on first match and closes the pipe before echo finishes, emitting 'echo: write error: Broken pipe' to stderr. The workflow captures combined stdout+stderr and pipes it to jq, which then chokes on the broken-pipe lines. Here-strings buffer the input, so early grep exit no longer triggers SIGPIPE. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a09f74d to
c5180e0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a09f74daf8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
🎯 Code Coverage (details) 🔗 Commit SHA: c5180e0 | Docs | Datadog PR Page | Give us feedback! |
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 9187519122127437595 took longer than expected. The current limit for the base branch 'main' is 120 minutes. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
Problem
The
semver-levelCI step was failing with:The semver level was computed correctly (
minor), but the downstreamjqstep crashed.Root cause
scripts/semver-level.shusedecho "$VAR" | grep -q ...on large variables (the fullcargo public-apidiff).grep -qexits on the first match, closing the pipe beforeechofinishes writing, so bash emitsecho: write error: Broken pipeto stderr.The workflow captures the script's combined stdout+stderr and pipes it into
jq. Those two stderr lines land on top of the JSON, andjqdies parsing.../semver-level.sh: line 125:at column 57 (right after the 56-char script path).Fix
Replace every
echo "$VAR" | greppipeline with a here-string (grep ... <<< "$VAR"). Here-strings buffer the whole input, so an earlygrep -q/headexit no longer triggers SIGPIPE — no spurious stderr to pollute the workflow's captured stream.🤖 Generated with Claude Code