Skip to content

fix(core): complete Git version tracking for ref and archive edge cases - #3844

Open
shiju-nv wants to merge 4 commits into
NVIDIA:mainfrom
shiju-nv:fix/git-watch-invalidation
Open

shiju-nv wants to merge 4 commits into
NVIDIA:mainfrom
shiju-nv:fix/git-watch-invalidation

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow up on #4947 with Git version tracking for packed-ref transitions, linked worktrees using reftable, and source archives nested inside another repository. #4947 already fixed the ordinary unchanged-worktree rebuild; this PR preserves that fix and covers the remaining metadata boundaries.

Related Issue

Closes #4186

Changes

  • Resolve version inputs from the checkout root and watch existing local branch/tag directories, packed refs, private/common reftable storage, and existing shallow metadata.
  • Keep an archive without its own .git on the package version, even when its parent directory belongs to a tagged repository.
  • Add real Cargo probe regressions for ordinary freshness, packed refs and shared tags, reftable, detached HEAD/branch switches, and standalone/nested archives. The probes share the production helper and assert both build-script run counts and embedded version values.
  • Preserve the existing release-version rules and protobuf generation. Avoid watching loose remote-ref and stash directories; local branch/tag or shared metadata changes can still conservatively rebuild the version.
  • Document which Git inputs invalidate a local build.

Release Notes

Git-derived version metadata stays current across additional ref-storage and archive layouts.

Testing

  • Existing six-test git_build_invalidation receipt retained for the unchanged production helper.
  • Both affected packed-ref/reftable cases pass after disabling reflogs and asserting absent first-build paths. The exact sources ran in an isolated Cargo harness with the workspace lint settings.
  • Current-main negative control: the packed-branch case fails with a stale 0.1.0 after the branch advances.
  • Scoped fixture Clippy passes with warnings denied; Rust formatting and whitespace checks pass.
  • Nested-archive negative control without the ownership guard failed with the enclosing repository's 0.1.0 instead of the package's 9.8.7.
  • Unit/integration regressions added for the changed helper.
  • E2E tests added/updated (not applicable to this build-script change).

The unchanged production-helper checks are reused; only the two cases affected by the stronger fixture setup were rerun. The current-main negative control uses the production main Git-watch functions unchanged, with a test-harness adapter for their signatures. This update makes no new performance claim; the original 8.920s/1.384s comparison predates #4947 and does not measure this follow-up.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Contributor build-cache documentation updated

Resolve metadata paths through Git and watch ref directories so unchanged
builds remain fresh while packed-to-loose branch updates refresh the
embedded version. Track both private and shared reftable stores.

Add Cargo invalidation regressions for ordinary clones, linked worktrees,
branch and tag changes, detached HEAD, and source archives. Preserve the
existing version calculation and protobuf generation.

Signed-off-by: Shiju <shiju@nvidia.com>
Keep the Git helper next to build_version.rs as build_git.rs instead of a
path-mapped build_support module. Watch refs/heads and refs/tags rather
than all of refs/, so fetch, push and stash no longer rerun the core build
script, and cover that in the invalidation test. Shorten the contributor
note to the behavior a contributor sees.

Signed-off-by: Shiju <shiju@nvidia.com>
@github-actions

Copy link
Copy Markdown

This pull request has had no activity for 14 days and is now marked stale.

@github-actions github-actions Bot added the state:stale Inactive item at risk of automatic closure. label Oct 28, 2026
@shiju-nv shiju-nv changed the title fix(build): track Git metadata in linked worktrees fix(core): complete Git version tracking for ref and archive edge cases Oct 31, 2026
@github-actions github-actions Bot removed the state:stale Inactive item at risk of automatic closure. label Nov 1, 2026

This branch has not been deployed

No deployments
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.

Complete Git version invalidation for packed refs, reftable, and nested archives

1 participant