Skip to content

[package-alt] Pin git deps to the peeled commit for annotated tags - #27395

Merged
mdgeorge4153 merged 1 commit into
mainfrom
mdgeorge/peel-annotated-tags
Jul 30, 2026
Merged

[package-alt] Pin git deps to the peeled commit for annotated tags#27395
mdgeorge4153 merged 1 commit into
mainfrom
mdgeorge/peel-annotated-tags

Conversation

@mdgeorge4153

@mdgeorge4153 mdgeorge4153 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

When a git dependency's rev names an annotated tag, we pinned the sha of the tag object rather than of the commit the tag points at. The tag object is not reachable through branch history, and moving the tag orphans it — after which GitHub will not serve it by sha to a fresh fetch, so a checked-in Move.lock fails to build on a clean clone or in CI. This surfaced via MVR, where the @mysten/attestations dep pinned a tag object for tag testnet/v1.

Lightweight tags point straight at the commit and were never affected, which is likely why this went unnoticed — the existing test fixtures only created lightweight tags.

Test plan

New tests cover both tag kinds resolving to the commit sha. The annotated-tag test first asserts that rev-parse <tag> differs from the commit, so it cannot pass trivially if the fixture ever stops producing a real tag object; I confirmed it fails against the old code (resolved the tag object instead of the commit).

Release notes

Check each box that your change affects. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes for a user of that component.

  • Protocol:
  • gRPC:
  • GraphQL:
  • CLI: A git dependency whose rev is an annotated tag now pins to the commit the tag points at instead of the tag object. Existing Move.lock files that pinned a tag object keep their old sha until repinned; you can use sui move update-deps to fix old lockfiles.
  • Rust SDK:

@mdgeorge4153
mdgeorge4153 temporarily deployed to sui-typescript-aws-kms-test-env July 22, 2026 17:55 — with GitHub Actions Inactive
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sui-docs Building Building Preview Jul 30, 2026 4:36pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Jul 30, 2026 4:36pm
sui-kiosk Ignored Ignored Preview Jul 30, 2026 4:36pm

Request Review

@mdgeorge4153 mdgeorge4153 changed the title [move] Pin git deps to the peeled commit for annotated tags [package-alt 3] Pin git deps to the peeled commit for annotated tags Jul 23, 2026
@mdgeorge4153 mdgeorge4153 changed the title [package-alt 3] Pin git deps to the peeled commit for annotated tags [package-alt] Pin git deps to the peeled commit for annotated tags Jul 23, 2026
@mdgeorge4153
mdgeorge4153 marked this pull request as ready for review July 23, 2026 17:00
@mdgeorge4153
mdgeorge4153 temporarily deployed to sui-typescript-aws-kms-test-env July 23, 2026 17:00 — with GitHub Actions Inactive

@stefan-mysten stefan-mysten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix.

When a git dependency's `rev` names an annotated tag, `find_branch_or_tag_sha`
pinned the sha of the tag object rather than of the commit the tag points at.
The tag object is not reachable through branch history, and moving the tag
orphans it, after which it can no longer be fetched by sha -- so a checked-in
`Move.lock` fails to build on a clean clone or in CI.

Query the peeled ref (`refs/tags/<tag>^{}`) alongside the tag ref and prefer it,
so annotated tags resolve to their commit. Lightweight tags have no peeled line
and are unaffected.
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/peel-annotated-tags branch from 7c2be9d to 59bc437 Compare July 30, 2026 16:35
@mdgeorge4153
mdgeorge4153 temporarily deployed to sui-typescript-aws-kms-test-env July 30, 2026 16:35 — with GitHub Actions Inactive
@mdgeorge4153
mdgeorge4153 enabled auto-merge (squash) July 30, 2026 16:51
@mdgeorge4153
mdgeorge4153 merged commit bfe3a98 into main Jul 30, 2026
67 of 69 checks passed
@mdgeorge4153
mdgeorge4153 deleted the mdgeorge/peel-annotated-tags branch July 30, 2026 17:06
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.

2 participants