Repository navigation
spdx-tools: gate the latest tag on smoke tests and document the image - #463
Open
officialasishkumar wants to merge 1 commit into
Open
officialasishkumar wants to merge 1 commit into
officialasishkumar wants to merge 1 commit into
Conversation
spdx-tools was the only image whose oci_tag did not depend on any oci_exec_test, so a build that succeeded but produced a broken image (e.g. a JRE packaging change or a broken tools-java launcher) would still be tagged as ghcr.io/wolfi-dev/spdx-tools:latest by the nightly release, and presubmit had nothing to run. Add images/spdx-tools/tests, following the layout used by the other images, with checks that: - `Version` runs and prints the SPDX tool version - the image runs as the nonroot user - a valid SPDX 2.3 JSON document passes `Verify` - `Convert` turns it into tag-value output that also passes `Verify` - `Verify` exits non-zero for an invalid document The test document is written from the script rather than checked in because .gitignore excludes **/*.spdx.json. The latest tag now depends on module.test-latest, like the other images. Also add an images/spdx-tools README with usage examples and list the image in the top-level README. Fixes wolfi-dev#462 Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #462
spdx-toolswas the only image whoselatesttag didn't depend on anyoci_exec_test. If a build succeeded but produced a broken image, the nightly release would still tag it.This adds
images/spdx-tools/tests, laid out like the other images' tests, and makes thelatesttagdepends_onthem. The tests check that:Versionruns and prints the tool versionnonrootVerifyConvertfrom JSON to tag-value works, and the output also passesVerifyVerifyexits non-zero on an invalid documentThe test document is written from the script instead of being checked in, because
.gitignoreexcludes**/*.spdx.json.It also adds a README for the image and lists it in the top-level README.
Testing: I ran
terraform apply -target=module.spdx-toolsagainst a local registry (aarch64). The image built, both tests passed, andlatestwas tagged. I also ran the script against a copy of the image with the JVMmodulesfile deleted, and it failed (exit 1) as it should.terraform fmt -checkis clean.