Skip to content

Preserve latest tag when publishing historical typings - #1335

Open
Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-broken-issue-75555
Open

Preserve latest tag when publishing historical typings#1335
Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-broken-issue-75555

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown

Publishing changes shared by multiple versions could leave npm’s latest tag pointing to the last historical version published.

  • Make publication intent explicit

    • Require every NpmPublishClient.publish call to specify a tag.
    • Publish current typings as latest, historical typings as old-version, and the registry as next.
  • Protect latest

    • Remove the temporary historical tag after publication.
    • Treat cleanup failure as non-fatal while retaining the defensive latest correction.
await client.publish(packageDir, packageJson, pkg.isLatest ? "latest" : "old-version", dry, log);
  • Regression coverage
    • Verify current and historical versions use their intended tags.
    • Verify temporary-tag cleanup ordering and failure handling.

Copilot AI and others added 3 commits September 11, 2026 18:09
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
@jakebailey

Copy link
Copy Markdown
Member

Copilot what happens to preexisting broken packages? See the node package on the registry

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Author

Copilot what happens to preexisting broken packages? See the node package on the registry

They are not repaired by the normal publisher unless another historical version is published. The existing weekly update-ts-version-tags workflow resets latest for every package, so it will repair @types/node after this merges; it can also be manually dispatched against main to fix Node immediately rather than waiting until Sunday.

@jakebailey

Copy link
Copy Markdown
Member

Copilot changesets should not mention private packages, and ci is failing formatting

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The explicit tag handling and cleanup behavior are consistent, complete, and adequately covered by regression tests.

Pull request overview

Ensures historical typings no longer overwrite npm’s latest tag.

Changes:

  • Requires explicit publication tags.
  • Uses latest, old-version, and next appropriately.
  • Removes temporary historical tags with non-fatal cleanup handling and regression tests.
File summaries
File Description
packages/utils/src/npm.ts Adds explicit publish tags and tag removal support.
packages/publisher/src/lib/package-publisher.ts Tags current and historical typings appropriately.
packages/publisher/src/publish-registry.ts Explicitly publishes the registry under next.
packages/publisher/test/package-publisher.test.ts Tests tagging, cleanup ordering, and cleanup failures.
.changeset/tidy-tags-rest.md Records patch releases.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Author

Copilot changesets should not mention private packages, and ci is failing formatting

Fixed in 8acba42: the changeset now includes only public @definitelytyped/utils, and the publisher test passes the repository Prettier check.

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.

3 participants