Repository navigation
CI: stop grep -c || echo 0 producing a two-line count - #10232
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
e5c601e to
b06ef7b
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
grep -cprints0and exits 1 when nothing matches, so$(grep -c ... || echo 0)appends a second line and the variable holds0\n0. Two places in the workflows do that.studio-frontend-ci.yml
The bundle has zero hits today, so every run of
Frontend build + bundle sanitylogsset -edoes not catch it because the[is a condition, so the step stays green while printing a shell error and a mangled diagnostic. Visible on any recent run, for example https://github.com/unslothai/unsloth/actions/runs/33731460431.The guard itself is not dead in the direction that matters: with real matches
grep -cexits 0,|| echo 0never runs, and the comparison fires correctly. I checked that with a 4-match fixture.What the noise was hiding is the line above it.
ls dist/assets/index-*.js | head -1takes its exit status fromhead, so a missed glob leaves$JSempty andset -enever sees it.grep -c PAT ""then exits 2 printing nothing,|| echo 0yields a clean single-line0, and the step passes green on a bundle nobody looked at. That is a failure-open in a regression gate, and it is the reason to touch this at all.So this now checks the bundle exists before scanning it, and uses
|| truewith a${HITS:-0}default, which also covers the grep exit-2 case where nothing is printed.Verified all three paths in bash:
[: 0\n0: integer expression expected, step greenhits=0, pass, no errorindex-*.js::error::no dist/assets/index-*.js to scan, exit 1notebooks-ci.yml
The seed-pin fallback counter has the same shape. That value is only interpolated into
::error::/::warning::annotations, never into a numeric test, so the cost is a two-line annotation that GitHub truncates after the first line. Same one-line fix while it is open.Scope
I swept the tree for the pattern: those are the only two.
.github/workflows/cache-janitor.yml:187and thetests/sh/suite already use|| true, and the remaining|| echo 0sites are non-counting commands whose failure prints nothing, so the fallback is sound there.Nothing here changes what any check passes or fails on today.
Unrelated, while I was in this job
Frontend build + bundle sanitywas red onmainand 15 open PRs forover the startup budget: transfer 1568.0 KB > 1562.5 KB. #10054 has since raisedBUDGET.transferBytesto 1,620,000, so that is green again and this PR does not touch it.Worth knowing where those bytes went, though.
assets/api-provider-logo-*.jsis 303.2 KB raw / 80.8 KB transfer on the eager startup path and is 96%node-forge:x509.js56.9 KB,tls.js55.8 KB,util.js35.7 KB,jsbn.js31.1 KB,rsa.js30.2 KB,ed25519.js23.1 KB. It arrives from two static imports,studio/frontend/src/features/chat/api/providers-api.ts:4andstudio/frontend/src/features/chat/utils/chat-attachment-events.ts:11. Both call sites are alreadyasync: one encrypts a provider API key when you save one in Settings, the other is a fallback SHA-256 for whencrypto.subtleis unavailable.node-forge's default export is a non-tree-shakeable barrel, so onemd.sha256.create()pulls the whole X.509/TLS/PKCS library onto the boot path.Making both dynamic measures at 1495.9 KB transfer / 4984.4 KB raw against 1568.0 / 5259.1, so 72.1 KB of transfer back, no change in chunk count, and the eager path returns to roughly what it measured when the budget was first calibrated at
17363f8a2. That is more than the 57.5 KB the ceiling was just raised by. I have left it out of this PR since it is a frontend change and not a CI one, but it is there if someone wants the headroom back rather than the raised ceiling.