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

feat: Enable multi verifier name #1187

Conversation

junczhu
Copy link
Collaborator

@junczhu junczhu commented Nov 23, 2023

Description

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):

Fixes #1066

Introduced a verifier name and a verifier type (specName) to the existing VerifierConfig and VerifierPlugin. This way we can support multiple of the same verifier type. In the verifier controller, the Name field in the VerifierConfig has been set to the objectName which is the spec.metadata.name field (this is the unique verifier identifier and different from the verifier type). The previous Name field, and currently specName field, in the VerifierConfig is used to determine whether to run a particular verifier or not on an artifact. Almost closer to a verifier type than the individual verifier spec.metadata.name field.

Before:
image

After:
image

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Helm Chart Change (any edit/addition/update that is necessary for changes merged to the main branch)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have appropriate license header?

Post Merge Requirements

  • MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (2a2cfd3) 54.97% compared to head (2ff1060) 55.09%.

Files Patch % Lines
plugins/verifier/cosign/cosign.go 10.00% 17 Missing and 1 partial ⚠️
plugins/verifier/sbom/sbom.go 41.66% 6 Missing and 1 partial ⚠️
...rifier/vulnerabilityreport/vulnerability_report.go 80.00% 5 Missing and 1 partial ⚠️
...ugins/verifier/schemavalidator/schema_validator.go 28.57% 4 Missing and 1 partial ⚠️
pkg/verifier/factory/factory.go 78.57% 1 Missing and 2 partials ⚠️
pkg/executor/core/testtypes.go 33.33% 2 Missing ⚠️
pkg/verifier/plugin/plugin.go 83.33% 2 Missing ⚠️
pkg/controllers/verifier_controller.go 88.88% 0 Missing and 1 partial ⚠️
pkg/verifier/notation/notation.go 94.44% 1 Missing ⚠️
plugins/verifier/licensechecker/licensechecker.go 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1187      +/-   ##
==========================================
+ Coverage   54.97%   55.09%   +0.12%     
==========================================
  Files         104      104              
  Lines        6780     6865      +85     
==========================================
+ Hits         3727     3782      +55     
- Misses       2726     2751      +25     
- Partials      327      332       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/verifier/notation/notation.go Show resolved Hide resolved
pkg/verifier/types/types.go Outdated Show resolved Hide resolved
pkg/verifier/factory/factory.go Show resolved Hide resolved
pkg/verifier/notation/notation.go Outdated Show resolved Hide resolved
@junczhu
Copy link
Collaborator Author

junczhu commented Nov 27, 2023

Going to keep the old CLI user behavior: when user only provided name in the config.json, verifier report will not show type field.
When user using the new config including type. the type field will update accordingly.

@junczhu
Copy link
Collaborator Author

junczhu commented Nov 30, 2023

added e2e test

@junczhu
Copy link
Collaborator Author

junczhu commented Dec 6, 2023

we also need to update ratify docs.

ratify-project/ratify-web#43

binbin-li
binbin-li previously approved these changes Dec 6, 2023
Copy link
Collaborator

@binbin-li binbin-li left a comment

Choose a reason for hiding this comment

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

lgtm overall

akashsinghal
akashsinghal previously approved these changes Dec 6, 2023
Copy link
Collaborator

@akashsinghal akashsinghal left a comment

Choose a reason for hiding this comment

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

Thanks @junczhu for pushing this through! LGTM. I advise to wait for @binbin-li final sign off too.

@junczhu
Copy link
Collaborator Author

junczhu commented Dec 7, 2023

e2e on AKS: ZAFT-Armored-Keeper-of-Unity#11

@junczhu junczhu merged commit 287e485 into ratify-project:main Dec 7, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VerifierReport should contain both verifierType and verifierName while using Rego Policy
4 participants