Skip to content

ci: overwrite runner event file so reviewdog detects fork PRs#10589

Open
openroad-ci wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci/clang-tidy-post-overwrite-event
Open

ci: overwrite runner event file so reviewdog detects fork PRs#10589
openroad-ci wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci/clang-tidy-post-overwrite-event

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

Summary

clang-tidy-bazel-post posted no review comments on fork PRs — reviewdog exited with reviewdog: this is not PullRequest build. on every run (#10550, #10553, #10226, #10565).

Root cause (confirmed)

GITHUB_EVENT_PATH and GITHUB_EVENT_NAME are runner-protected default env vars. The step-level env: override we used to point reviewdog at a synthesized pull_request payload is silently dropped — the runner re-injects the real workflow_run event file, whose payload has no usable pull_request (its pull_requests[] is empty for fork PRs). reviewdog's cienv parses that file, sees PullRequest == 0, and bails before posting. Our synthesized side file was correct but never read.

Proof, from the debug-gated diagnostic step on public run 26681282929 attempt 2 (PR #10565) — the step set both overrides, yet env inside it reported:

GITHUB_EVENT_NAME=workflow_run                                         # wanted pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json  # wanted our synth file

and that runner file carried "pull_requests": [].

Fix

Stop overriding the env pointer (a no-op). Instead overwrite the runner's event file in place with the synthesized pull_request payload. reviewdog's cienv only parses the file at GITHUB_EVENT_PATH (it does not check GITHUB_EVENT_NAME), so the overwrite alone makes detection succeed. Owner/repo/head-sha all come from the payload we write, so the now-dead GITHUB_* overrides on the reviewdog step are removed. Nothing after the synth step depends on the original workflow_run event, so overwriting it is safe.

The debug-gated diagnostic step (runner.debug == '1') is kept and updated to verify the event file now holds the synthesized payload.

Test plan

clang-tidy-bazel-post posted no review comments on fork PRs: reviewdog
exited with "this is not PullRequest build" on every run (PRs The-OpenROAD-Project#10550,
The-OpenROAD-Project#10553, The-OpenROAD-Project#10226, The-OpenROAD-Project#10565).

Root cause, confirmed via a debug-gated env dump (public run 26681282929
attempt 2 on PR The-OpenROAD-Project#10565): GITHUB_EVENT_PATH and GITHUB_EVENT_NAME are
runner-protected default env vars. The step-level `env:` override we used
to point reviewdog at a synthesized pull_request payload is silently
dropped -- the runner re-injects the real workflow_run event file, whose
payload carries no usable pull_request (its pull_requests[] is empty for
fork PRs). reviewdog's cienv parses that file, sees PullRequest == 0, and
bails before posting. The synthesized side file was correct but never read.

Fix: stop trying to override the env pointer (a no-op) and instead
overwrite the runner's event file in place with the synthesized
pull_request payload. reviewdog's cienv only parses the file at
GITHUB_EVENT_PATH (it does not check GITHUB_EVENT_NAME), so the overwrite
alone makes detection succeed. Owner/repo/head-sha all come from the
payload we write, so the now-dead GITHUB_* overrides on the reviewdog step
are removed. Nothing after the synth step depends on the original
workflow_run event, so overwriting it is safe.

The debug-gated diagnostic step (runner.debug == '1') is kept and updated
to verify the event file now holds the synthesized payload.

Signed-off-by: Joao Luis Sombrio <sombrio@sombrasoft.dev>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@sombraSoft sombraSoft marked this pull request as ready for review June 3, 2026 19:05
@sombraSoft sombraSoft requested a review from a team as a code owner June 3, 2026 19:05
@sombraSoft sombraSoft requested a review from osamahammad21 June 3, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants