Skip to content

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

Merged
dan-petty merged 5 commits into
release/v0.2.19from
fix/paginated-url-dry-run-reconciliation
Sep 17, 2026
Merged

dan-petty merged 5 commits into
release/v0.2.19from
fix/paginated-url-dry-run-reconciliation

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Description

Resolves an infinite loop during paginated GitHub CLI requests and optimizes dry-run project custom field reconciliation:

  1. RFC-Compliant Paginated URL Query Construction:

    • Replaces brittle if 'page=' in endpoint: substring check with urllib.parse (urlsplit, parse_qs, urlencode, urlunsplit) in _build_paginated_url and _extract_page_per_page.
    • Prevents substring collision between per_page= and page= which previously prevented page=2 from being appended, causing _run_gh_paginated to request page 1 indefinitely.
  2. Persistent Disk Response Caching & Optimized Dry-Run Reconciliation:

    • Updates DEFAULT_GH_CACHE_TTL_SECONDS to 60.0s and adds persistent disk response caching to GitHubRateLimiter under .data/cache/responses/.
    • Enables caching on _fetch_repository_issues and _fetch_repository_prs.
    • Constrains _fetch_repository_prs to state=open for linked issue extraction, avoiding historical closed PR pagination.
    • Constrains --dry-run evaluation in reconcile_project_custom_fields to items present on the project board (active_items), eliminating phantom updates on unboarded issues.
  3. PR Milestone Management:

    • Added --milestone (-m) option to devops pr edit (and FastMCP pr_edit) with fallback to REST API issue PATCH.
    • Assigned missing milestone v0.2.19 to release tracking PR feat(release): v0.2.19 #217.

Closes #233.

Copilot AI lite review requested due to automatic review settings September 17, 2026 22:06
@dan-petty dan-petty added this to the v0.2.19 milestone Sep 17, 2026

Copilot AI 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.

🟡 Changes recommended

It introduces a Python 3 SyntaxError in rate_limiter.py and the milestone fallback logic likely cannot work against the GitHub API as implemented.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes GitHub pagination and project reconciliation reliability/performance issues by moving pagination query manipulation to urllib.parse, adding persistent response caching, tightening candidate selection for dry-run project reconciliation, and extending devops pr edit / FastMCP pr_edit with milestone support.

Changes:

  • Refactor pagination helpers in github.rate_limiter to RFC-compliant query parsing/building and add regression tests for multi-page termination.
  • Add persistent disk-backed response caching to GitHubRateLimiter and enable caching for repository issues/PR fetches used by project reconciliation.
  • Extend PR edit commands/docs (CLI + FastMCP) with --milestone support and update generated help/reference docs.
File summaries
File Description
tests/test_pr_cmd.py Adds CLI coverage for devops pr edit --milestone.
tests/test_github_rate_limiter.py Adds regression tests for pagination URL building and multi-page pagination termination.
src/devops_cli/lang/en/help.py Adds help text for the new --milestone option.
src/devops_cli/github/rate_limiter.py Implements RFC-compliant pagination query handling and adds persistent response caching.
src/devops_cli/github/projects.py Enables caching for repo fetches, restricts PR fetch to open PRs, and limits dry-run reconciliation to board items.
src/devops_cli/config/defaults.py Increases default GitHub response cache TTL to 60s.
src/devops_cli/commands/pr.py Adds --milestone to devops pr edit and a fallback REST PATCH path.
src/devops_cli/ai/mcp/server.py Adds milestone wiring to FastMCP pr_edit.
README.md Updates command matrix wording for devops pr edit.
docs/MCP_TOOLS.md Documents new milestone parameter for pr_edit.
docs/commands/pr.md Updates CLI docs for devops pr edit to include --milestone.
docs/commands/gh.md Updates CLI docs for devops gh pr edit to include --milestone.
docs/CLI_REFERENCE.md Updates generated CLI reference to include --milestone for both pr edit commands.
docs/agent/tasks/task-233-paginated-url-dry-run-reconciliation.md Adds/updates task tracking for issue #233 work.
docs/agent/tasks/task-231-ci-realtime-streaming-rate-limiter-repos-clone.md Marks task #231 as Done with resolution notes.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/devops_cli/github/rate_limiter.py Resolved
Comment thread src/devops_cli/commands/pr.py Resolved
Comment thread src/devops_cli/github/projects.py Resolved
@dan-petty
dan-petty merged commit 17fad49 into release/v0.2.19 Sep 17, 2026
5 checks passed
@dan-petty
dan-petty deleted the fix/paginated-url-dry-run-reconciliation branch September 17, 2026 23:00
dan-petty added a commit that referenced this pull request Sep 18, 2026
* feat(release): v0.2.19

* fix(release): draft PR description generator and milestone deliverable resolution (#218) (#219)

* feat(release): fix draft PR description generator and milestone deliverable resolution

* docs(agent): track task 218 for release draft pr description generator fix

* fix(release): prevent duplicate text by formatting milestone issues as clean autolinks

* fix(release): isolate milestone cache, dynamic draft checklist, and mock run_gh in tests

* fix(ai): support main branch diffing and base resolution in review branch (#220) (#221)

* fix(ai): support main branch diffing and base resolution in review branch (#220)

* fix(review): propagate target_branch to target_ref and update task 220 status to In Review (#221)

* fix(github): treat copilot review as completed when zero unresolved threads remain (#216) (#222)

* fix(github): treat copilot review as completed when zero unresolved threads remain (#216)

* docs(agent): update task 216 with PR #222 and status In Review

* test(github): test monitor_pr across get_pr_monitoring_status boundary with mock threads (#222)

* feat(ai): adaptive embedding batch sizing circuit breaker and timeout fallback (#117) (#223)

* feat(ai): adaptive embedding batch sizing circuit breaker and timeout fallback (#117)

* docs(agent): link PR #223 and transition task 117 to In Review

* fix(ai): resolve review feedback on fallback cache poisoning and query key isolation (#117)

* perf(ai): high-performance AST context packer with binary search truncation (#118) (#224)

* perf(ai): high-performance AST context packer with binary search truncation (#118)

* docs(agent): link PR #224 and transition task 118 to In Review

* fix(ai): resolve review feedback on full-body binary search, empty AST isolation, and tokenizer prewarming (#118)

* fix(ai): accurately evaluate truncation boolean and expand test coverage (#118)

* fix(ai): polyglot tree-sitter file size boundary guard and resource containment (#119) (#225)

* fix(ai): polyglot tree-sitter file size boundary guard and resource containment (#119)

* fix(ai): harden repomap symlink resolution and syntax tuple

* test(ci): isolate ci workspace root to tmp_path to prevent unlinking active coverage

* perf(ai): parallel async branch and pr review worker pool with semaphore concurrency (#120) (#226)

* perf(ai): parallel async branch and pr review worker pool with semaphore concurrency (#120)

* docs(agent): link PR #226 to task-120 tracking

* fix(ai): address Copilot review feedback on error isolation and sanitization

* fix(security): sanitize CodeQL clear-text logging by recording exception type names

* feat(ai): llm structured output retry and json schema repair engine (#123) (#230)

* feat(ai): llm structured output retry and json schema repair engine (#123)

* fix(ci): remove redundant pr merge readiness gate and remediate review findings (#123) (#230)

* chore(ci): deduplicate pre-commit code checks and scope hooks to pre-commit stage

* chore(ci): real-time quality gate streaming, re-entrant rate limit locking, and repos clone destination (#231) (#232)

* chore(ci): real-time quality gate streaming, re-entrant rate limit locking, and project quota safety

* feat(repos): parse organization destination from clone url instead of hardcoding standalone

* docs(agent): add task-231 tracking for realtime CI, rate limiter locking, and repos clone

* docs(agent): link PR #232 to task-231 tracking

* fix(gh): isolate disk quota lock yield and add fallback pacing for unknown quotas

* docs(agent): document task-231 CI failure remediation and merge readiness

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

* docs(agent): record PR #232 merge and close task 231

* fix(github): resolve paginated url replacement loop, optimize dry-run project reconciliation, and add pr edit milestone (#233)

* docs(agent): update task 233 status to in-review and link PR #234

* fix(github): resolve PR review comments for #234 with milestone resolution, off-board dry-run test, and tuple except syntax

* fix: config

* fix(github): eliminate bare gh invocations, harden rate limiter quota tracking, and optimize project reconciliation (#235) (#236)

* fix(github): eliminate bare gh invocations, harden rate limiter quota tracking, and optimize project reconciliation (#235)

* fix(github): replace hardcoded gh CLI strings with CONST_GH_CLI constant (#235)

* fix(github): resolve review feedback on mutation budgeting, rate limiter caching, and milestone editing (#235)

- Pass shared MutationBudget across issue sync, candidate provisioning, and custom field edits to enforce a strict aggregate cap of 25 mutations
- Reject all HTTP mutation methods (POST, PUT, PATCH, DELETE) and field arguments in _is_cacheable_api_call
- Retain --milestone option on devops pr edit with REST fallback
- Raise GitHubRateLimitError instead of bare TypeError on non-dictionary data in QuotaState.from_dict
- Enforce max_backoff in calculate_backoff_delay and quota_max_age in QuotaState.is_valid
- Account effective_cost during limiter.acquire() and eliminate redundant second decrement in _post_process_run
- Update Task 235 tracking to PR #236 and Status: In Review

* fix(github): eliminate delay-bypassing caps and mock external calls in tests (#235)

- Remove DEFAULT_GH_MAX_PACING_DELAY_SECONDS and DEFAULT_GH_MAX_BACKOFF_SECONDS to ensure mandatory pauses are never bypassed or truncated
- Ensure _acquire_locked pauses for full calculated request delay and calculate_backoff_delay pauses for full duration until reset
- Properly mock _resolve_project_owner_arg in project tests to eliminate unmocked rate limit network calls

* fix(github): eliminate bare gh invocations, error masking, and inaccurate quota defaults (#237) (#238)

* fix(github): eliminate bare gh invocations, error masking, and inaccurate quota defaults (#237)

* docs(agent): link PR #238 in task-237 tracking

* fix(github): resolve review feedback on error classification, syntax, and sync resiliency (#237)

* feat(k8s): minikube gpu detection and dynamic service nodeport reachability fallback (#126) (#239)

* feat(k8s): minikube gpu detection and dynamic service nodeport reachability fallback (#126)

* docs(agent): update task-126 status to in review with pr #239

* fix(k8s): resolve PR #239 review feedback on valkey normalization, scheme fallback, and sanitization

* feat(devcontainer): build from debian:sid with python3.14, uv 0.12.16, and CI caching optimizations

* fix(devcontainer): normalize VERSION_CODENAME to trixie for devcontainer feature compatibility

* feat(ai): proactive model prewarming and vram eviction governance (#127) (#240)

* feat(ai): streaming reasoning think token parser and bounded stream sanitizer (#128) (#241)

* feat(ai): streaming reasoning think token parser and bounded stream sanitizer (#128)

* docs(task): update task-128 PR link to #241

* fix(ai): resolve review feedback on streaming reasoning and error bounds

* feat(ai): high-throughput LLM gateway and distributed model router (#142) (#242)

* feat(ai): high-throughput LLM gateway and distributed model router (#142)

* docs(agent): update task-142 tracking with PR #242

* fix(ai): remediate review comments on llm gateway, vllm manifests, and router (#142)

* fix: address PR #217 comments, remediate uv diagnostics, and add uv-check/lockfile quality gates (#243)

* fix: address PR #217 comments, remediate uv diagnostics, upgrade dependencies, and add uv-check/lockfile quality gates

* fix(devcontainer): support sys_bin path parameter and add edge-case coverage for shadowed binary reconciliation

* fix: remove reconcile_shadowed_user_binaries and debian_sid test, honor table payload options, integrate outdated check into CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants