[HDX] Fix duplicate git tag push in release workflow#2377
Conversation
The release script ran `changeset tag` (which creates git tags for all packages) followed by `changeset publish` (which also creates a git tag for each package it publishes to npm). When a publishable package such as @hyperdx/cli was published for the first time in a run, both commands created its tag, so the changesets GitHub Action queued the same tag for push twice. The second push failed with: ! [remote rejected] @hyperdx/cli@0.5.0 (cannot lock ref ...: reference already exists) error: failed to push some refs which aborted the whole release job (gating all downstream Docker/CLI builds), even though the npm publish itself had already succeeded. Run `changeset publish --no-git-tag` so publish handles npm only, leaving `changeset tag` as the single source of git tags for every package (public and private). Each tag is now created and pushed exactly once.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Deep Review✅ No critical issues found. The diff is a single-line change to the 🟡 P2 -- recommended
Reviewers (5): correctness, reliability, maintainability, project-standards, testing Testing gaps: End-to-end behavior of |
E2E Test Results✅ All tests passed • 192 passed • 3 skipped • 1309s
Tests ran across 4 shards in parallel. |
Why
The
Releaseworkflow'sCheck Changesetsjob failed on theCreate Release Pull Request or Publish to npmstep, which gates every downstream job (Docker app/local/all-in-one/otel-collector builds, CLI binary release, downstream notifications).Failed run: https://github.com/hyperdxio/hyperdx/actions/runs/26666123898/job/78599749256
The npm publish of
@hyperdx/cli@0.5.0actually succeeded, but the job still exited non-zero on the subsequent git tag push:Root cause
The
releasescript was:changeset tagcreates git tags for all packages (including the 4 private ones that are never published to npm).changeset publishthen publishes to npm and also creates a git tag for each package it publishes.When a publishable package (
@hyperdx/cli) is published for the first time in a run, both commands create its tag. The changesets GitHub Action then pushes each queued tag individually, so@hyperdx/cli@0.5.0got pushed twice. The first push succeeds; the second is rejected withreference already exists, and git exits 1 — failing the whole job.(The 4 private packages only get tagged once, by
changeset tag, so they never collide. Only the freshly-published public package double-pushes.)Fix
changeset publish --no-git-taghandles npm only and no longer creates git tags.changeset tagbecomes the single source of truth for git tags across all packages (public and private), so each tag is created and pushed exactly once. This preserves the existing behavior of tagging every package while eliminating the duplicate push.--no-git-tagis supported by the pinned@changesets/cli@2.26.2.Note on the affected release
The blocked
2.28.0/cli@0.5.0release was unblocked out-of-band by deleting the stale git tags and the leftover changeset-generated GitHub Releases and re-running the workflow; that release has since completed. This PR only prevents the failure from recurring on future first-time package publishes.Testing
make ci-lint(formatting/lint)changeset publish --no-git-tagis a valid flag in@changesets/cli@2.26.2.