-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump github.com/spdx/tools-golang to v0.4.0 #1450
Conversation
Hi @lucacome we already have SPDX 2.3 support -- we've been using the main branch of spdx/tools-golang for a while now, but it would definitely be good to update to the release tag! |
any idea why the tests are failing with |
Signed-off-by: Luca Comellini <luca.com@gmail.com>
cd60826
to
cdf987b
Compare
@lucacome there is some redaction of values when comparing JSON to snapshots, I think there were fields added which are making the redaction (which is just a few regular expressions) cause the JSON to be invalid. This should be a simple fix, I can help with if you need. It probably could be something like this: func spdxJsonRedactor(s []byte) []byte {
// each SBOM reports the time it was generated, which is not useful during snapshot testing
s = regexp.MustCompile(`"created":\s+"[^"]*"`).ReplaceAll(s, []byte(`"created":""`))
// each SBOM reports a unique documentNamespace when generated, this is not useful for snapshot testing
s = regexp.MustCompile(`"documentNamespace":\s+"[^"]*"`).ReplaceAll(s, []byte(`"documentNamespace":""`))
// the license list will be updated periodically, the value here should not be directly tested in snapshot tests
return regexp.MustCompile(`"licenseListVersion":\s+"[^"]*"`).ReplaceAll(s, []byte(`"licenseListVersion":""`))
} ... and then the snapshots need to be updated by setting this flag to true (you can just temporarily update the code) |
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@lucacome I went ahead and fixed the tests, etc. -- thanks for the contribution! |
Thanks for taking care of this, unfortunately I got busy with other stuff 👍 |
Signed-off-by: Luca Comellini <luca.com@gmail.com>
Adds support for SPDX 2.3