Skip to content

spdx: use go.mod module path for root package name#623

Open
jeefy wants to merge 1 commit into
kubernetes-sigs:mainfrom
jeefy:fix-root-package-gomod-name
Open

spdx: use go.mod module path for root package name#623
jeefy wants to merge 1 commit into
kubernetes-sigs:mainfrom
jeefy:fix-root-package-gomod-name

Conversation

@jeefy
Copy link
Copy Markdown
Member

@jeefy jeefy commented Mar 13, 2026

Summary

  • When generating SBOMs from a directory, PackageFromDirectory now looks for a go.mod file and uses the module path as the root package name instead of the directory basename.
  • Fixes the issue where temporary or CI/CD build directories produce meaningless root package names like tmp.b46BF6mTG5 that cascade through all SPDX IDs, file references, and relationships.
  • Adds a test covering the nested go.mod lookup path.

Fixes #622

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/release Categorizes an issue or PR as relevant to SIG Release. labels Mar 13, 2026
@k8s-ci-robot k8s-ci-robot requested review from jimangel and jrsapi March 13, 2026 17:20
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jeefy
Once this PR has been reviewed and has the lgtm label, please assign palnabarun for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 13, 2026
Signed-off-by: Jeffrey Sica <me@jeefy.dev>
@jeefy jeefy force-pushed the fix-root-package-gomod-name branch from e031c30 to fd4977c Compare March 13, 2026 17:28
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

k8s-ci-robot commented Mar 13, 2026

@jeefy: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-bom-check-embedded-data fd4977c link true /test pull-bom-check-embedded-data

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@puerco
Copy link
Copy Markdown
Member

puerco commented Apr 7, 2026

@jeefy can you rebase this? The failing test was fixed a while ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Root package name uses Go temp build directory instead of go.mod module path

3 participants