Add third-party license notices, generated and embedded in the binary
THIRD-PARTY-LICENSES.md holds the license and notice files of the Go distribution and of the 35 modules that ./cmd/uberbringer links on linux amd64, armv6, armv7 and arm64, as each distribution ships them. tools/genlicenses writes it on go generate from go list -deps, so modules only the tools and tests use stay out. Beside each module's root license it takes NOTICE files and the license files in its linked packages' directories, which cover vendored code in gofiber/utils, klauspost/compress and fasthttp. Each module is listed with its version, so any dependency change needs the file regenerated. The generator fails on a module with no license file or a license it does not recognize. The same text goes to internal/app/uberbringer/licenses_embed.md, which the binary embeds and the new `uberbringer licenses` command prints. The release archives carry the file, and the Docker image keeps it with LICENSE.txt in /usr/share/licenses/uberbringer/. The Makefile's openapi and openapi-check targets become generate and generate-check. They, the CI step and the gate in CLAUDE.md check docs/swagger.json and both license files, and a test fails when a committed copy is out of date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ee65e72c44
commit
0c88b4ffd5
19 files changed
+4969
-23
No files matched your search
@@ -24,6 +24,12 @@ root `Dockerfile`.
|
||||
its routes from the same table. Never edit the file by hand; regenerate it
|
||||
in the same commit as any change to a route or to a request or response
|
||||
type.
|
||||
- `THIRD-PARTY-LICENSES.md` and its copy `internal/app/uberbringer/licenses_embed.md`,
|
||||
which the binary embeds and `uberbringer licenses` prints, are generated
|
||||
(`go generate ./...`, which runs `tools/genlicenses`) from the license and
|
||||
notice files of the Go distribution and of the modules that
|
||||
`./cmd/uberbringer` links on each release platform. Never edit them by
|
||||
hand; regenerate them in the same commit as any dependency change.
|
||||
- `docs/design.md` explains why the daemon is shaped as it is and lists what
|
||||
is deferred. Change it in the same commit as any code that departs from it.
|
||||
- `docs/plans/<feature>.md` holds a feature until it ships. A decision made
|
||||
@@ -37,7 +43,10 @@ the wiring, and `server/` holds the HTTP API. `internal/pkg/*` holds the
|
||||
libraries. README § Development lists them. `tools/genopenapi` writes
|
||||
`docs/swagger.json`; the `docs` package embeds it, and `internal/app` hands
|
||||
it to the server in its config, so the generator never builds the package
|
||||
that embeds its own output. The module path is the bare
|
||||
that embeds its own output. `tools/genlicenses` writes
|
||||
`THIRD-PARTY-LICENSES.md` and the copy beside `internal/app/uberbringer`'s
|
||||
`licenses.go`; it imports nothing from the module and learns the linked
|
||||
modules from `go list`. The module path is the bare
|
||||
`uberbringer`, so imports read `uberbringer/internal/...`. Imports point down:
|
||||
|
||||
- server → modules, printqueue, receipt, printer, escpos
|
||||
@@ -62,7 +71,7 @@ works from PowerShell and fails from Git Bash.
|
||||
go mod tidy -diff
|
||||
go vet ./...
|
||||
go tool staticcheck ./...
|
||||
go generate ./... && git diff --exit-code -- docs/swagger.json # the OpenAPI document is up to date
|
||||
go generate ./... && git diff --exit-code -- docs/swagger.json THIRD-PARTY-LICENSES.md internal/app/uberbringer/licenses_embed.md # generated files are up to date
|
||||
go test -race -timeout 5m ./... *> "$env:TEMP\uberbringer-test.txt"; "exit $LASTEXITCODE"
|
||||
go tool govulncheck ./... # after any dependency or toolchain change, and before a tag
|
||||
goreleaser release --snapshot --clean # into dist/; after a change to .goreleaser.yaml or packaging/
|
||||
|
||||
Reference in new issue
Block a user