Skip to content

feat(v1.55.0): add move-connections-config-imports codemod - #169

Merged
schultzp2020 merged 15 commits into
mainfrom
feat/v1.55.0/move-connections-config-imports
Oct 13, 2026
Merged

schultzp2020 merged 15 commits into
mainfrom
feat/v1.55.0/move-connections-config-imports

Conversation

@schultzp2020

@schultzp2020 schultzp2020 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

@backstage/connections -> @backstage/connections/config

+ migrate selected named imports/re-exports, type-only dynamic members, directly awaited moved-export access, and provable namespace members
+ preserve import attributes (`with`/`assert`) and binding-specific comments/directives while splitting
+ leave imports/re-exports with adjacent @ts-expect-error/@ts-ignore unchanged, with a manual-review TODO before the directive (mixed AND sole moved declarations, including ambient modules)
+ recognize quoted named exports and chained namespace members; place ambiguous dynamic-import TODO after a hashbang
+ ignore directly provable unrelated dynamic destructuring/member access

  retain TODO for mixed or ambiguous runtime imports and namespace usage

Closes #149

Evidence

  • Full yarn test reproducibly generated a 145-byte untracked codemods/v1.55.0/remove-relations-compatibility-config/tests/flow-inline-comment-preserved-when-catalog-emptied/metrics.json (blob 42847c1041d21d4278619381aa2d51455bc1b654) from previously merged feat(v1.55.0): add remove-relations-compatibility-config codemod #162. Verified this was the only untracked state, backed it up outside the worktree, removed only that generated artifact; worktree clean before push and after pre-push hooks.

  • Prior independent review found file-wide namespace TODO suppression across two ambient modules sharing alias C. e3adcb5 scopes detection to the adjacent comment for each declaration and inserts after the import line, retaining indentation and trailing comments. The two-module fixture failed before the fix and passes now; a second fixture confirms byte-idempotence. Dynamic-import TODO remains intentionally file-level (one generic annotation per file); directive TODO detection was already declaration-local.

  • 38/38 package fixtures and workflow validation pass. Disposable shipped-workflow dry-run/apply/repeat on .ts and .d.ts produced expected namespace and sole-moved diagnostic-directive TODOs, retained trailing comments, compiled with TypeScript 7 strict --noEmit --skipLibCheck false, and repeated byte-identically. A bounded synthetic 500-file shipped-workflow run completed in 4s with 500 TODOs; repeat completed in 2s without byte changes. Not a real-project performance guarantee.

  • Root yarn format, yarn format:check, yarn lint, yarn test, and yarn check:changed passed. Installed Husky pre-commit (lint-staged and package test) and pre-push (check:changed) passed; ordinary fast-forward push from verified 52930f3115f617c0232ab13b095a6879e644bd6b. Existing minor changeset remains; no version edits or root README PR diff.

  • Exact-head CI e3adcb5: Test and Changeset Check passed. Fresh independent review completed (no blockers at exact head); ready for review.

Merge Danger

Door: two-way

Scoped codemod logic and fixtures; revert the PR merge if post-merge behavior regresses.

Blast Radius: low

Only @backstage/move-connections-config-imports transform behavior. Declarations with adjacent diagnostic directives remain unchanged with a manual-review TODO; other dynamic/namespace uses without provable single-subpath provenance still receive a TODO. No version fields changed; initial minor changeset already present. Do not merge before human review.

@schultzp2020
schultzp2020 marked this pull request as draft October 12, 2026 21:05
@schultzp2020

Copy link
Copy Markdown
Contributor Author

Review-blocked: dynamic import detection currently regex-scans source text, so a comment/string containing import("@backstage/connections") can gain a false TODO despite no dynamic import AST node. Add negative fixture and AST-backed dynamic import selection before review-ready. Inline specifier comment association also needs review.

@schultzp2020

Copy link
Copy Markdown
Contributor Author

Fresh review blocker at abdc55b: dynamic-import has: import descendant selector can annotate outer non-import calls with unrelated package string (e.g. wrap(import("x"), "@backstage/connections")). Sole writer adding negative fixture and direct import-callee AST guard; keep draft pending exact-head CI/review.

@schultzp2020

Copy link
Copy Markdown
Contributor Author

Real-source QA blocker at 0ffc308: dry-run on clean Backstage snapshot inserted TODO for unrelated type-only import("@backstage/connections").ConnectionsService in packages/backend-plugin-api/src/alpha/refs.ts:26; ConnectionsService is not among the three moved exports. /config dynamic import negative probe was no-op, root runtime dynamic positive TODO stayed. Sole writer adding AST type-member provenance guard + red fixture, rerunning gates/exact-head CI and fresh review. Keep draft.

@schultzp2020
schultzp2020 marked this pull request as ready for review October 13, 2026 15:55
@schultzp2020
schultzp2020 merged commit 594ea8f into main Oct 13, 2026
2 checks passed
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.

feat: Backstage 1.55.0 migration - Move Connections configuration imports to config subpath

1 participant