Skip to content

Use current PR state in analyze workflow - #58411

Closed
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:fix/analyze-pr-live-state
Closed

Use current PR state in analyze workflow#58411
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:fix/analyze-pr-live-state

Conversation

@Abbondanzo

Copy link
Copy Markdown
Contributor

Summary:

The Analyze Pull Request workflow validates context.payload.pull_request, which is the event snapshot saved when a workflow run was created. Rerunning an old run after the PR description or base branch changes therefore validates stale state and can replace a passing check with an incorrect failure.

Fetch the current pull request through github.rest.pulls.get before validating its body and base branch so new runs and reruns behave consistently.

Changelog:

[INTERNAL]

Test Plan:

  • git diff --check
  • Parsed .github/workflows/analyze-pr.yml with Ruby YAML.
  • Executed both embedded github-script blocks with a mocked valid live PR and stale invalid event payload; both used the live state and passed.
  • Executed both blocks with an invalid live PR and valid stale event payload; both used the live state and failed.
  • Full repository formatting could not run locally because Yarn package downloads repeatedly failed through the environment proxy with HTTP 503.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 8, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Sep 8, 2026
@meta-codesync

meta-codesync Bot commented Sep 8, 2026

Copy link
Copy Markdown

@Abbondanzo has imported this pull request. If you are a Meta employee, you can view this in D119215496.

@Abbondanzo

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🤖 AI code review

Decision: Ready for human review

Overall PR risk: Low. The change modifies existing behavior so PR body and base checks read live PR data through the API. Blast radius is limited to the analyze-pr workflow, and revert restores payload reads. No critical or warning findings remain; the most plausible breakage is an API fetch failure stopping analysis where a payload read did not.

No findings.


This review is advisory — it never blocks a merge and never auto-approves.

@meta-codesync meta-codesync Bot closed this in b830082 Sep 8, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 8, 2026
@meta-codesync

meta-codesync Bot commented Sep 8, 2026

Copy link
Copy Markdown

@Abbondanzo merged this pull request in b830082.

@Abbondanzo
Abbondanzo deleted the fix/analyze-pr-live-state branch September 8, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant