mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:11:49 +00:00
We have nice release names in https://github.com/sourcegraph/sg/releases, but it's not actually programmatically available - this causes a discrepancy between the `sg` version one might pull, and the version of `sg` that is known in-code, and means that we can't do something like #62134.
This change adds a `ReleaseName` variable to be stamped at build/release time, and updates a few references to `BuildCommit` where I think it might be more prudent to report `ReleaseName` instead, and also fixes some yellow squiggles in my IDE on files I visited (sorry) and some noisy `-v` output (sorry again)
## Test plan
```
$ go build -ldflags "-s -w -X main.BuildCommit=$(git rev-list -1 HEAD .) -X main.ReleaseName=hello-world" -o ./sg ./dev/sg
$ ./sg version
hello-world
$ ./sg -v version
Version: hello-world
Build commit:
|
||
|---|---|---|
| .. | ||
| backport.yml | ||
| buf-breaking-check.yml | ||
| buildchecker-history.yml | ||
| buildchecker.yml | ||
| CODENOTIFY | ||
| codenotify.yml | ||
| label-move.yml | ||
| label-notify.yml | ||
| licenses-check.yml | ||
| licenses-update.yml | ||
| lighthouse-production.yml-disabled | ||
| merge-pr.yml | ||
| move-labled-issues-to-project.yml | ||
| pg-utils.yml | ||
| pr-auditor.yml | ||
| progress.yml | ||
| release-amis.yml | ||
| report-job-failure.yml | ||
| scip-go.yml | ||
| scip-typescript.yml | ||
| sg-binary-release.yml | ||
| sg-setup.yml | ||
| team-labeler.yml | ||
| tracking-issue.yml | ||
| universal-ctags.yml | ||
| update-embeddings-list.yml | ||
| wolfictl-update.yml | ||