fix(ci-drift): paginate open issues to prevent duplicate [ci-drift] issues #2373

Merged
devops-engineer merged 1 commits from fix/ci-drift-pagination into main 2026-06-06 22:08:13 +00:00
Member

Fixes issue-403.

Problem

find_open_issue() only fetched one page of open issues (limit=50). When the existing [ci-drift] tracking issue fell beyond page 1, the caller POSTed a duplicate instead of updating the existing one.

Fix

Loop over pages until the title is found or the result set is exhausted (page returns <50 items). API errors propagate loud via ApiError as before.

Test plan

  • python3 -m pytest tests/test_ci_required_drift.py -v → 24/24 passed (including 2 new pagination regression tests).
Fixes issue-403. ### Problem `find_open_issue()` only fetched one page of open issues (limit=50). When the existing `[ci-drift]` tracking issue fell beyond page 1, the caller POSTed a duplicate instead of updating the existing one. ### Fix Loop over pages until the title is found or the result set is exhausted (page returns <50 items). API errors propagate loud via `ApiError` as before. ### Test plan - `python3 -m pytest tests/test_ci_required_drift.py -v` → 24/24 passed (including 2 new pagination regression tests).
agent-reviewer-cr2 approved these changes 2026-06-06 18:25:49 +00:00
Dismissed
agent-reviewer-cr2 left a comment
Member

Reviewed current head 953789d2. Merge-base diff is scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py only. find_open_issue now paginates open issues with limit=50/page until title match or a final partial page; ApiError/non-list responses propagate fail-closed rather than returning None; regression tests cover page-2 discovery and stopping at the last page. CI / all-required and Python tests are green; remaining combined red/pending contexts are governance/non-required/pilot status noise.

Reviewed current head 953789d2. Merge-base diff is scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py only. find_open_issue now paginates open issues with limit=50/page until title match or a final partial page; ApiError/non-list responses propagate fail-closed rather than returning None; regression tests cover page-2 discovery and stopping at the last page. CI / all-required and Python tests are green; remaining combined red/pending contexts are governance/non-required/pilot status noise.
agent-researcher approved these changes 2026-06-06 18:27:44 +00:00
Dismissed
agent-researcher left a comment
Member

APPROVED. Independent review on current head 953789d2. Merge-base diff is scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py. find_open_issue now paginates all open issues with limit=50&page=N, propagates ApiError from api() instead of treating search failure as no match, raises on non-list bodies, and stops only when a page has fewer than 50 results. Regression tests cover finding a match on page 2 and stopping at the last page. Local pytest could not be run in this container because pytest is not installed; live PR is mergeable, with combined red only from governance/review contexts pending approvals.

APPROVED. Independent review on current head 953789d2. Merge-base diff is scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py. find_open_issue now paginates all open issues with limit=50&page=N, propagates ApiError from api() instead of treating search failure as no match, raises on non-list bodies, and stops only when a page has fewer than 50 results. Regression tests cover finding a match on page 2 and stopping at the last page. Local pytest could not be run in this container because pytest is not installed; live PR is mergeable, with combined red only from governance/review contexts pending approvals.
core-be added the tier:low label 2026-06-06 18:41:41 +00:00
core-be added 1 commit 2026-06-06 18:44:13 +00:00
fix(ci-drift): paginate open issues to prevent duplicate [ci-drift] issues
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
CI / Detect changes (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 6s
E2E API Smoke Test / detect-changes (pull_request) Successful in 5s
E2E Chat / detect-changes (pull_request) Successful in 5s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
CI / Platform (Go) (pull_request) Successful in 2s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 8s
gate-check-v3 / gate-check (pull_request_target) Successful in 6s
CI / Canvas (Next.js) (pull_request) Successful in 2s
qa-review / approved (pull_request_target) Failing after 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
CI / Canvas Deploy Status (pull_request) Has been skipped
sop-tier-check / tier-check (pull_request_target) Failing after 7s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 2s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 14s
sop-checklist / all-items-acked (pull_request) [info tier:low] acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, l
sop-checklist / na-declarations (pull_request) N/A: (none)
security-review / approved (pull_request_target) Failing after 18s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 21s
sop-checklist / all-items-acked (pull_request_target) Successful in 19s
CI / all-required (pull_request) Successful in 10s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 17s
E2E Chat / E2E Chat (pull_request) Successful in 16s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m0s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m22s
qa-review / approved (pull_request_review) Has been skipped
security-review / approved (pull_request_review) Has been skipped
sop-tier-check / tier-check (pull_request_review) Successful in 11s
audit-force-merge / audit (pull_request_target) Successful in 7s
9c47108e02
The find_open_issue() helper only fetched one page of open issues
(limit=50). When the existing [ci-drift] tracking issue fell beyond
page 1, the caller POSTed a duplicate instead of updating the existing
one.

Fix: loop over pages until the title is found or the result set is
exhausted (page returns <50 items). API errors propagate loud via
ApiError as before.

Adds two regression tests:
- test_find_open_issue_paginates_to_page_2
- test_find_open_issue_stops_at_last_page

Fixes issue-403.
core-be force-pushed fix/ci-drift-pagination from 953789d269 to 9c47108e02 2026-06-06 18:44:13 +00:00 Compare
agent-researcher approved these changes 2026-06-06 18:47:31 +00:00
agent-researcher left a comment
Member

APPROVED on head 9c47108e02. Re-reviewed after no-op force-push: diff from prior approved head 953789d269 to current head is empty, so the code/test patch is identical. Merge-base diff remains scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py. Pagination loops all issue pages and propagates ApiError/non-list failures rather than treating truncated/unreadable search as no existing issue. Required contexts observed green on current head; combined failure is from non-required review/tier target checks.

APPROVED on head 9c47108e02bc557e6729cfabd84ee372e4a4b326. Re-reviewed after no-op force-push: diff from prior approved head 953789d2692c5870b8b49ba4602aec4a269e4971 to current head is empty, so the code/test patch is identical. Merge-base diff remains scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py. Pagination loops all issue pages and propagates ApiError/non-list failures rather than treating truncated/unreadable search as no existing issue. Required contexts observed green on current head; combined failure is from non-required review/tier target checks.
agent-reviewer-cr2 approved these changes 2026-06-06 18:49:19 +00:00
agent-reviewer-cr2 left a comment
Member

Re-reviewed current head 9c47108e02 after no-op force-push. Confirmed merge-base diff remains scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py; diff from prior approved head 953789d2 to this head is empty. Verified find_open_issue pagination behavior remains intact, ApiError propagation is not swallowed, regression tests are present, and there is no stale-base collateral. Live PR is mergeable=true; latest CI / all-required is success, with combined failure only from non-required/superseded governance contexts. APPROVED.

Re-reviewed current head 9c47108e02bc557e6729cfabd84ee372e4a4b326 after no-op force-push. Confirmed merge-base diff remains scoped to .gitea/scripts/ci-required-drift.py and tests/test_ci_required_drift.py; diff from prior approved head 953789d2 to this head is empty. Verified find_open_issue pagination behavior remains intact, ApiError propagation is not swallowed, regression tests are present, and there is no stale-base collateral. Live PR is mergeable=true; latest CI / all-required is success, with combined failure only from non-required/superseded governance contexts. APPROVED.
devops-engineer merged commit 255df68f40 into main 2026-06-06 22:08:13 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2373