chore: remove scan command - #91
Conversation
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
There was a problem hiding this comment.
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-writtensrc/client/scan-reports.ts(98 lines), andtest/scan.test.ts(383 lines) are deleted whole; the registration points (src/commands/index.ts,src/registry.tsRESOURCE_ORDER,src/main.tsNO_AUTH_COMMANDS) and the resolve-test roster each drop exactly theirscanentry. A repo-wide grep forscan_reports/ScanReport/scanCommand/polylane scanfinds nothing left except unrelated hits:scanCommandPathinsrc/args.ts(arg parsing, unrelated),test/registry.test.tswhich uses a syntheticmakeCmd('scan')to test typo suggestions (fine — it registers its own command), and "regions to scan" prose in cloud connect. - Codegen guard.
codegen/parse-spec.tsextends the existing automations-exclusion pattern (EXCLUDED_PATHregex +EXCLUDED_SCHEMAS) toscan_reports/Scan Report, so regenerating from the still-live spec won't reintroduce the routes — consistent with the #89 precedent, and the generated output undersrccarries no scan types today, matching the PR body's claim. - Test guard. The only tests removed are
test/scan.test.tsand one roster line intest/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 againsthttps://api.polylane.com/v1/doc— the PR body says a local regen was clean, which suggests it's right.
|
Re F1: verified against the live spec at Generated by Claude Code |
Requested by boris · Slack thread
Before:
polylane scangenerated scan reports against every connected cloud account and integration, polled thescan_reports.*routes until they finished, ranked the risks, and offered to start per-risk investigations. It shipped with a hand-writtensrc/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 thescanentries insrc/commands/index.ts,src/registry.ts,src/main.ts(no-auth allowlist), andtest/resolve.test.ts.codegen/parse-spec.tsnow excludes/scan_reportspaths and theScan Reportschema, 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_reportsAPI routes.🤖 Generated with Claude Code
https://claude.ai/code/session_011xFDGM6NBu3iivNKHJm9kD
Generated by Claude Code