Skip to content

docs: update provenance tutorial #1110

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

benmss
Copy link
Member

@benmss benmss commented Jun 25, 2025

Summary

This PR updates the npm provenance discovery tutorial to include the newer discovery methods: PyPI and GitHub.

Description of changes

  • The tutorial is updated to provide examples of provenance discovery for PyPI and GitHub using the toga PyPI library, which has provenance of either type available for discovery depending on the exact version specified.
  • For GitHub attestation, a small code update is included to allow the repository URL and commit digest to be found from provenance.
  • The npm part of the tutorial is updated to use a newer version of the semver library 7.7.2

Removal of verify-provenance and Download Changes

As part of this PR, the verify-provenance command line argument has been removed, making this action occur by default once again. This command was originally introduced due to concerns about downloading overly large files, thereby slowing down analyses. Instead of this, a file size limit has been imposed for download operations that were previously using the Stream functionality.
In cases where the size is not known before the download begins (most cases), the download will terminate when the streamed data exceeds the limit. This limit can be configured in the defaults.ini and defaults to 10mb. This is not sufficient for two of our existing integration tests and they have been adjusted accordingly.

@benmss benmss self-assigned this Jun 25, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 25, 2025
@benmss benmss marked this pull request as ready for review June 26, 2025 00:02
@benmss benmss requested review from behnazh-w and tromai as code owners June 26, 2025 00:02
Copy link
Member

@behnazh-w behnazh-w left a comment

Choose a reason for hiding this comment

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

Please add integration tests for the toga package with a tutorial label. We make sure to have an integration test for all of our tutorials and catch changes/issues.

@behnazh-w behnazh-w added this to the Release version 0.17.0 milestone Jul 21, 2025
@benmss benmss force-pushed the benmss/update-provenance-tutorial branch from b246674 to c665852 Compare July 23, 2025 06:03
benmss added 6 commits July 29, 2025 13:53
…test as tutorial; update tutorial wording; include tutorial sections for CI and local provenance; add input attestation predicate and build types

Signed-off-by: Ben Selwyn-Smith <[email protected]>
…rify-provenance option

Signed-off-by: Ben Selwyn-Smith <[email protected]>
@benmss benmss force-pushed the benmss/update-provenance-tutorial branch from b98767a to cf97722 Compare July 29, 2025 04:43
:alt: HTML report for ``toga 0.4.8``, summary
:align: center

This image shows that both checks have passed, confirming that the repository URL and commit digest from the provenance match those associated with the user provided PURL. To access the full report use the following:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This image shows that both checks have passed, confirming that the repository URL and commit digest from the provenance match those associated with the user provided PURL. To access the full report use the following:
This image shows that all three checks have passed, confirming that the repository URL and commit digest from the provenance match those associated with the user provided PURL. To access the full report use the following command:


./run_macaron.sh analyze -purl pkg:pypi/[email protected]

As part of this analysis, Macaron ends up downloading three different asset files: The `attestation asset <https://api.github.com/repos/urllib3/urllib3/releases/assets/84708804>`_, the artifact's Python wheel file, and the artifact's compressed archive. By examining the attestation, Macaron can verify the two other files. This analysis can then report that provenance exists, and is verified.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
As part of this analysis, Macaron ends up downloading three different asset files: The `attestation asset <https://api.github.com/repos/urllib3/urllib3/releases/assets/84708804>`_, the artifact's Python wheel file, and the artifact's compressed archive. By examining the attestation, Macaron can verify the two other files. This analysis can then report that provenance exists, and is verified.
As part of this analysis, Macaron ends up downloading three different asset files: The `attestation asset <https://api.github.com/repos/urllib3/urllib3/releases/assets/84708804>`_, the artifact's Python wheel file, and the source distribution tarball file. By examining the attestation, Macaron can verify the two other files. This analysis can then report that provenance exists, and is verified.

Supported Attestation Types
***************************

When attestation is provided to Macaron as input, it must be of one of the support types in order to be accepted. Support is defined by the ``predicateType`` and ``buildType`` properties within an attestation.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
When attestation is provided to Macaron as input, it must be of one of the support types in order to be accepted. Support is defined by the ``predicateType`` and ``buildType`` properties within an attestation.
When attestation is provided to Macaron as input, it must be of one of the supported types in order to be accepted. Support is defined by the ``predicateType`` and ``buildType`` properties within an attestation.

@behnazh-w behnazh-w requested a review from Demolus13 August 18, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provenance verification should be enabled by default with a restricted download size
2 participants