Skip to content
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

fix: check if repository is available in provenance available check #467

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

behnazh-w
Copy link
Member

If a repository is not available for an artifact/analysis target identified by a PURL string, the mcn_provenance_available_1 check throws an exception.

This PR fixes this bug by checking if the repository is available before running the check.

@behnazh-w behnazh-w requested a review from nathanwn September 11, 2023 07:14
@behnazh-w behnazh-w requested a review from tromai as a code owner September 11, 2023 07:14
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 11, 2023
@behnazh-w behnazh-w changed the base branch from fix-purl-processing to staging September 12, 2023 01:53
@behnazh-w behnazh-w force-pushed the fix-prov-check-null-repo branch from 048cd56 to d684c29 Compare September 12, 2023 01:56
@behnazh-w behnazh-w force-pushed the fix-prov-check-null-repo branch from d684c29 to d80f49a Compare September 12, 2023 02:05
Copy link
Member

@nathanwn nathanwn left a comment

Choose a reason for hiding this comment

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

As we have discussed, I wonder if this issue can be prevented with static type checking. We should revisit this in the future to see if there is a solution that works well with both SQLAlchemy and mypy.

@behnazh-w
Copy link
Member Author

As we have discussed, I wonder if this issue can be prevented with static type checking. We should revisit this in the future to see if there is a solution that works well with both SQLAlchemy and mypy.

Yes, it would be nice to enforce type checking on repositories, which can be None in our data model. But that requires some investigation.

@behnazh-w behnazh-w merged commit fae998b into staging Sep 12, 2023
9 checks passed
@behnazh-w behnazh-w deleted the fix-prov-check-null-repo branch October 10, 2023 03:41
art1f1c3R pushed a commit that referenced this pull request Nov 29, 2024
…467)

If a repository is not available for an artifact/analysis target identified by a PURL string, the `mcn_provenance_available_1` check throws an exception.

This PR fixes this bug by checking if the repository is available before running the check.

Signed-off-by: behnazh-w <[email protected]>
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.

2 participants