Skip to content

ci: link benchmark commits to merged PRs - #19

Merged
zhouguangyuan0718 merged 1 commit into
xgo-dev:mainfrom
zhouguangyuan0718:codex/link-commits-to-pr
Aug 18, 2026
Merged

ci: link benchmark commits to merged PRs#19
zhouguangyuan0718 merged 1 commit into
xgo-dev:mainfrom
zhouguangyuan0718:codex/link-commits-to-pr

Conversation

@zhouguangyuan0718

Copy link
Copy Markdown
Collaborator

Summary

  • resolve recorded LLGo commits to the merged pull requests during Pages publication and cache the metadata in the run index
  • link commit headers, chart labels, and chart data points to the landing PR, with a commit-page fallback
  • keep A/B comparison selection independent from commit navigation and backfill existing Pages history

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -B -m unittest ci/llgo-size/test_enrich_pull_requests.py
  • bash -n ci/llgo-size/publish.sh ci/llgo-size/publish-site.sh
  • parsed both workflow YAML files with Ruby YAML
  • parsed ci/llgo-size/site/app.js with JavaScriptCore
  • git diff --check
  • verified a local Pages preview against 47 real historical runs: table links, chart labels, chart points, and A/B selection all remained functional
  • verified live commit-to-PR resolution for LLGo fcf1377168 to go1.25 llgo#2346

@zhouguangyuan0718
zhouguangyuan0718 merged commit b33be02 into xgo-dev:main Aug 18, 2026

@fennoai fennoai 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.

Review summary

Well-crafted PR that adds LLGo commit and merged-PR links to the Pages run index. The Python is clean and defensive: anchored repository/commit validation, path-traversal protection in repository_from_result, atomic temp-file writes, per-invocation caching, and a thoughtful scoped-token retry (all with real test coverage). The JS re-validates every URL against anchored https://github.com/... regexes and escapes all HTML interpolation, so a tampered index.json can't inject script. Security review found no issues.

A few minor findings inline. Nothing blocking.

Also worth noting (no reliable inline anchor):

  • Recovery cost (perf, low): Steady-state enrichment is ~1 API call per publish because pullRequestResolved is carried forward in publish.sh. But if that persisted state is ever lost (index regenerated from scratch, schema change, copy-forward failure), the next publish serially hits the GitHub API once per historical commit (30s timeouts, low anonymous rate limit) and can stall the job. A durable on-disk cache keyed by (repository, commit), independent of pullRequestResolved, would make recovery cheap. Not blocking given current steady-state behavior.

<p class="eyebrow">LLGo compiler benchmarks</p>
<h1>Binary size &amp; build-time history</h1>
<p class="lede">Binary size and build wall time across Go and LLGo modes. Smaller values rank better within each benchmark and commit.</p>
<p class="lede">Binary size and build wall time across Go and LLGo modes. Linked commit labels open the pull request that landed each revision.</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

User-facing text overstates that links always open a PR. commitHref (app.js:129-142) falls back to the plain GitHub commit URL whenever a run has no resolved pullRequestUrl (e.g. commits pushed directly to main, or lookups that returned nothing). In those cases the label opens a commit page, not a pull request. The code handles this correctly and the tooltip/aria text distinguishes the two, but this static copy (and line 37, "linked SHAs open their merged pull requests") claims unconditionally that links go to PRs. Consider softening to e.g. "open the merged pull request when one is known, otherwise the commit."

json.dump(index, index_file, indent=2)
index_file.write("\n")
os.replace(temporary, args.index)
print("Resolved {} LLGo commit(s); {} run(s) link to merged PRs".format(queries, linked))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Completion message mislabels queries as "Resolved ... commit(s)". queries counts GitHub API lookups performed this invocation (incremented only on a cache miss for a not-yet-resolved run); runs already marked pullRequestResolved are skipped before the cache block. On a typical incremental publish where most runs are already resolved via the carry-forward in publish.sh:142-152, this prints "Resolved 0 LLGo commit(s)" even though many commits are resolved and linked. Suggest wording like "Queried GitHub for {} LLGo commit(s)".

if run.get("pullRequestResolved") is True:
if run.get("pullRequestUrl"):
linked += 1
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

pullRequestResolved is sticky and can't self-correct a stale repository. This continue runs after line 118 rewrites run["llgoRepository"]. If a run was previously resolved against the fallback/default repository and a correct llgoRepository later becomes derivable (e.g. repository_from_result starts returning a value), the PR lookup is never re-run and pullRequestUrl keeps pointing at the old repository. Given the design re-runs enrichment idempotently on every publish, consider keying the resolved flag on (repository, commit) so a changed repository forces re-resolution — or a short comment documenting that resolution is intentionally sticky.

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