Skip to content

fix(release): support renamed package Changesets - #706

Merged
artiphishle merged 3 commits into
mainfrom
fix/705-changeset-package-rename
Oct 24, 2026
Merged

artiphishle merged 3 commits into
mainfrom
fix/705-changeset-package-rename

Conversation

@artiphishle

Copy link
Copy Markdown
Collaborator

Summary

Allow the managed Changesets status runner to omit --since only when the root package name differs from the exact base revision. Ordinary package identities retain the strict base comparison.

Closes #705
Part of ankhorage/infra#477.

Validation

  • bun run build
  • bun run check-types
  • bun run lint
  • bun run knip:check
  • bun test (194 passing)
  • bun run changeset:status
  • bun run format
  • bun run format:check
  • exercised status --since=origin/main from the renamed k3s package checkout

Release impact

Patch Changeset included. No generated release documentation changed.

@artiphishle artiphishle left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review findings on dcc09562082abc2ebd211647a9a423db61842d1c (part of infra#477):

P1 — Do not merge before correcting base-identity comparison. In src/cli/runChangesetAsync.ts, readPackageNamesAsync parses the current package.json name but compares it with the raw JSON string returned by readGitFileAsync. Consequently, current !== base evaluates true for virtually every valid base manifest, and --since gets stripped even when no rename happened. Parse the base manifest with readPackageName(await readGitFileAsync(baseReference)); add focused tests for unchanged names, actual renames, missing/malformed/unrelated changesets, and unavailable refs. Preserve fail-closed semantics; do not silently weaken normal Changesets validation.

CI blocker — separate diagnosis required. The exact-head Actions run 40113878571 fails at Check changesets with Failed to find where HEAD diverged from "main". Investigate how the PR checkout/base ref is presented to Changesets and fix the managed CI/check boundary without bypassing comparisons; reproduce in a PR-shaped checkout.

Re-evaluate the dependency claim. K3s PR #10 exact-head run 40114059347 is now green, and its changeset:status --since=origin/main recognized @ankhorage/infra-k3s. Determine whether #706 is still needed for this rename before releasing it.

All follow-up work stays under the full eight-adapter infra#477 initiative.

@artiphishle

Copy link
Copy Markdown
Collaborator Author

P1 follow-up is pushed in b34c88c.

  • Base and current package identities are both parsed from their manifests before comparison; unchanged identities retain --since.
  • The runner fails closed by preserving strict comparison for malformed manifests or unreadable Git refs. Regression coverage includes genuine renames, unchanged identities, missing/unrelated release-intent inputs, malformed data, and unavailable refs.
  • The exact CI failure came from the detached Actions PR checkout: Changesets resolves its configured main divergence branch even when invoked with --since=origin/main, but checkout only supplied origin/main. The managed CI template now creates local main at the immutable PR base SHA before status validation. A detached PR-shaped reproduction passes with that topology.
  • infra-k3s#10 was independently rechecked at a6303de: its remote validate run 40114059347 is green. fix(release): support renamed package Changesets #706 is a genuine managed-CI correctness fix, but it is not a remaining K3s release dependency.

Full local validation passed: build, check-types, lint, knip:check, 198 tests, changeset status, format, and format:check.

@artiphishle artiphishle left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of current head b34c88c (infra#477):

The previous P1 is fixed: both manifests now go through readPackageName, normal identities retain --since, and the generated CI materializes main at the exact PR base SHA. Exact-head CI run 40120089042 is green.

P2 test gap: The cases called “missing or unrelated release intent” in src/cli/runChangesetAsync.test.ts only assert the forwarded argument array, with runExternalToolAsync hardcoded to return exitCode: 0. They do not prove an actual renamed-root checkout rejects a missing, malformed, or unrelated Changeset. Because genuine renames intentionally remove --since, add a small deterministic integration/regression check through the actual Changesets status boundary for (a) valid current-name patch Changeset succeeds, (b) no release-intent Changeset fails, and (c) unrelated/obsolete package-name Changeset fails. If those cases are already guaranteed elsewhere, reference the specific executable evidence and clarify the test titles. Do not reintroduce the obsolete identity, bypass the managed gate, or expand into unrelated cleanup.

This is a correctness/evidence request before treating Devtools #706 as the canonical rename gate fix; complete the full eight-adapter infra#477 sequence after required approvals and verified releases.

@artiphishle

Copy link
Copy Markdown
Collaborator Author

P2 follow-up pushed at 53426c7 (fix(release): require renamed package release intent).

The renamed-root runner now writes and verifies the actual Changesets release plan after intentionally removing --since: it fails when no release is planned for the exact current identity. The executable regression creates a real Git checkout with @ankhorage/k3s at the base and @ankhorage/infra-k3s at HEAD, then verifies current-name patch intent succeeds while missing, obsolete-name, and malformed intent fail through the real Changesets CLI. Separate focused assertions retain --since for unchanged, malformed, or unreadable identities.

Local checks passed: bun run build, bun run check-types, bun run lint (existing warnings only), bun run knip:check (existing configuration hint), bun run changeset:status, bun test (195 pass), bun run format, and bun run format:check. Remote CI is running for this head; independent approval remains required.

@artiphishle
artiphishle merged commit ce465cd into main Oct 24, 2026
2 checks passed
@artiphishle
artiphishle deleted the fix/705-changeset-package-rename branch October 24, 2026 22:05
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.

fix(release): support Changesets package identity renames

1 participant