Skip to content

Use SPDX license identifiers in go.mod and add test to enforce them#4940

Merged
pietern merged 1 commit intomainfrom
verify-spdx-notice
Apr 13, 2026
Merged

Use SPDX license identifiers in go.mod and add test to enforce them#4940
pietern merged 1 commit intomainfrom
verify-spdx-notice

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented Apr 13, 2026

Summary

  • Normalize all license comments in go.mod to use standard SPDX identifiers (e.g. Apache 2.0Apache-2.0, BSD 3-ClauseBSD-3-Clause)
  • Use MIT AND Apache-2.0 for go.yaml.in/yaml/v3 (different files under different licenses)
  • Add internal/build/license_test.go that parses go.mod with x/mod/modfile and validates every direct dependency has a valid SPDX license comment

Test plan

  • go test ./internal/build/ -run TestRequireSPDXLicenseComment passes
  • Cross-checked all 38 license comments against upstream LICENSE files

This pull request was AI-assisted by Isaac.

@pietern pietern requested a review from simonfaltum April 13, 2026 11:42
@simonfaltum
Copy link
Copy Markdown
Member

Do we have somehow enforce this test?

Copy link
Copy Markdown
Contributor Author

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonfaltum WDYM?

I'm adding another one that verifies that our NOTICE file is up to date. Using normalized license names makes that easier/unambigous.

@pietern pietern enabled auto-merge April 13, 2026 11:51
@simonfaltum
Copy link
Copy Markdown
Member

@simonfaltum WDYM?

I'm adding another one that verifies that our NOTICE file is up to date. Using normalized license names makes that easier/unambigous.

I was just not sure it would run as part of the automatic test suite

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Apr 13, 2026

Got it, yeah it does:

cli/Makefile

Line 5 in cf6e193

TEST_PACKAGES = ./acceptance/internal ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/ssh/... .

@pietern pietern added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit 54e4b0b Apr 13, 2026
31 checks passed
@pietern pietern deleted the verify-spdx-notice branch April 13, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants