You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR 4 of 4 for catalyst upgrade (LTRAC-956). Stacks on TRAC-926 (#3065). This is where the command becomes user-visible.
What/Why?
Wires the upgrade Command export, registers it in program.ts, and adds the end-to-end integration test suite against real tarballs.
The action flow (each step is commented inline):
resolveProject → detect layout
resolveBaseRef → determine base; parseRef is now guarded so --from 1.7.0 (bare semver, no package prefix) produces a user-friendly error instead of an unhandled throw
Clean-tree precondition — refuses uncommitted and staged changes; --dry-run exempt
Backfill catalyst.ref — staged, not committed, so it travels with the upgrade commit
Download base + target in parallel
Similarity check — warns at < 50% match when base was inferred
Dry-run: git diff --no-index --binary --diff-algorithm=histogram between base and theirs
3-way merge via selected engine
Stamp catalyst.ref — clean JSON parse when no markers; surgical regex replace using a function replacer (not a string) to prevent $-interpolation when ref/version contains $& etc.; package.json stays UU when it still has unresolved conflicts in other sections
applyIndexState wrapped in try/catch — merge is already on disk, staging is a convenience
upgrade.integration.spec.ts (new): real 1.6.3 → 1.7.0 and makeswift 1.2.0 → 1.3.0 tarballs, cached at ~/.cache/catalyst-cli/cores after first run (offline on repeat). Both engines × 8 scenarios: clean upgrade, deleted-file conflict, merchant dep preserved, idempotency, flat layout, overlapping edit, makeswift family, similarity scoring.
Also included: test-upgrade.sh — interactive 14-case manual test runner used during the spike. Observe-only (not auto-asserting), useful for exploratory regression testing before release.
The integration tests require real GitHub tarballs on first run. Set GITHUB_TOKEN to avoid the 60 req/hr unauthenticated limit. Subsequent runs are fully offline via the tarball cache.
Rollout/Rollback
Minor version bump via changeset. No data migration. Rolling back is a revert of this PR (and the stack).
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: TRAC-927
PR 4 of 4 for
catalyst upgrade(LTRAC-956). Stacks on TRAC-926 (#3065). This is where the command becomes user-visible.What/Why?
Wires the
upgradeCommand export, registers it inprogram.ts, and adds the end-to-end integration test suite against real tarballs.The action flow (each step is commented inline):
resolveProject→ detect layoutresolveBaseRef→ determine base;parseRefis now guarded so--from 1.7.0(bare semver, no package prefix) produces a user-friendly error instead of an unhandled throw--dry-runexemptcatalyst.ref— staged, not committed, so it travels with the upgrade commitgit diff --no-index --binary --diff-algorithm=histogrambetween base and theirscatalyst.ref— clean JSON parse when no markers; surgical regex replace using a function replacer (not a string) to prevent$-interpolation whenref/versioncontains$&etc.;package.jsonstaysUUwhen it still has unresolved conflicts in other sectionsapplyIndexStatewrapped in try/catch — merge is already on disk, staging is a conveniencestrategy,gitVersion,dryRun,applied,added,deleted,conflicts,hasConflictsTesting
pnpm test upgradeupgrade.integration.spec.ts(new): real 1.6.3 → 1.7.0 and makeswift 1.2.0 → 1.3.0 tarballs, cached at~/.cache/catalyst-cli/coresafter first run (offline on repeat). Both engines × 8 scenarios: clean upgrade, deleted-file conflict, merchant dep preserved, idempotency, flat layout, overlapping edit, makeswift family, similarity scoring.Also included:
test-upgrade.sh— interactive 14-case manual test runner used during the spike. Observe-only (not auto-asserting), useful for exploratory regression testing before release.The integration tests require real GitHub tarballs on first run. Set
GITHUB_TOKENto avoid the 60 req/hr unauthenticated limit. Subsequent runs are fully offline via the tarball cache.Rollout/Rollback
Minor version bump via changeset. No data migration. Rolling back is a revert of this PR (and the stack).