Label the version report's date line "commit date" (closes #409)
check / check (push) Failing after 17m39s

The value is the commit's date, which the Makefile and the Dockerfile
stamp in, not the time of the build. The other labels gain one space
so every value still starts in one column.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-10 19:57:35 +00:00
1 parent 13a35a986a
commit 6da4315f57
2 files changed
+26 -7

No files matched your search

+7 -7
View File
@@ -37,13 +37,13 @@ func writeVersion(out *ui.Writer) {
w := out.Out()
_, _ = fmt.Fprintf(w, "vaultik %s\n", globals.Version)
_, _ = fmt.Fprintf(w, " commit: %s\n", globals.Commit)
_, _ = fmt.Fprintf(w, " build date: %s\n", globals.CommitDate)
_, _ = fmt.Fprintf(w, " go: %s\n", runtime.Version())
_, _ = fmt.Fprintf(w, " os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
_, _ = fmt.Fprintf(w, " author: %s\n", globals.Author)
_, _ = fmt.Fprintf(w, " homepage: %s\n", globals.Homepage)
_, _ = fmt.Fprintf(w, " license: %s\n", globals.License)
_, _ = fmt.Fprintf(w, " commit: %s\n", globals.Commit)
_, _ = fmt.Fprintf(w, " commit date: %s\n", globals.CommitDate)
_, _ = fmt.Fprintf(w, " go: %s\n", runtime.Version())
_, _ = fmt.Fprintf(w, " os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
_, _ = fmt.Fprintf(w, " author: %s\n", globals.Author)
_, _ = fmt.Fprintf(w, " homepage: %s\n", globals.Homepage)
_, _ = fmt.Fprintf(w, " license: %s\n", globals.License)
if globals.IsDevVersion(globals.Version) {
_, _ = fmt.Fprintln(w)
+19
View File
@@ -49,6 +49,25 @@ func TestVersionCommandReportsBuildVersion(t *testing.T) {
}
}
// TestVersionCommandLabelsCommitDate checks that the date line is
// labelled as the commit's date, which is what the build stamps into
// it, and that its value starts in the same column as the commit's.
//
//nolint:paralleltest // executes a command that reads the global rootFlags
func TestVersionCommandLabelsCommitDate(t *testing.T) {
out := runVersionCommand(t)
wantLine := " commit date: " + globals.CommitDate
if !strings.Contains(out, wantLine+"\n") {
t.Errorf("output has no line %q:\n%s", wantLine, out)
}
wantCommit := " commit: " + globals.Commit
if !strings.Contains(out, wantCommit+"\n") {
t.Errorf("output has no line %q:\n%s", wantCommit, out)
}
}
// TestVersionCommandFlagsDevelopmentBuild is the regression test for
// the thing this command exists to prevent: a build that is not a
// release must say so. The notice used to be gated on the version