Skip to content

Make the lexer benchmark succeed on fork pull requests - #617

Open
x-rush wants to merge 1 commit into
WordPress:trunkfrom
x-rush:fix/lexer-benchmark-fork-prs
Open

x-rush wants to merge 1 commit into
WordPress:trunkfrom
x-rush:fix/lexer-benchmark-fork-prs

Conversation

@x-rush

@x-rush x-rush commented Nov 6, 2026

Copy link
Copy Markdown

Problem

The "Lexer throughput (base vs PR)" check always fails on pull requests from forks, even when the benchmark itself succeeds. GitHub runs fork pull request workflows with a read-only token regardless of the permissions the workflow requests, so the "Post or update the PR comment" step fails with 403 Resource not accessible by integration, marking the whole check as failed. Every external contribution touching lexer files currently reports a red check with the actual benchmark numbers buried in the logs.

Recent examples from external forks: #611 (three runs), and the same failure pattern reported by other contributors' lexer changes.

What changed

  1. The benchmark table is also written to the job summary ($GITHUB_STEP_SUMMARY), so the results are visible on the run page for every contributor — no token permissions required. This is the actual goal of the workflow: making the numbers visible.
  2. The comment step is skipped for fork pull requests (github.event.pull_request.head.repo.fork != true). Fork PR authors read the results from the job summary, and the check succeeds.
  3. Branches in this repository keep posting and updating the comment exactly as before.

Testing

This pull request modifies the workflow's own path, so it triggers the workflow on a fork pull request and demonstrates the fixed behavior: the benchmark runs, the results appear in the job summary, the comment step is skipped, and the check is green.

Fork pull requests run with a read-only token, regardless of the
permissions the workflow requests, so posting or updating the result
comment always failed with a 403 and marked the whole check as failed,
even though the benchmark itself succeeded.

Write the benchmark table to the job summary, so the results are visible
on the run page for every contributor, and skip the comment step for
fork pull requests, where the read-only token cannot post comments.
Branches in this repository keep posting the comment as before.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f189b5b8-cd10-4441-be5e-aa53c268d4ea
Commits

Reviewing files that changed from the base of the PR and between 6ca5528 and b22302c.

Files selected for processing: 1

  • .github/workflows/lexer-benchmark.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

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