Skip to content

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

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

shiju-nv wants to merge 1 commit 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

@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
@shiju-nv shiju-nv added the test:e2e Requires end-to-end coverage label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Label test:e2e applied for 5666be9. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@shiju-nv
shiju-nv force-pushed the fix/git-watch-invalidation branch from 5666be9 to 1bc6da6 Compare November 2, 2026 14:46
Follow up on NVIDIA#4947 with Git version tracking for packed-ref transitions, linked worktrees using reftable, and source archives nested inside another repository. NVIDIA#4947 already fixed the ordinary unchanged-worktree rebuild; this PR preserves that fix and covers the remaining metadata boundaries.

Signed-off-by: Shiju <shiju@nvidia.com>
@shiju-nv
shiju-nv force-pushed the fix/git-watch-invalidation branch from 1bc6da6 to 24b4638 Compare November 3, 2026 11:46
@shiju-nv shiju-nv added the area:build Related to CI/CD and builds label Nov 4, 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

area:build Related to CI/CD and builds test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep build versions accurate after Git changes and in source archives

1 participant