fix(workitems): filter work items by state in the GitLab query - #611
Conversation
browse_work_items list filtered by state after GitLab had paginated the unfiltered list, so closed items newer than an open one pushed it off the page: a page came back empty or short while hasMore was true, and hasMore described the unfiltered list. The namespace, project and group listing queries now pass state (IssuableState: opened/closed, no filter for both) and the client-side filter is gone; an empty state list matches nothing without a request. Closes #610
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: structured-world/gitlab-mcp/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughWork item listing now passes supported state filters to GitLab before pagination. The browse handler maps OPEN and CLOSED to GitLab state values, omits the filter when both are requested, and returns an empty result without a GitLab request for an empty state list. ChangesWork item state filtering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant browse_work_items
participant WorkItemListQuery
participant GitLabGraphQL
browse_work_items->>WorkItemListQuery: Pass mapped state and pagination variables
WorkItemListQuery->>GitLabGraphQL: Request work items
GitLabGraphQL-->>WorkItemListQuery: Return filtered items and page information
WorkItemListQuery-->>browse_work_items: Return filtered page
Merge Risk: ⚪ Minimal · up to Work item listings apply the requested state before pagination. No identified issue needs resolution before merging. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |



Summary
browse_work_itemslistfiltered bystateafter GitLab had paginated the unfiltered list. Closed items newer than an open one pushed it off the page, so a page could come back empty or short whilehasMorewastrue, andhasMoredescribed the unfiltered list.state(IssuableState):OPENmaps toopened,CLOSEDtoclosed, both to no filter.hasMorenow describe the requested states only.statelist still matches nothing, now without a request to GitLab.Testing
Lint, unit tests and the integration suite against a live GitLab instance. The new integration test lists open items when two newer items are closed and checks the open one is on the first page.
Closes #610
Summary by CodeRabbit