UNCLASSIFIED - NO CUI

Injects released_at date of latest bbctl release as build constant for homebrew buildDate ldflag

General MR

Summary

constants.buildDate is intended to be used to mark the window before bbctl should start warning users that they are perilously out of date. Our homebrew formula previously injected the actual current datetime at the time of homebrew which could mean an incorrect date is used for the warning logic.

This MR instead hardcodes in a buildDate into the generated homebrew formula using the released_at date from the relevant bbctl release as reported by the gitlab API.

References

Relevant logs/screenshots

brewer test log

❯ go test -v ./scripts/brewer/...
?       repo1.dso.mil/big-bang/apps/developer-tools/bbctl/scripts/brewer        [no test files]
=== RUN   TestGitlabRelease_SourceTarballURI
--- PASS: TestGitlabRelease_SourceTarballURI (0.00s)
PASS
ok      repo1.dso.mil/big-bang/apps/developer-tools/bbctl/scripts/brewer/fetcher        (cached)

homebrew test log:

❯ make brew
brew uninstall -f "bbctl"
Uninstalling bbctl... (7 files, 82.7MB)
brew untap -f "bigbang/tools-public" || echo "untap complete, swallowing return code..."
Untapping bigbang/tools-public...
Untapped 1 formula (218 files, 125.2KB).
brew tap "bigbang/tools-public" .
==> Tapping bigbang/tools-public
Cloning into '/opt/homebrew/Library/Taps/bigbang/homebrew-tools-public'...
done.
Tapped 1 formula (218 files, 125.2KB).
brew reinstall -f "bigbang/tools-public/bbctl"
==> Fetching bigbang/tools-public/bbctl
==> Downloading https://repo1.dso.mil/big-bang/apps/developer-tools/bbctl/-/archive/0.7.6/bbctl-0.7.6.tar.gz
Already downloaded: /Users/daniel/Library/Caches/Homebrew/downloads/cdbfed710815626b3034cd1778628355d1b9a5ce69d6e31cc0750e01dfe0a8ca--bbctl-0.7.6.tar.gz
==> Reinstalling bigbang/tools-public/bbctl 
==> go build -ldflags=-s -w -X 'repo1.dso.mil/big-bang/apps/developer-tools/bbctl/static.buildDate=2025-01-22 15:50:38.633 +0000 UTC'
🍺  /opt/homebrew/Cellar/bbctl/0.7.6: 7 files, 82.7MB, built in 4 seconds
==> Running `brew cleanup bbctl`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
brew audit --verbose --strict --formula "bigbang/tools-public/bbctl"
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/bin/bundle clean
brew test --verbose --debug "bigbang/tools-public/bbctl"
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/bin/bundle clean
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading bigbang/tools-public/bbctl
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go
==> Testing bigbang/tools-public/bbctl
/opt/homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /opt/homebrew/Library/Taps/bigbang/homebrew-tools-public/Formula/bbctl.rb
==> /opt/homebrew/Cellar/bbctl/0.7.6/bin/bbctl

Linked Issue

issue

Upgrade Notices

N/A

Edited by Daniel Pritchett

Merge request reports

Loading