Skip to content

feat(attestation): expand PR reviewers with requested status and review state#2894

Closed
javirln wants to merge 1 commit into
chainloop-dev:mainfrom
javirln:javirln/gh-pr-reviews
Closed

feat(attestation): expand PR reviewers with requested status and review state#2894
javirln wants to merge 1 commit into
chainloop-dev:mainfrom
javirln:javirln/gh-pr-reviews

Conversation

@javirln

@javirln javirln commented Mar 20, 2026

Copy link
Copy Markdown
Member

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.

…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>
@javirln javirln requested review from Piskoo, jiparis and migmartri March 20, 2026 11:45
@javirln javirln closed this Mar 20, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@cubic-dev-ai cubic-dev-ai Bot Mar 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

},
"additionalProperties": false,
"type": "object",
"required": [

@cubic-dev-ai cubic-dev-ai Bot Mar 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

View Feedback

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>
Fix with Cubic

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