Skip to content

Conversation

@ailrst
Copy link
Contributor

@ailrst ailrst commented Jan 23, 2023

Check now displays all provenance artefacts which passed, failed, or were skipped.

The check now fails when any artefact mentioned in the provenance fails to verify,
or must be skipped.

@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jan 23, 2023
@behnazh-w behnazh-w self-requested a review January 23, 2023 03:00
Comment on lines 364 to 370
if failed or skipped:
result_value = CheckResultType.FAILED

if passed:
check_result["justification"].append("Successfully verified level 3: ")
else:
check_result["justification"].append("Failed verification for level 3: ")
Copy link
Member

Choose a reason for hiding this comment

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

I think result_value = CheckResultType.PASSED is missing when verification is successful?

Also, if passed is not empty, this would override the results even if failed or skipped are not empty.

Suggested change
if failed or skipped:
result_value = CheckResultType.FAILED
if passed:
check_result["justification"].append("Successfully verified level 3: ")
else:
check_result["justification"].append("Failed verification for level 3: ")
if failed or skipped:
result_value = CheckResultType.FAILED
check_result["justification"].append("Failed verification for level 3: ")
else:
result_value = CheckResultType.PASSED
check_result["justification"].append("Successfully verified level 3: ")
return result_value

check_result["justification"].append("Could not verify level 3 provenance.")
return CheckResultType.FAILED
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
return CheckResultType.FAILED
return result_value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied these changes in 155b695, thank you.

@behnazh-w
Copy link
Member

Is there any particular reason to use ! in the PR title? Are you expecting a breaking change?

@ailrst
Copy link
Contributor Author

ailrst commented Jan 23, 2023

I used ! in the commit since it changes the check result for an identical analysis target where some assets verify and some don't

@behnazh-w
Copy link
Member

I used ! in the commit since it changes the check result for an identical analysis target where some assets verify and some don't

Yes, that makes sense. But because we haven't released Macaron yet, we don't need to add ! for now.

@behnazh-w behnazh-w removed the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jan 24, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 24, 2023
Comment on lines 35 to 41
PASSED = "verify passed"
FAILED = "verify failed"
ERROR = "verify error"
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add comments for these three types to clarify how they are concluded/differentiated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is addressed in 78b65b2

# TODO: During verification, we need to fetch the workflow and verify that it's not
# using self-hosted runners, custom containers or services, etc.
all_feedback = []
all_feedback: list[tuple[str, str, _VerifyArtefactResult]] = []
Copy link
Member

Choose a reason for hiding this comment

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

How about using typing.NamedTuple instead of a plain tuple to improve the readability and prevent potential mistakes in looking up fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's perfect thanks I didn't know that existed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is addressed in 78b65b2

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, LGTM. Let's close this PR and move the changes to #46 as discussed.

Alistair Michael added 3 commits January 25, 2023 13:12
Check now displays all provenance artefacts which passed, failed, or were skipped. The check now fails when _any_ artefact mentioned in the provenance fails to verify, or
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.

2 participants