feat(attestation): expand PR reviewers with requested status and review state#2894
Closed
javirln wants to merge 1 commit into
Closed
feat(attestation): expand PR reviewers with requested status and review state#2894javirln wants to merge 1 commit into
javirln wants to merge 1 commit into
Conversation
…ew state Add Requested and ReviewStatus fields to prinfo.Reviewer to track which reviewers were explicitly requested vs who submitted reviews. For GitHub PRs, merge requested reviewer lists from both event payload and API endpoint, then overlay review states from /reviews API. For GitLab, mark all API-retrieved reviewers as requested. Bump PR info schema to v1.2. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/schemavalidators/internal_schemas/prinfo/pr-info-1.2.schema.json">
<violation number="1" location="internal/schemavalidators/internal_schemas/prinfo/pr-info-1.2.schema.json:84">
P2: Require `reviewers[].requested` in the schema so reviewer request state is explicit (true/false) rather than omitted.
(Based on your team's feedback about preferring explicit states over omission/nil.) [FEEDBACK_USED]</violation>
</file>
<file name="pkg/attestation/crafter/prmetadata.go">
<violation number="1" location="pkg/attestation/crafter/prmetadata.go:266">
P1: `fetchGitHubReviews` only reads the first paginated response from GitHub, so reviewer states can be stale/incomplete on PRs with many review events.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| return nil | ||
| } | ||
|
|
||
| apiURL := fmt.Sprintf("%s/repos/%s/%s/pulls/%s/reviews", baseURL, owner, repo, prNumber) |
There was a problem hiding this comment.
P1: fetchGitHubReviews only reads the first paginated response from GitHub, so reviewer states can be stale/incomplete on PRs with many review events.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pkg/attestation/crafter/prmetadata.go, line 266:
<comment>`fetchGitHubReviews` only reads the first paginated response from GitHub, so reviewer states can be stale/incomplete on PRs with many review events.</comment>
<file context>
@@ -146,6 +184,142 @@ func extractGitHubPRMetadata(envVars map[string]string) (bool, *PRMetadata, erro
+ return nil
+ }
+
+ apiURL := fmt.Sprintf("%s/repos/%s/%s/pulls/%s/reviews", baseURL, owner, repo, prNumber)
+
+ client := &http.Client{Timeout: 10 * time.Second}
</file context>
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ |
There was a problem hiding this comment.
P2: Require reviewers[].requested in the schema so reviewer request state is explicit (true/false) rather than omitted.
(Based on your team's feedback about preferring explicit states over omission/nil.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/schemavalidators/internal_schemas/prinfo/pr-info-1.2.schema.json, line 84:
<comment>Require `reviewers[].requested` in the schema so reviewer request state is explicit (true/false) rather than omitted.
(Based on your team's feedback about preferring explicit states over omission/nil.) </comment>
<file context>
@@ -0,0 +1,103 @@
+ },
+ "additionalProperties": false,
+ "type": "object",
+ "required": [
+ "login",
+ "type"
</file context>
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.
Add Requested and ReviewStatus fields to prinfo.Reviewer to track which reviewers were explicitly requested vs who submitted reviews. For GitHub PRs, merge requested reviewer lists from both event payload and API endpoint, then overlay review states from /reviews API. For GitLab, mark all API-retrieved reviewers as requested. Bump PR info schema to v1.2.