Skip to content

refactor: extract issue radar client boundaries - #7604

Merged
iamwhatever merged 1 commit into
mainfrom
refactor/issue-radar-client-boundaries
Sep 2, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
refactor/issue-radar-client-boundaries

Conversation

@bolichen97

@bolichen97 bolichen97 commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Issue Radar's provider clients combine their stable route-facing API with transport mechanics, payload normalization, and query orchestration. That coupling makes provider changes harder to review and risks breaking long-standing import and monkeypatch seams.

Why it matters

Routes, parity checks, tests, and spawn audits rely on github_client, gitlab_client, and azure_client as stable provider boundaries. Separating responsibilities makes those implementations easier to maintain without changing provider behavior.

What changed (motivation → approach → change)

  • Kept the three client modules as composition façades, retaining their protocol surface, exception aliases, constants, and patchable I/O chokepoints.
  • Extracted provider transport and normalization into *_transport.py and *_normalization.py.
  • Extracted GitHub GraphQL, dependency, readiness, and search planning into github_queries.py.
  • Injected each façade's current bindings into the helpers so existing monkeypatch seams remain authoritative.
  • Updated the Issue Radar system spec to document these boundaries and the retained CLI spawn chokepoints.

This refactor is intended to be behavior-preserving: no request or provider behavior is meant to change, and no UI files or user-facing workflows changed.

Tests

  • Added compatibility coverage for Azure façade bindings, GitHub transport/normalization/query seams, and GitLab runner and pagination bindings.
  • SHA-current targeted suite at e7a1d3d: 1,364 passed, 57 skipped, with one xdist deprecation warning.
  • Static validation at the same SHA was green, including Black ratchet, isort, flake8, mypy across 1,245 source files, repository policy checks, documentation across 251 Markdown files, the 46-file vendor manifest, scrub, and committed/worktree diff checks.
  • Frontend validation was green after retrying two host-level startup races: 5,347 scoped tests, 1,499 Electron tests with 2 skips, TypeScript, ESLint at the 603-warning ceiling, production build, duplicate-code, analyze, and bundle-size gates.
  • The canonical backend diagnostic collected 76,252 tests and stopped at five setup errors after 4,950 passed and 137 skipped. All five occurred in test/test_app_art_route.py because this Windows host lacks symlink privilege (OSError [WinError 1314]); no Issue Radar test failed. Linux CI remains authoritative for those symlink-dependent cases.

Manual verification

Local GPT-contract and reduced-fidelity Opus-contract reviews at e7a1d3d reported no findings; true Claude was unavailable locally.

N/A — there is no UI change, so product walkthroughs and screenshots/video are not applicable.

Related Issues

No linked issue: this is an internal behavior-preserving refactor.

At review time, the sole overlap with an open PR is #7560, which adds explicit UTF-8 decoding to azure_client.py. That behavior change is intentionally not absorbed here: _az_run retains its current text=True decoding so this refactor remains behavior-preserving.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

@bolichen97
bolichen97 requested review from a team and patrigao September 1, 2026 11:25
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e7a1d3d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Spawn chokepoints verified: _glab_run/_az_run stay in the façades and the transport modules only accept an injected run callable, matching the spec update shipped in the same commit. Bindings are passed at call time from module globals, so existing monkeypatch seams remain live; exception identity is preserved via aliases to the shared Provider* classes. The spec doc was updated in the same commit as required. No design-level defects found.

Design-Verdict: PASS

Behavior-preserving decomposition that keeps the façade seams, spawn-audit chokepoints, and exception identity intact — the right shape for this split.

[DESIGN-REVIEWED] e7a1d3d

Keep the provider clients as stable compatibility facades while moving transport, normalization, and GitHub query planning into focused sibling modules.

Preserve existing call signatures, patch seams, exception identity, CLI spawn chokepoints, and provider output shapes.
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

I have the full picture and every count I need. Composing the review.

First-Principles-Verdict: CONCERNS

The injection layer defends monkeypatch seams that had zero users before this PR invented them, and the "easier to review" split ships +418 net lines with the façades still 3,193/2,579/1,808 lines.

What this change ships

Intent: restructure the three Issue Radar provider clients into façade + transport/normalization/query modules so future provider changes are easier to review, preserving behavior — an ADDITION of structure, repairing no defect.

  1. Client internals moved into seven new sibling modules — unjustified move (no named victim, no measured cost)
  2. Every moved symbol still lives in its old module as an alias — second spelling, ~60 symbols
  3. Extracted helpers take ~50 caller-supplied function parameters — one consumer, generalized
  4. New patch seams (quote, sanitize_cli_stderr, minimal_env) invented and test-pinned — zero consumers
  5. json/tempfile/quote imports kept as "historical module export" — zero consumers
  6. github_transport re-wraps the spawn layer — duplicate of src/kiro_crew/github_runner.py
  7. Azure verdict comment corrected to match existing code — rides along, harmless
  8. create_label docstring deduplicated — rides along
  9. Spec section on the new boundaries — justified (AGENTS.md same-commit rule)
  10. Boundary tests pinning the delegation wiring — declared

Watch

  • The description's harm — coupling "risks breaking long-standing import and monkeypatch seams" — is a hazard this refactor itself creates; the status quo had no such risk. The mitigation then overshoots: base-commit tests patch exactly six of the injected names (_az_invoke ×115, _gh_run ×44, _glab_api ×34, _run_gh_api ×23, _az_run ×2, _glab_run ×1 — grep patch|setattr at 3a5824d); every other injected callable (quote_value, sanitize, body_file, org_url, _norm_reactions, _parse_summary_rows, …) had zero patchers and exists only for the tests this PR adds.
  • "Separating responsibilities makes those implementations easier to maintain" vs. the diff: backend goes 10,042 → 10,460 lines, and the seam preservation is partial anyway — patching azure_client._identity_login no longer affects _norm_issue, which now calls its normalization-module sibling.

Subtractions

  • Drop the ~50 zero-patcher injected parameters (keep only the six counted runner seams: run/invoke_one/gh_run/run_api); extracted helpers call module-local siblings directly, and the three "seam remains authoritative" tests for quote/minimal_env/sanitize_cli_stderr go with them.
  • Delete the # noqa: F401 -- historical module export imports in azure_client.py (json, tempfile) and gitlab_client.py (json, quote) — zero patchers or readers counted at base.
  • Fold github_transport.resolve_binary/run back into the façade — each is a 1-consumer pass-through over kiro_crew.github_runner, which already owns gh spawn mechanics.

[FIRST-PRINCIPLES-REVIEWED] e7a1d3d

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e7a1d3d

Verdict parsed from the review's SHA-scoped output markers for commit e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e7a1d3d66b3d8e79eaa13a499e3ab77d633bdc64: <one-sentence reason>

@bolichen97
bolichen97 force-pushed the refactor/issue-radar-client-boundaries branch from 62d9979 to e7a1d3d Compare September 1, 2026 11:52
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 1, 2026
@iamwhatever
iamwhatever merged commit e6ecc6a into main Sep 2, 2026
71 of 78 checks passed
@iamwhatever
iamwhatever deleted the refactor/issue-radar-client-boundaries branch September 2, 2026 00:37
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 2, 2026
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.

2 participants