Skip to content

fix(github): resolve paginated url query replacement infinite loop and optimize dry-run project reconciliation #233

Closed

Description

@dan-petty

Summary

_build_paginated_url in devops_cli.github.rate_limiter checks if 'page=' in endpoint:, which matches per_page=100 as a substring. re.sub(r'([?&])page=\d+', ...) then fails to match, returning the endpoint unchanged without appending &page=2. This causes _run_gh_paginated to request page 1 indefinitely in an infinite loop.

Additionally, devops gh project reconcile --dry-run does not cache candidate issues/PRs and queries all historical closed PRs (state=all), causing --dry-run to execute for minutes rather than returning in seconds.

Root Cause

  1. In _build_paginated_url, substring match against page= triggers on per_page=.
  2. _fetch_repository_issues and _fetch_repository_prs do not specify use_cache=True with cache TTL.
  3. _fetch_repository_prs requests state=all even though _extract_linked_issue_numbers only inspects open PRs.
  4. --dry-run evaluates candidates that do not exist on the project board.

Proposed Fix

  1. Use standard library urllib.parse (urlsplit, parse_qs, urlencode, urlunsplit) in _build_paginated_url and _extract_page_per_page to reliably parse and replace the page query parameter.
  2. Enable client-side caching (use_cache=True, cache_ttl=DEFAULT_GH_CACHE_TTL_SECONDS) on repository issue and PR fetches.
  3. Optimize PR fetching to state=open for linked issue number resolution.
  4. In --dry-run mode, only evaluate items that exist in the active project board items.

Activity

  1. added this to the v0.2.19 milestone on Sep 17, 2026
  2. added
    type/bug
    scope/cli
    scope/github
    priority/p1-high
    on Sep 17, 2026
  3. added a commit that references this issue on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/cliscope/githubtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions