feat(exit-certificate): execution traceability — startup banner and build version#1688
Conversation
- Makefile: build exit_certificate with -ldflags "all=$(LDFLAGS)" so Version/GitRev/GitBranch/BuildDate are populated in the binary. - cmd/main.go: --version prints full build info via aggkit.PrintVersion. - run.go: log a per-line startup banner (version, branch, build date, config-file sha256 and command line) at the start of Run. - log/log.go: drop the per-trace "version" field now that the banner reports it once at startup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @joanestebanr's task in 1m 48s —— View job PR Review Complete ✅Reviewing PR #1688: feat(exit-certificate): inject build version and log startup banner 🚀 What's NewThis PR adds build version injection via ldflags and implements a startup banner for the exit_certificate tool that displays build information, config file SHA256, and command-line arguments. The per-log-line 🐛 Bug FixesNone. 📋 Config UpdatesNone.
|
…ity" The banner now reports config sha256 and command line in addition to the build version, so "Traceability" describes the block better than "Version". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 050ba8c612
ℹ️ 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".
log/log.go is shared infrastructure and should not be modified by this tool. Keep the version field on every trace; the startup banner still reports the full build version info separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR improves execution traceability for the exit_certificate tool by emitting startup build/config provenance in logs and ensuring build metadata is injected/printed consistently.
Changes:
- Add a startup “traceability banner” to
exit_certificateruns (build info, Go/OS, config sha256, argv). - Customize
--versionoutput to print full build information viaaggkit.PrintVersion. - Ensure the
exit_certificateMakefile target injects build metadata through-ldflags.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tools/exit_certificate/run.go | Adds startup traceability banner logging build/runtime info, config hash, and command invocation. |
| tools/exit_certificate/cmd/main.go | Overrides cli.VersionPrinter so --version prints full build details. |
| Makefile | Updates exit_certificate build target to pass -ldflags "all=$(LDFLAGS)" for build metadata injection. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9ba61ff14
ℹ️ 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".
…argv Addresses PR review feedback on the traceability banner: - Config sha256 is now computed from the same on-disk bytes LoadConfig parses (returned by readRawConfig) and stored on Config.ConfigSHA256, instead of a second independent os.ReadFile in the banner. The banner is logged after a successful load, so the hash always matches the config actually used (no TOCTOU, no TOML→JSON mismatch). - Command line is now shell-escaped (shellQuoteArgs): args containing spaces or special chars are single-quoted, so the logged command is faithfully replayable (e.g. --step 'sign, submit'). - Fixed the printStartupBanner doc comment that wrongly claimed it replaced the per-trace "version" field (that logger change was reverted; log/log.go is left untouched). Adds TestShellQuote and TestLoadConfigSetsSHA256. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
golangci-lint (staticcheck QF1001) flagged the negated boolean in shellQuote. Move the positive check into an isShellSafeRune helper and negate at the call site. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
b546dad
into
feature/exit-certificate-tool
…uild version (#1688) ## 🔄 Changes Summary **Goal:** make every `exit_certificate` run **traceable** — at a glance you can tell which build, which config and which exact command produced a given output/log. To achieve that: - **run.go**: logs an *execution traceability* banner line-by-line (same format as the rest of the logs) at the start of `Run`, reporting: - build version, git revision, git branch and build date, - Go version and OS/Arch, - the **sha256 of the config file** (so the exact parameters used can be verified), - the **command-line arguments** the tool was invoked with. - **Makefile**: the `exit_certificate` build target now passes `-ldflags "all=$(LDFLAGS)"`, so `Version`, `GitRev`, `GitBranch` and `BuildDate` are injected into the binary (previously left at their defaults — without this the banner/`--version` would report placeholders). - **cmd/main.go**: `--version` prints the full build info (version, git revision, branch, build date, Go version, OS/Arch) via a custom `cli.VersionPrinter` calling `aggkit.PrintVersion`. ### Output example: ``` 2026-06-30T15:23:42.172+0200 INFO exit_certificate/run.go:31 ╔═══════════════════════════════════════════╗ {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:32 ║ Exit Certificate Tool — Traceability ║ {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:33 ╚═══════════════════════════════════════════╝ {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:34 Version: v0.10.0-rc1-72-gfc332f25 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:35 Git revision: fc332f2 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:36 Git branch: feat/exit-certificate-tool-version {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:37 Built: Tue, 30 Jun 2026 15:16:17 +0200 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:38 Go version: go1.25.7 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:39 OS/Arch: linux/amd64 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:40 Config file: tmp/exit_certificate-kurtosis.json (sha256: e2f0a892dcb070f888037f0f88bf47232e7667f61e6449419fca9c92ba77ce01) {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:41 Command line: ./target/exit_certificate -c tmp/exit_certificate-kurtosis.json {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} ``` ##⚠️ Breaking Changes - None. ## 📋 Config Updates - None. ## ✅ Testing - 🤖 **Automatic**: `make build-exit_certificate` builds with injected ldflags. - 🖱️ **Manual**: `./target/exit_certificate --version` prints full build info; running any step logs the traceability banner (verified config sha256 + command line render correctly). ## 📝 Notes - `log/log.go` is shared infrastructure and is intentionally left untouched; the per-trace `version` field stays as-is for all binaries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…uild version (#1688) ## 🔄 Changes Summary **Goal:** make every `exit_certificate` run **traceable** — at a glance you can tell which build, which config and which exact command produced a given output/log. To achieve that: - **run.go**: logs an *execution traceability* banner line-by-line (same format as the rest of the logs) at the start of `Run`, reporting: - build version, git revision, git branch and build date, - Go version and OS/Arch, - the **sha256 of the config file** (so the exact parameters used can be verified), - the **command-line arguments** the tool was invoked with. - **Makefile**: the `exit_certificate` build target now passes `-ldflags "all=$(LDFLAGS)"`, so `Version`, `GitRev`, `GitBranch` and `BuildDate` are injected into the binary (previously left at their defaults — without this the banner/`--version` would report placeholders). - **cmd/main.go**: `--version` prints the full build info (version, git revision, branch, build date, Go version, OS/Arch) via a custom `cli.VersionPrinter` calling `aggkit.PrintVersion`. ### Output example: ``` 2026-06-30T15:23:42.172+0200 INFO exit_certificate/run.go:31 ╔═══════════════════════════════════════════╗ {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:32 ║ Exit Certificate Tool — Traceability ║ {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:33 ╚═══════════════════════════════════════════╝ {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:34 Version: v0.10.0-rc1-72-gfc332f25 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:35 Git revision: fc332f2 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:36 Git branch: feat/exit-certificate-tool-version {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:37 Built: Tue, 30 Jun 2026 15:16:17 +0200 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:38 Go version: go1.25.7 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:39 OS/Arch: linux/amd64 {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:40 Config file: tmp/exit_certificate-kurtosis.json (sha256: e2f0a892dcb070f888037f0f88bf47232e7667f61e6449419fca9c92ba77ce01) {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} 2026-06-30T15:23:42.173+0200 INFO exit_certificate/run.go:41 Command line: ./target/exit_certificate -c tmp/exit_certificate-kurtosis.json {"pid": 560596, "version": "v0.10.0-rc1-72-gfc332f25"} ``` ##⚠️ Breaking Changes - None. ## 📋 Config Updates - None. ## ✅ Testing - 🤖 **Automatic**: `make build-exit_certificate` builds with injected ldflags. - 🖱️ **Manual**: `./target/exit_certificate --version` prints full build info; running any step logs the traceability banner (verified config sha256 + command line render correctly). ## 📝 Notes - `log/log.go` is shared infrastructure and is intentionally left untouched; the per-trace `version` field stays as-is for all binaries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>



🔄 Changes Summary
Goal: make every
exit_certificaterun traceable — at a glance you can tell which build, which config and which exact command produced a given output/log.To achieve that:
Run, reporting:exit_certificatebuild target now passes-ldflags "all=$(LDFLAGS)", soVersion,GitRev,GitBranchandBuildDateare injected into the binary (previously left at their defaults — without this the banner/--versionwould report placeholders).--versionprints the full build info (version, git revision, branch, build date, Go version, OS/Arch) via a customcli.VersionPrintercallingaggkit.PrintVersion.Output example:
📋 Config Updates
✅ Testing
make build-exit_certificatebuilds with injected ldflags../target/exit_certificate --versionprints full build info; running any step logs the traceability banner (verified config sha256 + command line render correctly).📝 Notes
log/log.gois shared infrastructure and is intentionally left untouched; the per-traceversionfield stays as-is for all binaries.🤖 Generated with Claude Code