Skip to content

Commit 2e6aecc

Browse files
zeevdrclaude
andauthored
fix(cli): pin man-page date so docs check is deterministic (#329)
cobra/doc.GenManHeader.Date defaults to time.Now() when nil, embedding the build-time month/year in every man page header. The Docs check job ran make generate docs and diffed against committed pages, so on the 1st of every month every PR failed because the regenerated headers no longer matched the committed ones. Pin the date to a fixed constant (2026-01-01 UTC) and rewrite the 45 committed pages from "Apr 2026" to "Jan 2026" so the regenerated output matches. The constant is bumped intentionally rather than implicitly drifting with wall-clock. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent d14e61b commit 2e6aecc

46 files changed

Lines changed: 53 additions & 45 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/decree/gendocs.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ import (
55
"os"
66
"path/filepath"
77
"strings"
8+
"time"
89

910
"github.com/spf13/cobra"
1011
"github.com/spf13/cobra/doc"
1112
)
1213

14+
// manPageDate pins the timestamp embedded in generated man pages so the
15+
// output is byte-deterministic across runs. cobra/doc defaults to
16+
// time.Now(), which produces a different "Mon YYYY" header every month
17+
// and breaks the docs-up-to-date CI check on the 1st of each month.
18+
var manPageDate = time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)
19+
1320
var genDocsCmd = &cobra.Command{
1421
Use: "gen-docs [output-dir]",
1522
Short: "Generate CLI reference documentation in markdown",
@@ -66,6 +73,7 @@ var genManCmd = &cobra.Command{
6673
Section: "1",
6774
Source: "OpenDecree",
6875
Manual: "OpenDecree CLI",
76+
Date: &manPageDate,
6977
}
7078

7179
rootCmd.DisableAutoGenTag = true

docs/man/decree-audit-query.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-audit-unused.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-audit-usage.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-audit.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-completion-bash.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-completion-fish.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-completion-powershell.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-completion-zsh.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/decree-completion.1

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)