Sampler: pass template names newline-separated so spaced account template names survive - #36
Sampler: pass template names newline-separated so spaced account template names survive#36michieldegezelle wants to merge 7 commits into
Conversation
The presigned report_url expires ~5 minutes after the run completes (see silverfin-cli's CI_AUTH_SAMPLER_PLAN.md §10.4), so the "Open full sampler report" link posted on the PR is essentially always dead by the time a reviewer clicks it. Link to the GitHub Actions artifact instead (valid for the full 7-day retention window), falling back to the presigned URL only if the artifact upload itself didn't happen. Also adds a diffs/ folder to the uploaded results.zip containing before/after view.html only for the entries the compact diff flagged, via silverfin-cli's new run-sampler --from-zip --add-diffs-folder (silverfin-cli#265) - lets a reviewer open just the changed entries instead of the full archive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add diffs/ folder step now sets an output flag and echoes ::warning:: on failure instead of silently swallowing it via continue-on-error, matching the sibling download step's pattern. - Pin the silverfin-cli install to a commit that actually has --add-diffs-folder (it isn't on main yet); previously this workflow called a flag that main doesn't have. - Add a final fallback line when neither artifactUrl nor reportUrl is set, and note the artifact link requires GitHub sign-in. - Sync README's run_sampler.yml section, which described the old report-URL-primary priority and didn't mention the diffs/ step. Addresses review feedback from PR #35. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
If the token write-back step above it fails, the default success() guard would skip this download even when report_url is set. Addresses CodeRabbit feedback on PR #35. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
diffs_added was set but never consumed downstream, so a reviewer had no way to know the diffs/ folder was missing from the artifact short of digging through Actions logs. Addresses re-review feedback on PR #35. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
actions/github-script@v7 targets Node 20, which GitHub Actions now forces onto Node 24 with a deprecation warning. Co-authored-by: Cursor <cursoragent@cursor.com>
Account template identifiers are directory names and routinely contain
spaces ("Investment- and depreciation details"). The sampler encoded the
handles/account_templates inputs as space-separated strings and then
word-split them into CLI args, so -at received "Investment-", "and",
"depreciation", "details" and the run died with:
[error] Config file for account template "Investment-" not found
Switch both inputs to one-name-per-line and build the arg arrays with
mapfile, so each line becomes exactly one argv entry. This is already the
convention in run_tests.yml (TEMPLATE_BUCKETS) — the sampler was the only
place that regressed to space-joining. firm_ids stays space-separated;
it's numeric.
Also render the names in the PR comment as individually code-quoted,
comma-separated entries (a multi-line value inside one backtick pair
renders as garbage) and %q-quote the attempt log line so a spaced name is
visibly one argument.
Callers must now pass these inputs newline-separated — README and the
input descriptions updated accordingly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
WalkthroughChangesSampler workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Superseded by #37 — same one-commit fix, but branched off current |
Account template identifiers are directory names and routinely contain spaces (
account_templates/Investment- and depreciation details). Thehandles/account_templatesinputs were documented and encoded as space-separated strings, then deliberately word-split into CLI args — so-atreceivedInvestment-,and,depreciation,detailsand the run died:Hit live in lu_market: https://github.com/silverfin/lu_market/actions/runs/30612771053 (the PR under review changed exactly one file, inside that template).
Change
Both inputs are now one name per line, and the arg arrays are built with
mapfileso each line becomes exactly one argv entry. This is already the convention in this repo's ownrun_tests.yml(TEMPLATE_BUCKETS, with a comment saying why) — the sampler was the only place that regressed to space-joining.firm_idsstays space-separated; it's numeric, so theSC2086split there is still intentional.Two supporting bits in the same area:
%q-quoted, so a name containing spaces is visibly one argument.A caller still passing a space-joined list now fails loudly (
Config file for account template "..." not found) instead of silently sampling templates nobody asked for. I deliberately did not add a space-splitting fallback: for names containing spaces it cannot be made correct, and the loud failure is the honest outcome.Input descriptions and the README input list are updated to say one per line. The only callers today are the lu_market / nl_market wrappers, which currently run inlined forks of this job (pinned to silverfin-cli's unmerged
sampler-compact-diff-v2branch); their matching fixes are silverfin/lu_market#784 and silverfin/nl_market#913. When those forks are reverted touses:after silverfin-cli #265 merges, this fix means they don't regress — but the newline-emittingclassifyhalf lives in the market repos, so the two halves must land together.Testing
The name-splitting logic was verified in bash against the real lu_market names (
Investment- and depreciation details+Loan details→ 3 argv entries, spaces intact); YAML validated. Not yet exercised in a live sampler run — see the market PRs for that.🤖 Generated with Claude Code