- Notifications
You must be signed in to change notification settings - Fork 30
feat!: Improve justification output for provenance_l3_check #29
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
Conversation
| Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (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. |
| 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: ") |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return CheckResultType.FAILED | |
| return result_value |
There was a problem hiding this comment.
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.
| Is there any particular reason to use |
| I used |
Yes, that makes sense. But because we haven't released Macaron yet, we don't need to add |
| PASSED = "verify passed" | ||
| FAILED = "verify failed" | ||
| ERROR = "verify error" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]] = [] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
ed9c77d to 78b65b2 Compare
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.