generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 30
refactor!: remove the automatic sbom generation feature for Java #1145
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
Merged
+2,309
−20,400
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9b2a342
refactor!: remove the automatic sbom generation feature for Java
behnazh-w f9e6c83
chore: remove output/.gradle and output/.m2 refs
behnazh-w 73580f2
chore: remove chown for .m2 dir in container
behnazh-w d1eb0fb
docs: improve the DependencyAnalyzer doctring
behnazh-w 1705989
chore: remove unnecessary get_dep_analyzer overrides
behnazh-w 3e8784b
chore: remove unnecessary get_dep_analyzer overrides and handling loc…
behnazh-w 99973a1
chore: use the new base image & remove remaining mvnw and gradlew ins…
behnazh-w File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,34 +85,19 @@ venv: | |
| # So we create the dist dir if it doesn't exist in the setup target. | ||
| # See https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives. | ||
| # We also install cyclonedx-go to generate SBOM for Go, compile the Go modules, | ||
| # install SLSA verifier binary, download mvnw, and gradlew. | ||
| # and install SLSA verifier binary. | ||
| .PHONY: setup | ||
| setup: force-upgrade setup-go setup-binaries setup-schemastore | ||
| pre-commit install | ||
| mkdir -p dist | ||
| go install github.com/CycloneDX/cyclonedx-gomod/cmd/[email protected] | ||
| setup-go: | ||
| go build -o $(PACKAGE_PATH)/bin/ $(REPO_PATH)/golang/cmd/... | ||
| setup-binaries: $(PACKAGE_PATH)/bin/slsa-verifier $(PACKAGE_PATH)/resources/mvnw $(PACKAGE_PATH)/resources/gradlew souffle gnu-sed | ||
| setup-binaries: $(PACKAGE_PATH)/bin/slsa-verifier souffle gnu-sed | ||
| $(PACKAGE_PATH)/bin/slsa-verifier: | ||
| git clone --depth 1 https://github.com/slsa-framework/slsa-verifier.git -b v2.7.1 | ||
| cd slsa-verifier/cli/slsa-verifier && go build -o $(PACKAGE_PATH)/bin/ | ||
| cd $(REPO_PATH) && rm -rf slsa-verifier | ||
| $(PACKAGE_PATH)/resources/mvnw: | ||
| cd $(PACKAGE_PATH)/resources \ | ||
| && wget https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper-distribution/3.1.1/maven-wrapper-distribution-3.1.1-bin.zip \ | ||
| && unzip -o maven-wrapper-distribution-3.1.1-bin.zip \ | ||
| && rm -r maven-wrapper-distribution-3.1.1-bin.zip \ | ||
| && echo -e "distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip\nwrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" > .mvn/wrapper/maven-wrapper.properties \ | ||
| && cd $(REPO_PATH) | ||
| $(PACKAGE_PATH)/resources/gradlew: | ||
| cd $(PACKAGE_PATH)/resources \ | ||
| && export GRADLE_VERSION=7.6 \ | ||
| && wget https://services.gradle.org/distributions/gradle-$$GRADLE_VERSION-bin.zip \ | ||
| && unzip -o gradle-$$GRADLE_VERSION-bin.zip \ | ||
| && rm -r gradle-$$GRADLE_VERSION-bin.zip \ | ||
| && gradle-$$GRADLE_VERSION/bin/gradle wrapper \ | ||
| && cd $(REPO_PATH) | ||
| setup-schemastore: $(PACKAGE_PATH)/resources/schemastore/github-workflow.json $(PACKAGE_PATH)/resources/schemastore/LICENSE $(PACKAGE_PATH)/resources/schemastore/NOTICE | ||
| $(PACKAGE_PATH)/resources/schemastore/github-workflow.json: | ||
| cd $(PACKAGE_PATH)/resources \ | ||
|
|
@@ -236,7 +221,7 @@ setup-integration-test-utility-for-docker: | |
| # Generate a Software Bill of Materials (SBOM). | ||
| .PHONY: sbom | ||
| sbom: requirements | ||
| cyclonedx-py requirements --output-format json --outfile dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-sbom.json | ||
| cyclonedx-py requirements --output-format json --output-file dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-sbom.json | ||
| $$HOME/go/bin/cyclonedx-gomod mod -json -output dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-sbom-go.json $(REPO_PATH) | ||
|
|
||
| # Generate a requirements.txt file containing version and integrity hashes for all | ||
|
|
@@ -433,11 +418,7 @@ clean: dist-clean bin-clean docs-clean | |
| nuke-caches: clean | ||
| find src/ -type d -name __pycache__ -exec rm -fr {} + | ||
| find tests/ -type d -name __pycache__ -exec rm -fr {} + | ||
| nuke-mvnw: | ||
| cd $(PACKAGE_PATH)/resources \ | ||
| && rm mvnw mvnw.cmd mvnwDebug mvnwDebug.cmd \ | ||
| && cd $(REPO_PATH) | ||
| nuke: nuke-caches nuke-mvnw | ||
| nuke: nuke-caches | ||
| if [ ! -z "${VIRTUAL_ENV}" ]; then \ | ||
| echo "Please deactivate the virtual environment first!" && exit 1; \ | ||
| fi | ||
|
|
||
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,11 +66,11 @@ Skip this section if you already know how to install Macaron. | |
| Run ``analyze`` command | ||
| *********************** | ||
|
|
||
| First, we need to run the ``analyze`` command of Macaron to run a number of :ref:`checks <checks>` and collect evidence for ``example-maven-app`` and its dependencies. | ||
| First, we need to run the ``analyze`` command of Macaron to run a number of :ref:`checks <checks>` and collect evidence for ``example-maven-app`` and its dependencies. You need to generate the SBOM and provide it to Macaron. For more details see the instructions : :ref:`here <with-sbom>`. | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| ./run_macaron.sh analyze -purl pkg:maven/io.github.behnazh-w.demo/[email protected]?type=jar -rp https://github.com/behnazh-w/example-maven-app --deps-depth=1 | ||
| ./run_macaron.sh analyze -purl pkg:maven/io.github.behnazh-w.demo/[email protected]?type=jar -rp https://github.com/behnazh-w/example-maven-app --deps-depth=1 -sbom sbom.json | ||
|
|
||
| .. note:: By default, Macaron clones the repositories and creates output files under the ``output`` directory. To understand the structure of this directory please see :ref:`Output Files Guide <output_files_guide>`. | ||
|
|
||
|
|
@@ -98,7 +98,7 @@ As you can see, some of the checks are passing and some are failing. In summary, | |
| * but it is not deploying any artifacts automatically (``mcn_build_as_code_1``) | ||
| * and no CI workflow runs are detected that automatically publish artifacts (``mcn_find_artifact_pipeline_1``) | ||
|
|
||
| As you scroll down in the HTML report, you will see a section for the dependencies that were automatically identified: | ||
| As you scroll down in the HTML report, you will see a section for the dependencies that were identified from the provided ``sbom.json``: | ||
|
|
||
| .. _fig_example-maven-app-deps: | ||
|
|
||
|
|
||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.