Skip to content

[PAI-2131] fix: declare the cursor on initiative list responses - #83

Merged
akhil-vamshi-konam merged 1 commit into
release-0.3.3from
fix/pai-2131-initiatives-list-pagination
Nov 18, 2026
Merged

akhil-vamshi-konam merged 1 commit into
release-0.3.3from
fix/pai-2131-initiatives-list-pagination

Conversation

@akhil-vamshi-konam

@akhil-vamshi-konam akhil-vamshi-konam commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Was: PaginatedInitiativeResponse and PaginatedInitiativeLabelResponse declared only results. Plane pages both lists (20 by default), but the cursor fields were untyped extras, so callers concluded the lists don't paginate. The Plane MCP connector read it that way and returned page one as every initiative.
  • Now: both subclass PaginatedResponse, like the other 40 list responses, so next_cursor, next_page_results, total_count and the rest are typed fields.
  • No runtime change for callers that read extras: extra="allow" already kept the values.

Where to look

  1. 🔴 plane/models/initiatives.py — the two base classes
  2. 🟡 tests/unit/test_initiatives.py — test_list_declares_the_cursor, offline

Proof

  • pytest tests/unit/test_initiatives.py -k cursor: passes; fails for both models on main
  • ruff check, black --check on both files: clean
  • Not verified: the live-server smoke tests in tests/unit (need PLANE_BASE_URL)

Links

  • Work item: PAI-2131

Summary by CodeRabbit

  • Improvements
    • Initiative and initiative-label paginated responses now include cursor, next-page availability, and total-count information.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1633a62d-9595-4238-85d1-62fc1d028512

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The initiative and initiative-label paginated response models now inherit from PaginatedResponse. Tests verify that both models declare and preserve pagination values.

Changes: Initiative pagination

Layer / File(s) Summary
Shared pagination models
plane/models/initiatives.py, tests/unit/test_initiatives.py
Both paginated response models inherit from PaginatedResponse and retain their existing response fields. Parameterized tests check pagination field declarations and sample values after validation.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: saurabhkmr98

Merge Risk: Minimal · previous review ae290

This change types the pagination fields on initiative and initiative-label list responses, so callers can read the cursor, next-page flag and total count directly. Behavior is expected to be unchanged for servers that already return the full pagination envelope. The earlier worry that a response missing a pagination field would now be rejected is unconfirmed, and nothing in the code points to such a response. The change looks safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and the affected area: declaring the cursor on initiative list responses. The raw summary shows the change makes both PaginatedInitiativeResponse and PaginatedInitiativeLabelRe…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the fix and the affected area: declaring the cursor on initiative list responses. The raw summary shows the change makes both PaginatedInitiativeResponse and PaginatedInitiativeLabelResponse inherit from PaginatedResponse, which types next_cursor, next_page_results, and total_count. The title matches the main change. The ticket prefix and conventional-commit 'fix:' label are acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e9ea699-7b20-4ebb-8b70-1a9a4ecc643d
Commits

Reviewing files that changed from the base of the PR and between 86c1b85 and ae290d0.

Files selected for processing: 2

  • plane/models/initiatives.py
  • tests/unit/test_initiatives.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@makeplane

makeplane Bot commented Nov 17, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@akhil-vamshi-konam
akhil-vamshi-konam force-pushed the fix/pai-2131-initiatives-list-pagination branch from ae290d0 to 832414c Compare November 18, 2026 14:26
@akhil-vamshi-konam
akhil-vamshi-konam changed the base branch from main to release-0.3.3 November 18, 2026 14:27
@akhil-vamshi-konam
akhil-vamshi-konam merged commit 63541fd into release-0.3.3 Nov 18, 2026
5 checks passed
@akhil-vamshi-konam
akhil-vamshi-konam deleted the fix/pai-2131-initiatives-list-pagination branch November 18, 2026 14:27
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