Skip to content

Preflight GitVersion repository history before build - #896

Merged
shanselman merged 2 commits into
mainfrom
copilot/fix-gitversion-issue
Jun 30, 2026
Merged

Preflight GitVersion repository history before build#896
shanselman merged 2 commits into
mainfrom
copilot/fix-gitversion-issue

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: GitVersion failures surfaced late as MSBuild compile errors during Shared build.
  • Why it matters: users got a low-signal package/tool error instead of the repository prerequisite they need to fix.
  • What changed: build.ps1 now preflights Git metadata and shallow-clone state before building, with an explicit recovery command.
  • User impact: shallow checkouts now fail early with git fetch --unshallow --tags origin.
  • What did NOT change (scope boundary): no GitVersion package/tool version changes; no product build/version semantics changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs / instructions
  • Tests / validation
  • Security hardening
  • Chore / infra

Scope (select all touched areas)

  • Tray / WinUI UX
  • Windows node capability
  • Local MCP / winnode
  • Gateway / connection / pairing
  • Setup / onboarding
  • Permissions / privacy / security
  • Tests / CI / docs

Linked Issue/PR

Validation

  • .\build.ps1 — passed on Windows.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore — 2659 passed, 31 skipped.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore — 1445 passed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --filter VersioningContractTests — previously passed: 4 passed, 0 failed, 0 skipped.
  • Fresh-worktree note: tests were restored once in the isolated validation worktree before rerunning the required --no-restore commands.

Real behavior proof

  • Environment tested: Windows, .NET SDK 10.0.301, Node.js v24.14.0, npm 11.17.0, Windows SDK 10.0.26100.0.
  • PR head / commit tested: b1d2b6a.
  • build.ps1 now runs successfully on a full-history git worktree and completes before any late GitVersion/MSBuild failure.
  • Contract test verifies build.ps1 contains GitVersion preflight checks for git metadata, shallow repositories, and git fetch --unshallow --tags origin.
  • Not verified / blocked: an actual shallow clone failure path was not destructively reproduced in this checkout; the behavior is covered by source-contract assertions and successful full-history build validation.

Security Impact (required)

  • New permissions/capabilities? (Yes/No): No
  • Secrets/tokens handling changed? (Yes/No): No
  • New/changed network calls? (Yes/No): No
  • Command/tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any Yes, explain risk + mitigation: N/A

Compatibility / Migration

  • Backward compatible? (Yes/No): Yes
  • Config/env changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, exact upgrade steps: N/A

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only conversations that still need reviewer or maintainer judgment.

@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 1:33 PM ET / 17:33 UTC.

Summary
The PR adds a build.ps1 GitVersion metadata/full-history preflight and a tray contract test asserting the new diagnostic and unshallow guidance.

Reproducibility: no. high-confidence runtime reproduction was run in this read-only review. The linked report and current source make the late GitVersion/MSBuild failure source-reproducible, but the new shallow/missing-git preflight path still needs current-head terminal or log proof.

Review metrics: 1 noteworthy metric.

  • Changed surface: 2 files changed, +31/-0. The diff is small and focused, so merge confidence depends mostly on proving the new runtime preflight behavior rather than broad code risk.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #895
Summary: The linked open issue is the canonical build-failure report, and this PR is the candidate fix for that report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal output or logs from the current PR head showing build.ps1 failing before MSBuild for a missing .git or shallow clone and succeeding on a full-history clone.
  • Redact private IP addresses, API keys, phone numbers, non-public endpoints, and other sensitive details from any posted proof.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body reports validation and full-history success, but it does not show redacted current-head terminal or log output for the new missing-.git or shallow-clone failure path; after updating the PR body with proof, ClawSweeper should re-review automatically or a maintainer can comment @clawsweeper re-review.

Risk before merge

  • [P1] The PR body does not include redacted terminal or log output from current head proving the new missing-.git or shallow-clone path fails before MSBuild.
  • [P1] The added regression coverage is source-text only, so it would not catch a PowerShell execution regression in the preflight logic.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused preflight after the PR body includes current-head Windows output for a full-history success plus a missing-.git or shallow-clone early-failure path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Human or contributor follow-up is needed because the remaining blocker is current-head real behavior proof, not a narrow code repair ClawSweeper can safely apply.

Security
Cleared: No concrete security or supply-chain concern was found; the patch adds local Git metadata checks and diagnostic text without new dependencies, secrets handling, or downloaded execution.

Review details

Best possible solution:

Land the focused preflight after the PR body includes current-head Windows output for a full-history success plus a missing-.git or shallow-clone early-failure path.

Do we have a high-confidence way to reproduce the issue?

No high-confidence runtime reproduction was run in this read-only review. The linked report and current source make the late GitVersion/MSBuild failure source-reproducible, but the new shallow/missing-git preflight path still needs current-head terminal or log proof.

Is this the best way to solve the issue?

Yes, conditionally: build.ps1 already owns Windows prerequisites, so adding a GitVersion repository-history check there is the narrow maintainable path. The proof gap should be closed before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a13d683de90f.

Label changes

Label justifications:

  • P2: The PR targets a reported developer build failure with a focused build-script improvement and limited product blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body reports validation and full-history success, but it does not show redacted current-head terminal or log output for the new missing-.git or shallow-clone failure path; after updating the PR body with proof, ClawSweeper should re-review automatically or a maintainer can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its required validation and PR proof policy is relevant because this PR changes the build script and validation tests. (AGENTS.md:1, a13d683de90f)
  • Current main lacks the requested preflight: Current main only checks Git presence and safe.directory trust before calling the build; an rg search found no history/shallow-clone preflight strings in build.ps1 or the versioning contract test. (build.ps1:187, a13d683de90f)
  • PR implementation: The PR head adds Ensure-GitVersionRepositoryHistory, checking git rev-parse --is-inside-work-tree and git rev-parse --is-shallow-repository, then records prerequisite issues before the build phase. (build.ps1:141, b1d2b6a79f09)
  • PR test coverage: The added test asserts source text for the new diagnostics and unshallow command, but it does not execute the PowerShell preflight path. (tests/OpenClaw.Tray.Tests/VersioningContractTests.cs:58, b1d2b6a79f09)
  • Linked canonical report: The linked open report shows build.ps1 reaching the Shared build and failing later in GitVersion.MsBuild; GitHub lists this PR as the closing candidate for that report.
  • Proof gap remains: The PR body reports Windows validation and full-history build success, but explicitly says an actual shallow-clone failure path was not reproduced. (b1d2b6a79f09)

Likely related people:

  • shanselman: GitHub history shows this account introduced GitVersion-derived app metadata, preserved alpha tag behavior, and later hardened the local build.ps1 Git/GitVersion prerequisite path. (role: introduced versioning/build behavior; confidence: high; commits: f8e6ac4d0995, 32e6025d00c6, 782153f0313a; files: build.ps1, tests/OpenClaw.Tray.Tests/VersioningContractTests.cs, docs/VERSIONING.md)
  • TheAngryPit: GitHub history shows recent work in the same Windows build-detection/prerequisite area of build.ps1. (role: recent build script contributor; confidence: medium; commits: 7a7f39df2397; files: build.ps1)
  • ranjeshj: GitHub history shows recent refactoring of VersioningContractTests.cs and adjacent brittle-test coverage. (role: recent test area contributor; confidence: medium; commits: d4284d43fb6a; files: tests/OpenClaw.Tray.Tests/VersioningContractTests.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 30, 2026
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitVersion compilation error for project Preflight GitVersion repository history before build Jun 30, 2026
Copilot AI requested a review from shanselman June 30, 2026 15:20
@clawsweeper clawsweeper Bot added the P2 Normal priority bug or improvement with limited blast radius. label Jun 30, 2026
@shanselman
shanselman marked this pull request as ready for review June 30, 2026 17:27
@shanselman
shanselman merged commit 1823f19 into main Jun 30, 2026
4 checks passed
@shanselman
shanselman deleted the copilot/fix-gitversion-issue branch June 30, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An error occurred during the compilation of the project,

2 participants