Use current PR state in analyze workflow - #58411
Closed
Abbondanzo wants to merge 1 commit into
Closed
Conversation
|
@Abbondanzo has imported this pull request. If you are a Meta employee, you can view this in D119215496. |
Contributor
Author
|
/review |
🤖 AI code reviewDecision: 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. |
|
@Abbondanzo merged this pull request in b830082. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.getbefore validating its body and base branch so new runs and reruns behave consistently.Changelog:
[INTERNAL]
Test Plan:
git diff --check.github/workflows/analyze-pr.ymlwith Ruby YAML.github-scriptblocks with a mocked valid live PR and stale invalid event payload; both used the live state and passed.