Skip to content

Publish a preview of the benchmark page with PR results on pastila.nl - #2388

Merged
alexey-milovidov merged 1 commit into
mainfrom
results-preview
Oct 4, 2026
Merged

alexey-milovidov merged 1 commit into
mainfrom
results-preview

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

For pull requests that add or change results (*/results/**), publish the benchmark page with those results on pastila.nl and link to it from the PR.

  • results-preview.yml (pull_request_target): results_preview.py takes the results of main, lays the PR's result files over them (added, changed, renamed or removed) and embeds the data into index.html in place of data.generated.js. It posts the page to pastila.nl unencrypted, gzipped, as a .html.gz link. The link is appended to the last comment if that comment is from the bot (a collect comment or an earlier preview, whose link it replaces); otherwise a new comment is posted.
  • collect-new-results.py includes the preview link in its comments and in the descriptions of automated results PRs. Its pushes use GITHUB_TOKEN, which doesn't trigger workflows, so the workflow above never runs for them.
  • The pastila code moves out of collect-new-results.py into a shared module, pastila.py, unchanged apart from optional gzip.

Security: no code from the PR runs. The PR head is fetched, not checked out, and result files are read from git objects as data. Symlinks are ignored, and < is escaped in the embedded data so a string in a result can't close the <script> tag.

Testing: on the current tree, the data results_preview.py generates equals the output of generate-results.sh (compared as sets; the shell sort order depends on the locale and the page sorts the data itself). A real paste of main data read back identical and renders in headless Chromium. Dry runs covered the workflow script against #2384 and the collect script's main-branch and fork-PR paths with fake runs. The collect script wasn't run against the real sink database, which needs its secret. The workflow hasn't run on GitHub yet; pull_request_target uses the workflow from the base branch, so it first runs after this is merged.

🤖 Generated with Claude Code

A new workflow (results-preview.yml, pull_request_target) builds index.html
with the data of main and the PR's result files embedded, publishes it on
pastila.nl unencrypted (gzipped), and appends the link to the last bot
comment or posts a new one. No PR code runs: result files are read from git
objects as data.

collect-new-results.py adds the link to its comments itself, because its
GITHUB_TOKEN pushes don't trigger workflows. The pastila code moves to a
shared module, pastila.py.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All good.

@alexey-milovidov alexey-milovidov self-assigned this Oct 4, 2026
@alexey-milovidov
alexey-milovidov merged commit ec3a4b2 into main Oct 4, 2026
3 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