Skip to content

Fix ephemeral sampler report link; add diffs-only zip folder - #35

Merged
michieldegezelle merged 6 commits into
mainfrom
sampler-report-link-and-diffs-folder
Jul 29, 2026
Merged

Fix ephemeral sampler report link; add diffs-only zip folder#35
michieldegezelle merged 6 commits into
mainfrom
sampler-report-link-and-diffs-folder

Conversation

@michieldegezelle

Copy link
Copy Markdown
Collaborator

Summary

  • The presigned report_url posted as "Open full sampler report" on PR comments expires ~5 minutes after the run completes (confirmed against a real nl_market#899 comment) - the link is essentially always dead by the time a reviewer opens it. Now links 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 didn't happen.
  • Adds a diffs/ folder to the uploaded results.zip, containing before/after view.html only for the entries the compact diff flagged (data/scope/vanished-output/visual-only tiers) - 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 digging through the full (often ~150 MB) archive. Best-effort (continue-on-error: true) so a failure here never costs the plain results.zip artifact.

Test plan

  • actionlint clean (aside from the known queue: max false-positive already present on main)
  • Merge silverfin-cli#265 first (or point this at the branch temporarily) so --add-diffs-folder actually exists when this workflow runs
  • Trigger a real sampler run against a PR and confirm the comment links to a working artifact URL, and that the uploaded zip has a populated diffs/ folder

🤖 Generated with Claude Code

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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0cab4a17-e1b7-4b5f-b2de-e17f2de2a50f

📥 Commits

Reviewing files that changed from the base of the PR and between d0e3b1d and 22db1c6.

📒 Files selected for processing (2)
  • .github/workflows/run_sampler.yml
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/run_sampler.yml

Walkthrough

The sampler workflow pins its CLI, conditionally enriches downloaded results with diffs/, uploads a 7-day artifact, and prefers that artifact URL in pull request comments with a short-lived report URL fallback.

Changes

Sampler results workflow

Layer / File(s) Summary
Pin, enrich, and upload sampler results
.github/workflows/run_sampler.yml
The workflow pins silverfin-cli, tracks results.zip download status, conditionally adds diff output, and uploads the results artifact.
Expose artifact URL in pull request comments
.github/workflows/run_sampler.yml, README.md
The GitHub Script receives the artifact URL, prefers it in comments, reports enrichment failures, and documents the artifact-first flow with the presigned URL fallback.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has a solid summary and test plan, but it omits the template’s Fixes #, type of change, and checklist sections. Add the missing Fixes # reference, type-of-change checkboxes, and checklist items from the repository template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing the sampler report link and adding a diffs-only zip folder.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sampler-report-link-and-diffs-folder

Comment @coderabbitai help to get the list of available commands.

@michieldegezelle

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/run_sampler.yml:
- Around line 302-308: Pin the silverfin-cli installation in the workflow to the
specific revision that introduced and supports the run-sampler --from-zip
--add-diffs-folder option, replacing the unpinned main reference. Keep the
existing Add diffs/ folder step and its best-effort behavior unchanged.
- Around line 302-308: Update the “Add diffs/ folder” step to avoid writing
directly over results.zip: run the enrichment into a temporary archive, then
atomically rename it to results.zip only after successful completion. Preserve
the existing best-effort behavior and ensure a failed enrichment leaves the
original results.zip available for upload.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f67d64b9-b4f2-4502-a2e7-fc7dc16f7c4e

📥 Commits

Reviewing files that changed from the base of the PR and between 794e815 and 615664d.

📒 Files selected for processing (1)
  • .github/workflows/run_sampler.yml

Comment thread .github/workflows/run_sampler.yml Outdated
Comment thread .github/workflows/run_sampler.yml Outdated
Comment thread .github/workflows/run_sampler.yml Outdated

@michieldegezelle michieldegezelle left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Major — README.md:277 is now stale relative to this PR (not touched in this diff, so posting as a general comment)

README.md's run_sampler.yml documentation still reads (line 277):

Posts (or updates) a result comment on the PR with the compact diff and, when a report URL was produced, a link to the full report — otherwise the results.zip artifact is the fallback.

This PR flips that priority: the GitHub Actions artifact link (steps.upload.outputs.artifact-url) is now the primary link, and the presigned report_url is only the fallback when the artifact upload did not happen — the opposite of what the README describes. The README also has no mention at all of the new "Add diffs/ folder for the entries the compact diff flagged" step.

run_sampler.yml is the one reusable workflow in this repo with a maintained README section (unlike check_auth.yml/run_tests.yml/push_to_review_firm.yml), and past PRs on this workflow (#24, #30) kept that section in sync with behavior changes in the same PR — worth doing the same here, e.g.:

* Posts (or updates) a result comment on the PR with the compact diff and a link to the workflow artifact (kept 7 days) as the primary way to open the full report; falls back to the presigned report URL (short-lived, ~5 min) only if the artifact upload did not happen.
* Re-runs `run-sampler --from-zip results.zip --add-diffs-folder` locally (best-effort, no network) to add a `diffs/` folder to the uploaded artifact for the entries the compact diff flagged.

- 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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 276-277: Add a brief note in the README near the workflow artifact
link description explaining that opening the retained artifact requires GitHub
authentication/sign-in. Keep the existing artifact and presigned-URL behavior
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 54aa7210-e298-4231-b217-13eee833e972

📥 Commits

Reviewing files that changed from the base of the PR and between 615664d and e5916ae.

📒 Files selected for processing (2)
  • .github/workflows/run_sampler.yml
  • README.md

Comment thread README.md Outdated
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>
Comment thread .github/workflows/run_sampler.yml
michieldegezelle and others added 3 commits July 29, 2026 12:07
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>
@michieldegezelle
michieldegezelle merged commit cecff38 into main Jul 29, 2026
7 checks passed
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