ci(downstream): robust per-client error handling in run-clients.sh#7927
Conversation
…odo) - Move clone/fetch/checkout inside the per-client guarded block with explicit '|| exit 1' on every step. set -e is suspended inside a subshell used as an '||' operand, so relying on it silently swallowed clone/checkout failures (and continued from the wrong cwd); explicit guards make one client's failure a per-client fail=1 while the loop continues, and the run exits non-zero. - Stop suppressing fetch errors; fetch only when the pinned commit isn't already reachable, and surface the real error. - Run manifest commands via 'bash -c' instead of 'eval' (trusted in-repo allowlist; avoids double-parsing / leaking into this script's shell). Verified: two bogus clients -> both reported, loop continues, exit 1; happy path (cli, no server) -> vectors pass, smoke skips, exit 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Code Review by Qodo
1.
|
PR Summary by QodoFix downstream runner to isolate per-client failures and avoid eval in run-clients.sh WalkthroughsUser DescriptionFollow-up to #7924, which merged before its Qodo review was addressed. Lands the two Qodo findings (both real):
Verification
🤖 Generated with Claude Code AI Description• Prevent one downstream client clone/checkout failure from silently passing the gate. • Make each client run fail independently while continuing the loop and exiting non-zero. • Replace manifest command execution via eval with bash -c to avoid double-parsing. Diagramgraph TD
A(["CI job"]) --> B["run-clients.sh"] --> C["clients.json"] --> D{"Per-client loop"} --> E["Clone/fetch/checkout"] --> F["Install + tests"] --> H(["Exit (fail)"])
E --> G["::error:: + fail=1"] --> D
F --> G
subgraph Legend
direction LR
_start(["Start/End"]) ~~~ _proc["Process"] ~~~ _dec{"Decision"}
end
High-Level AssessmentThe following are alternative approaches to this PR: 1. Function-per-client with explicit return codes (no subshell-as-`||` operand)
2. Run each client as a separate job/step (matrix)
Recommendation: The PR’s approach is appropriate for a single-script runner: explicit File ChangesBug fix (1)
|
The three client Phase-2 PRs merged; bump each manifest ref from its pre-merge PR-branch tip (now deleted / unfetchable) to its squash-merge commit on main: etherpad-pad -> 91620c6 (ether/pad#1) etherpad-cli-client -> ebc516e (ether/etherpad-cli-client#136) etherpad-desktop -> ab83da6 (ether/etherpad-desktop#78) Verified each merged main carries the test entry points (vectors.rs/smoke.rs; test:vectors/test:smoke scripts). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Updated: now that the three client PRs have merged, this PR also bumps the manifest refs to their squash-merge commits (pad→ |
bash -c spawns a fresh shell without -e/-u/-o pipefail, so a pipeline-stage failure inside a client's vectorTest/smokeCmd could be masked. Use 'bash -euo pipefail -c' so those failures surface as a non-zero exit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Fixed in the latest commit, thanks @qodo — manifest commands now run under |
Follow-up to #7924, which merged before its Qodo review was addressed. Lands the two Qodo findings (both real):
git clone/fetch/checkoutran outside the per-client failure guard. Worse: moving them into the( … ) || { fail=1; }subshell suspendsset -e(the subshell is an||operand), so a failed clone was silently swallowed and the loop continued from the wrong cwd — a broken/unreachable client would have passed the gate. Fixed by guarding every step (clone/fetch/checkout/cd/install/test) with explicit|| exit 1, so one client's failure becomes a per-clientfail=1, the loop continues, and the run exits non-zero. Fetch errors are no longer suppressed (fetch only when the pinned commit isn't already reachable).evalbrittleness — manifest commands now run viabash -c(trusted in-repo allowlist; no double-parse, no leak into this script's shell).Verification
::error::downstream client …), loop continues, exit 1.🤖 Generated with Claude Code