Skip to content

chore: remove scan command - #91

Open
claude[bot] wants to merge 1 commit into
mainfrom
chore/remove-scan-command
Open

chore: remove scan command#91
claude[bot] wants to merge 1 commit into
mainfrom
chore/remove-scan-command

Conversation

@claude

@claude claude Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Requested by boris · Slack thread

Before: polylane scan generated scan reports against every connected cloud account and integration, polled the scan_reports.* routes until they finished, ranked the risks, and offered to start per-risk investigations. It shipped with a hand-written src/client/scan-reports.ts (the routes were hidden in the OpenAPI spec, so the generated client never carried them), a registry entry at the top of root help, and its own test file.

After: The command, its client, and its tests are gone (src/commands/scan.ts, src/client/scan-reports.ts, test/scan.test.ts), along with the scan entries in src/commands/index.ts, src/registry.ts, src/main.ts (no-auth allowlist), and test/resolve.test.ts. codegen/parse-spec.ts now excludes /scan_reports paths and the Scan Report schema, following the automation removal in #89, so regenerating from the still-live spec does not reintroduce them. Root help drops from 23 resources to 22. Typecheck, lint, 430 tests, and the esbuild build all pass locally.

Pairs with the nominal PR that removes the scan_reports API routes.

🤖 Generated with Claude Code

https://claude.ai/code/session_011xFDGM6NBu3iivNKHJm9kD


Generated by Claude Code

Drop the `polylane scan` command and the scan_reports HTTP client it
wrapped, along with its tests. Exclude the /scan_reports paths and the
Scan Report schema in codegen so regenerating from the still-live spec
does not reintroduce them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011xFDGM6NBu3iivNKHJm9kD

@coreplane-switchboard coreplane-switchboard Bot 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.

LGTM: Clean, complete removal of the scan command, its hand-written client, tests, and registry/no-auth entries, with a codegen exclusion to keep regeneration from reintroducing the routes; no dangling references remain.

  • [nit] F1 codegen/parse-spec.ts:23 — 'Scan Report' schema name (with a space) is unverifiable from the repo — a mismatch would make the exclusion a silent no-op

Verdict: approve — a clean, complete feature removal (8 files, +4/−990) at head b14e24b, with no dangling references.

What I checked

  • Completeness of the removal. src/commands/scan.ts (501 lines), the hand-written src/client/scan-reports.ts (98 lines), and test/scan.test.ts (383 lines) are deleted whole; the registration points (src/commands/index.ts, src/registry.ts RESOURCE_ORDER, src/main.ts NO_AUTH_COMMANDS) and the resolve-test roster each drop exactly their scan entry. A repo-wide grep for scan_reports / ScanReport / scanCommand / polylane scan finds nothing left except unrelated hits: scanCommandPath in src/args.ts (arg parsing, unrelated), test/registry.test.ts which uses a synthetic makeCmd('scan') to test typo suggestions (fine — it registers its own command), and "regions to scan" prose in cloud connect.
  • Codegen guard. codegen/parse-spec.ts extends the existing automations-exclusion pattern (EXCLUDED_PATH regex + EXCLUDED_SCHEMAS) to scan_reports / Scan Report, so regenerating from the still-live spec won't reintroduce the routes — consistent with the #89 precedent, and the generated output under src carries no scan types today, matching the PR body's claim.
  • Test guard. The only tests removed are test/scan.test.ts and one roster line in test/resolve.test.ts — both test exactly the deleted feature, so the removal licenses them. No other test file is weakened.
  • No docs/reference/specs/ in this repo, so no spec-contradiction check applies.

Finding

  • F1 (nit)codegen/parse-spec.ts:23: the excluded schema name 'Scan Report' (with a space) can't be verified from the repo since the OpenAPI spec is fetched live, not vendored. If the actual schema key differs (e.g. ScanReport), the exclusion is a silent no-op and a regen could reintroduce the type (though the path regex would still drop the endpoints). Worth a one-time check against https://api.polylane.com/v1/doc — the PR body says a local regen was clean, which suggests it's right.

@github-actions github-actions Bot 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.

Auto-approved: coreplane-switchboard[bot] reviewed this PR and posted an LGTM verdict (see its review). A repo admin enabled this via the auto-approve workflow.

@claude

claude Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Re F1: verified against the live spec at https://api.polylane.com/v1/doc — the only components.schemas keys containing "Scan" are Scan Report (exactly, with the space) and the unrelated AdminRepositoryScanQueued, so the exclusion in codegen/parse-spec.ts:23 matches. npm run typecheck runs codegen against that live spec and produced no scan types.


Generated by Claude Code

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