chore(versioning): collapse 8 stamping sites down to one CI step#115
Conversation
The repo's documented schema -- `YYYY.MM.DD.N` where `N` is the Nth release of the day -- never matched reality. Every PR carried a chore tax: bump the date in `VERSION`, stamp it into the two shell scripts (4 lines), the BuildInfo const, and the example versions in copilot-instructions.md. Eight files, every PR, just to make the version match today. This rip-and-replace: - Deletes `VERSION` and `scripts/bump-version.sh`. Neither is needed. - Source files (copilot_here.sh, .ps1, BuildInfo.cs) now carry the literal `0.0.0-dev` sentinel forever. `BuildInfo.BuildDate` derives its value from the assembly's InformationalVersion at runtime and strips the git-sha suffix, so the const is no longer a stamp target. - `Directory.Build.props` falls back to `today.0` instead of reading from `VERSION`. Local `dotnet run -- --version` still prints a YYYY.MM.DD.N string the format tests accept. - The `compute-version` CI job replaces `github.run_number` (currently 591, meaningless) with `gh release list` count of `cli-v$DATE.* + 1` on main pushes, matching the documented schema. PR/schedule/branch dispatch builds stamp `today.0`. - `scripts/stamp-version.sh` slimmed to just the two shell scripts, switched to `~` as the sed delimiter so the alternation regex doesn't get eaten by BSD sed on macOS. - `release-cli` stamps before copying the scripts into `release/` (the old order stamped source after the cp, so the released scripts were unstamped). - `test-shell-functions` now stamps the scripts before sourcing, so the auto-update check inside copilot_here.sh doesn't see a remote-newer release and prompt during the --version test. - `docs/versioning.md` and the `.github/copilot-instructions.md` "Script Versioning" block rewritten around "merge a PR, CI handles it". After this lands, the next merged PR becomes `cli-v2026.05.21.1`, not `.591`, and no version literal in source ever changes again. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
There was a problem hiding this comment.
Code Review
This pull request automates the versioning process by shifting from manual updates to a CI-driven workflow. It removes the central VERSION file, introduces 0.0.0-dev placeholders in shell scripts, and updates the .NET build logic to dynamically resolve versions from assembly attributes. Feedback was provided regarding the version parsing logic in BuildInfo.cs, specifically to ensure that the -dev suffix is correctly preserved for development builds instead of being stripped by the current string manipulation loop.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 248ae338bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR restructures CopilotHere’s versioning so source files keep a permanent 0.0.0-dev placeholder and CI becomes the single authority that computes/stamps a real YYYY.MM.DD.N version into release artifacts and test runs.
Changes:
- Removes the repo-root
VERSIONfile and thescripts/bump-version.shhelper; local builds now default the binary version toUTC-today.0via MSBuild. - Updates CI to compute
YYYY.MM.DD.Nas “Nth release of the UTC day” (viagh release list) and stamps shell wrappers before shell tests and release packaging. - Reworks
BuildInfo.BuildDateto read fromAssemblyInformationalVersionat runtime instead of being stamped into source.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION | Removes the old single-source version file. |
| scripts/stamp-version.sh | Now only stamps shell wrappers (supports dev sentinel + real versions) and avoids delimiter conflicts in sed. |
| scripts/bump-version.sh | Deleted (no more manual bump workflow). |
| docs/versioning.md | Updates docs to reflect CI-computed daily-iteration versioning and CI-only stamping. |
| Directory.Build.props | Sets a local-build fallback version of UTC-today.0 when -p:CopilotHereVersion isn’t provided. |
| copilot_here.sh | Replaces embedded version with 0.0.0-dev placeholder in source. |
| copilot_here.ps1 | Replaces embedded version with 0.0.0-dev placeholder in source. |
| app/Infrastructure/BuildInfo.cs | Computes build date/version from assembly metadata instead of a stamped constant. |
| .github/workflows/publish.yml | Adds compute-version job (daily iteration) and stamps scripts before shell tests and release asset prep. |
| .github/copilot-instructions.md | Updates contributor guidance to “CI sets versions; don’t edit by hand”. |
…lease, anchor dev stamps to latest released N Addresses 4 review threads on PR #115: - BuildInfo.cs (gemini + copilot): the strip loop was cutting at '-' so an InformationalVersion of `0.0.0-dev` collapsed to `0.0.0`, losing the sentinel that signals an unstamped build. Added an explicit StartsWith check for the sentinel and removed `-` from the strip set — pre-release SemVer tags now survive the strip pass intact. Production InformationalVersion uses `.sha` (no pre-release marker), so the 5-segment cutoff and `+` metadata strip still handle the real release case. - publish.yml compute-version gate (codex P1): a `workflow_dispatch` run triggered on `main` would publish (the gate downstream is just `event_name != schedule && ref == main`) but would stamp `${DATE}.0`, silently shipping a release version older than any `.N` already cut that day. Widened the `IS_RELEASE` gate to accept both `push` and `workflow_dispatch` when the ref is `main`. Manual re-runs of a release now correctly take the next iteration number. - publish.yml dev-stamp value (copilot): the previous `${DATE}.0` for non-release builds meant that on a day where `cli-v${DATE}.1` was already cut, PR builds would source a script stamped older than `cli-latest`, and the shell wrappers' startup update-check would print the "Update available" prompt mid-test. Dev-stamps now use `${DATE}.${COUNT}`, matching the latest already-released number for the day (or `.0` if no release has happened yet). PR scripts can never be "older than" the day's latest release. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
Summary
0.0.0-devforever; CI computes today's date + iteration and stamps it where it's needed..Nis now "Nth release of the day" (viagh release list), the waydocs/versioning.mdalways said it was. The next merged PR releases ascli-v2026.05.21.1instead of.591.release-clithat copied the shell scripts intorelease/before the stamp step, so the releasedcopilot_here.sh/.ps1were going out unstamped.Test plan
compute-versionjob logsDev-stamp version: 2026.05.21.0on this PR build.test-shell-functionsjob runscopilot_here --versionand the YYYY.MM.DD format regex passes on all four OS matrix entries.cli-v2026.05.21.1(not.591) and thecopilot_here.shattached to the release hasCOPILOT_HERE_VERSION="2026.05.21.1"in line 8.--versionreports2026.05.21.1end-to-end (download fromcli-latest, run--version).