Skip to content

feat: TRAC-927 upgrade: CLI command action, integration tests, and changeset - #3066

Closed
chanceaclark wants to merge 0 commit into
chancellorclark/ltrac-959-upgrade-project-resolution-downloadfrom
chancellorclark/ltrac-960-upgrade-command-action
Closed

feat: TRAC-927 upgrade: CLI command action, integration tests, and changeset#3066
chanceaclark wants to merge 0 commit into
chancellorclark/ltrac-959-upgrade-project-resolution-downloadfrom
chancellorclark/ltrac-960-upgrade-command-action

Conversation

@chanceaclark

@chanceaclark chanceaclark commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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 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):

  1. resolveProject → detect layout
  2. 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
  3. Clean-tree precondition — refuses uncommitted and staged changes; --dry-run exempt
  4. Backfill catalyst.ref — staged, not committed, so it travels with the upgrade commit
  5. Download base + target in parallel
  6. Similarity check — warns at < 50% match when base was inferred
  7. Dry-run: git diff --no-index --binary --diff-algorithm=histogram between base and theirs
  8. 3-way merge via selected engine
  9. 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
  10. applyIndexState wrapped in try/catch — merge is already on disk, staging is a convenience
  11. Telemetry: strategy, gitVersion, dryRun, applied, added, deleted, conflicts, hasConflicts

Testing

pnpm test upgrade

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).

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 553fbbf

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

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Jun 25, 2026 9:09pm

Request Review

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 92 94

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 79 77 82
Accessibility 95 98 95 92
Best Practices 100 100 100 100
SEO 88 88 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.6 s 3.9 s 3.7 s 5.0 s
CLS 0.001 0.183 0.001 0
FCP 1.2 s 1.2 s 1.2 s 1.1 s
TBT 0 ms 0 ms 0 ms 0 ms
Max Potential FID 40 ms 50 ms 40 ms 60 ms
Time to Interactive 3.6 s 4.0 s 3.7 s 5.0 s

Full Unlighthouse report →

@chanceaclark
chanceaclark force-pushed the chancellorclark/ltrac-959-upgrade-project-resolution-download branch 2 times, most recently from 666048e to 0b71de1 Compare June 25, 2026 21:04
@chanceaclark
chanceaclark force-pushed the chancellorclark/ltrac-960-upgrade-command-action branch from 4739a37 to cad2fc1 Compare June 25, 2026 21:05
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from 98d5b87 (2026-06-25).

No bundle size changes detected.

@chanceaclark
chanceaclark force-pushed the chancellorclark/ltrac-959-upgrade-project-resolution-download branch from 0b71de1 to 553fbbf Compare June 25, 2026 21:10
@chanceaclark
chanceaclark force-pushed the chancellorclark/ltrac-960-upgrade-command-action branch from b9c439b to 553fbbf Compare June 25, 2026 21:10
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