Add more info to the get_pr command#267
Conversation
This adds the full list of status checks and the body of the reviews.
WalkthroughThe PR extends the GitHub PR details pipeline end-to-end. A new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wkfl/src/github.rs`:
- Around line 795-818: The status-check paging path in
get_pull_request_status_checks_page drops the fetched commit OID, which can
cause later pages to be merged into the wrong commit’s rollup. Update
GraphQLPrStatusChecksPage and the page handling in get_pull_request_details to
return and compare the commit OID from the paged commits(last: 1) result against
the original status_commit.oid before appending any additional contexts. If the
OIDs differ, stop merging and treat the page as belonging to a different head
commit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6f1ddf8c-b4da-466b-a486-a0062b2ace20
📒 Files selected for processing (6)
wkfl/src/actions.rswkfl/src/github.rswkfl/src/gql_queries/pr_details.graphqlwkfl/src/gql_queries/pr_details.rswkfl/src/gql_queries/pr_details_reviews.graphqlwkfl/src/gql_queries/pr_details_status_checks.graphql
| fn get_pull_request_status_checks_page( | ||
| &self, | ||
| owner: &str, | ||
| repo: &str, | ||
| pr_number: u64, | ||
| cursor: &str, | ||
| ) -> Result<Option<crate::gql_queries::pr_details::GraphQLCheckRunConnection>> { | ||
| let variables = pr_connection_variables(owner, repo, pr_number, cursor); | ||
| let data: GraphQLPrConnectionPageData<GraphQLPrStatusChecksPage> = self | ||
| .graphql_query(gql_queries::pr_details::STATUS_CHECKS_QUERY, &variables) | ||
| .with_context(|| { | ||
| format!("Failed to query GitHub GraphQL API for PR #{pr_number} status checks") | ||
| })?; | ||
|
|
||
| let page = pull_request_connection_page(data, owner, repo, pr_number, "status checks")?; | ||
| Ok(page | ||
| .commits_for_status | ||
| .nodes | ||
| .into_iter() | ||
| .flatten() | ||
| .next() | ||
| .and_then(|node| node.commit.status_check_rollup) | ||
| .map(|rollup| rollup.contexts)) | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Preserve the paged commit OID before appending more contexts.
This helper re-runs a query that still resolves commits(last: 1), then throws away the returned oid. If a push lands between page fetches, get_pull_request_details will append contexts from the new head into the old head’s rollup. Return the fetched commit OID with the page and compare it against the initial status_commit.oid before extending.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wkfl/src/github.rs` around lines 795 - 818, The status-check paging path in
get_pull_request_status_checks_page drops the fetched commit OID, which can
cause later pages to be merged into the wrong commit’s rollup. Update
GraphQLPrStatusChecksPage and the page handling in get_pull_request_details to
return and compare the commit OID from the paged commits(last: 1) result against
the original status_commit.oid before appending any additional contexts. If the
OIDs differ, stop merging and treat the page as belonging to a different head
commit.
This adds the full list of status checks and the body of the reviews.
Summary by CodeRabbit
New Features
Bug Fixes