[FEATURE] Harden the third-party license tree: a PR check, per-OS package sets, and Go's own license
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Start with the Makefile target third-party-licenses, .goreleaser.yaml, and TestThirdPartyLicensesCoverEveryShippedBuild; compare the shipped GOOS/GOARCH pairs and mains with the proposed per-pair passes. Then inspect docs/security/verifying-releases.md and pkg/foreman/agent/tools/run_gate_job_ci_sync_test.go for the related wording and exemption. Done means the license tree includes Go's license, generation uses isolated staging and exact module exclusion, and the coverage test verifies every shipped build; the lint.yml check and gate exemption require a maintainer edit.
Written by the indexing model from the issue text.
Description
Feature Description
Follow-ups from the code review of #2568 (#2564), which made every release archive and image ship third_party_licenses/. The tree is correct today. This makes it hard to break, and closes one gap in what it covers.
Problem Statement
- License problems surface only at release time.
make third-party-licensesruns in goreleaser's before hook and inhack/scan-images.sh, andrelease-scan.ymlruns the real scan only on the release-please PR or a manual run (startsWith(github.head_ref, 'release-please--branches--main')). Ordinary pull requests run onlyscripts/scan-images_test.sh. A dependency bump that go-licenses cannot classify, or that breaks a package load, merges green and then blocks the next release. The gate exemption #2568 added inpkg/foreman/agent/tools/run_gate_job_ci_sync_test.gosays the tree "carries no per-branch signal", which is not true: everygo.modchange is one. - Each pass loads every binary under every GOOS. The target runs
go-licenses saveover all six mains for linux, darwin and windows, at the host's GOARCH and default cgo setting. goreleaser buildscmd/metal-agentfor darwin only; the controller, foreman-operator and router-proxy for linux only; the cli for windows on amd64 only; all withCGO_ENABLED=0. A package whose files are all limited to another OS fails to load ("build constraints exclude all Go files"), so a future darwin-only import in the Mac agent would fail the linux and windows passes and block every release, although goreleaser would build fine. The module sets match today (109 module paths), so nothing is missing now. - Go's own license is not in the tree. go-licenses skips the standard library by design, but every shipped binary statically links the Go runtime and standard library, and Go's BSD-3-Clause license asks binary redistributions to reproduce its notice.
--ignore $(go list -m)is a prefix match. go-licenses v2.0.1 compares withstrings.HasPrefix(p.PkgPath, i)(licenses/library.go:134), so a future dependency such asgithub.com/defilantech/llmkube-runtimeswould be dropped from the tree without a warning. With ago.workin scope,go list -malso prints more than one module.- Staging directories can be left in the repo root. The target stages in
third_party_licenses.tmpandthird_party_licenses.tmp.<os>at the repo root, which the/third_party_licenses/gitignore entry does not cover. A run killed by SIGKILL or the OOM killer skips the EXIT trap, and the leftovers make a later non-snapshotgoreleaser releasefail its dirty-tree check.
As a maintainer, I want a dependency change that breaks the license tree to fail its own pull request, not the next release.
Proposed Solution
Decisions, so this can be built without a round trip:
- PR check. A new
make check-third-party-licensestarget generates the tree into a temporary directory exactly as the release does, and discards it; it fails when generation fails. It runs on every pull request as a step inlint.yml, next tocheck-docs-reference, with no paths filter (lint.ymlalready notes that GitHub ignores paths filters formerge_group).- The
lint.ymlstep, and thegateExemptCIChecksentry it needs inrun_gate_job_ci_sync_test.go(same reasoning as #2568's), are a maintainer edit: the bot cannot push workflow files. Write the exact step in the PR body and leave both to a maintainer commit, as in #2568. - Correct the existing
third-party-licensesexemption reason inrun_gate_job_ci_sync_test.go: drop "carries no per-branch signal" and say the pull-request check covers it.
- The
- Per-target passes. One
go-licenses savepass per (GOOS, GOARCH) pair that.goreleaser.yamlships (today linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 and windows/amd64), each withCGO_ENABLED=0and only the mains goreleaser builds for that pair. The trees merge as they do today. The per-pair lists stay in the Makefile, andTestThirdPartyLicensesCoverEveryShippedBuildchecks them against.goreleaser.yamlin both directions, honoring each build'signore: every shipped build is covered, and no pass loads a main goreleaser does not build for that pair. - Go's license. The target copies
$(go env GOROOT)/LICENSEtothird_party_licenses/go/LICENSE, so the notice comes from the toolchain that built the release. The sentence indocs/security/verifying-releases.mdsays the tree includes it. - Exact ignore.
--ignore "$(GOWORK=off go list -m)/", with the trailing slash, so only the main module's packages are excluded (the repo has no package at the module root). - Staging. Stage in
mktemp -doutside the repo and move the result into place, so a killed run leaves nothing in the working tree. - Nothing else changes. The archives and images keep shipping
third_party_licenses/and/licenses/as #2568 made them.
How to verify:
make third-party-licensespasses, and the tree has the 13 NOTICE files from #2564 plusgo/LICENSE.make check-third-party-licensespasses on the branch, and fails on a scratch change that makes a pass fail to load (for example a darwin-only import added to a linux-only main).TestThirdPartyLicensesCoverEveryShippedBuildfails when a (GOOS, GOARCH) pair or a main is added to.goreleaser.yamlwithout the Makefile, and when a Makefile pass loads a main that goreleaser does not build for that pair.- A goreleaser snapshot build still shows
third_party_licenses/in every archive. make gatepasses.
Alternatives Considered
- Run the PR check only when
go.modorgo.sumchange: cheaper, but it needs a paths filter or a changed-files step, andmerge_groupignores paths filters. - Generate the per-pair lists from
.goreleaser.yaml: removes the duplication, but needs a YAML parser in the Makefile or a helper binary; a two-way test keeps the lists honest more simply. - Leave Go's license out: common in Go projects, but it is cheap to include and it answers a question a license review would ask.
Additional Context
- Related issues: #2564 (the tree) and its PR #2568; #2565 (the copyright holder). All are ahead of the CNCF Sandbox application.
- Found by a code review of #2568 on 2026-11-16. Each item was checked against
release-scan.yml,.goreleaser.yamland the go-licenses v2.0.1 source. - Out of scope: the Foreman scan Job reporting a setup failure as a CVE finding with no logs (it predates #2568, and the Job moves to Meitheal), and test cleanups in
internal/machoplist/release_licenses_test.go.
Priority
- Critical - Blocking my use case
- High - Would significantly improve my workflow
- Medium - Nice to have
- Low - Minor improvement
Willingness to Contribute
- Yes, I can submit a PR
- Yes, I can help test
- No, but I can provide feedback
- No, just requesting
- Dominant language
- Go
- Stars
- 232
- Forks
- 37
- Avg merge
- 21h 42m
- Merged PRs (30d)
- 244
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from defilantech/LLMKube
-
component/metal-agent documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
defilantech/LLMKube#2581 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
defilantech/LLMKube#2578 ·
Maintainers usually reply within 1 day
-
documentation helm priority/low size/small
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
defilantech/LLMKube#2420 ·
Maintainers usually reply within 1 day
-
component/metal-agent enhancement priority/low size/medium
Difficulty 4/5 3-5 days Newbie friendliness 48/100
defilantech/LLMKube#2597 ·
Maintainers usually reply within 1 day
-
[BUG] Docs and comments describe InsufficientMemory only as a start refusal, but a serving engine can now carry itPossibly taken @defilan-agent claimed this today. Openbug component/metal-agent documentation priority/low size/small
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
defilantech/LLMKube#2596 ·
Maintainers usually reply within 1 day
All issues in defilantech/LLMKube
Similar issues
-
☢️ Bug v3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area/import-export area/projects concern/ux
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
go-vikunja/vikunja#4455 · 1 comment ·
Maintainers usually reply within 2 days
-
Dependabot PRs no longer merge automaticallyPossibly taken @dwisiswant0 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
projectdiscovery/urlfinder#160 ·
Maintainers usually reply within 1 day
-
database
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
chnm/legal-modernism#450 ·
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day