Skip to content

chore: complete Alpha.2 v1 dependency cleanup - #2730

Draft
fseldow wants to merge 6 commits into
notaryproject:mainfrom
fseldow:fseldow/remove-v1-code-refs
Draft

chore: complete Alpha.2 v1 dependency cleanup#2730
fseldow wants to merge 6 commits into
notaryproject:mainfrom
fseldow:fseldow/remove-v1-code-refs

Conversation

@fseldow

@fseldow fseldow commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a draft PR for the remaining Alpha.2 cleanup work after switching the Executor runtime to ratify-go.

  • remove the direct github.com/ratify-project/ratify v1.x module dependency from go.mod / go.sum
  • remove old v1 multi-CRD API/controller/customresource surfaces now that v2 uses the Executor CRD
    • api/v1beta1
    • api/unversioned
    • pkg/controllers
    • pkg/customresources
  • migrate remaining non-CRD legacy pkg/plugins imports to the local github.com/notaryproject/ratify/v2 module path
  • add missing non-CRD compatibility packages locally so existing plugin/provider functionality is preserved
  • switch internal/logger to the local v2 errors package

Validation

  • go list ./...
  • go test ./cmd/ratify-gatekeeper-provider ./internal/logger ./pkg/common/... ./pkg/referrerstore/... ./pkg/verifier/... ./pkg/keymanagementprovider/... ./pkg/certificateprovider/... ./config
  • golangci-lint run --timeout=10m locally with Go 1.26 toolchain: 0 issues
  • govulncheck ./... locally with Go 1.26.5 toolchain: no reachable vulnerabilities
  • GitHub Actions k8s e2e matrix: all 6 jobs passed

Notes

  • This intentionally keeps non-CRD legacy plugin/provider functionality, but removes old v1 CRD API/controller surfaces.
  • build-pr remains red only because AKS e2e failed before test execution due to missing Azure login secrets (client-id / tenant-id) in the fork/upstream PR context.
  • PR remains draft because it is a large dependency cleanup and should be reviewed as the Alpha.2 cleanup proposal.

Copilot AI review requested due to automatic review settings July 14, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates internal/logger to use Ratify v2’s local errors package instead of the legacy v1 module reference, removing the v1 dependency from runtime code.

Changes:

  • Replaced the v1 errors import path with github.com/notaryproject/ratify/v2/errors in the logger package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.58079% with 834 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.96%. Comparing base (0117d70) to head (f0658cf).

Files with missing lines Patch % Lines
config/configManager.go 0.00% 83 Missing ⚠️
pkg/referrerstore/mocks/memory_store.go 0.00% 64 Missing ⚠️
pkg/referrerstore/oras/oras.go 74.59% 42 Missing and 21 partials ⚠️
pkg/referrerstore/plugin/plugin.go 50.00% 35 Missing and 15 partials ⚠️
pkg/certificateprovider/azurekeyvault/provider.go 66.42% 39 Missing and 8 partials ⚠️
pkg/referrerstore/plugin/skel/skel.go 69.44% 28 Missing and 16 partials ⚠️
config/config.go 45.00% 27 Missing and 6 partials ⚠️
...kg/keymanagementprovider/azurekeyvault/provider.go 85.89% 20 Missing and 13 partials ⚠️
...kg/common/oras/authprovider/azure/azureidentity.go 62.35% 25 Missing and 7 partials ⚠️
pkg/referrerstore/factory/factory.go 49.05% 18 Missing and 9 partials ⚠️
... and 26 more

❌ Your patch check has failed because the patch coverage (63.58%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (71.96%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2730      +/-   ##
==========================================
- Coverage   76.37%   71.96%   -4.41%     
==========================================
  Files          88      133      +45     
  Lines        4000     6268    +2268     
==========================================
+ Hits         3055     4511    +1456     
- Misses        799     1461     +662     
- Partials      146      296     +150     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fseldow
fseldow marked this pull request as draft July 14, 2026 16:14
@fseldow fseldow changed the title chore: remove v1 errors import from logger chore: remove legacy v1 plugin framework Jul 14, 2026
@fseldow fseldow changed the title chore: remove legacy v1 plugin framework chore: remove v1 errors import from logger Jul 14, 2026
@fseldow
fseldow force-pushed the fseldow/remove-v1-code-refs branch from 327807a to 13f4b46 Compare July 14, 2026 19:19
@fseldow fseldow changed the title chore: remove v1 errors import from logger chore: remove v1 package dependency Jul 14, 2026
case "PRIVATE KEY":
logger.GetLogger(ctx, logOpt).Warnf("azure keyvault certificate provider: certificate %s, version %s private key skipped. Please see doc to learn how to create a new certificate in keyvault with non exportable keys. https://learn.microsoft.com/en-us/azure/key-vault/certificates/how-to-export-certificate?tabs=azure-cli#exportable-and-non-exportable-keys", certName, version)
case "CERTIFICATE":
pemData := make([]byte, 0, len(block.Bytes)+64)
case "PRIVATE KEY":
logger.GetLogger(ctx, logOpt).Warnf("azure keyvault key management provider: certificate %s, version %s private key skipped. Please see doc to learn how to create a new certificate in keyvault with non exportable keys. https://learn.microsoft.com/en-us/azure/key-vault/certificates/how-to-export-certificate?tabs=azure-cli#exportable-and-non-exportable-keys", certName, version)
case "CERTIFICATE":
pemData := make([]byte, 0, len(block.Bytes)+64)
@fseldow fseldow changed the title chore: remove v1 package dependency chore: complete Alpha.2 v1 dependency cleanup Jul 16, 2026
@fseldow
fseldow force-pushed the fseldow/remove-v1-code-refs branch from 7092ec8 to fb2c89b Compare July 30, 2026 08:58
@github-actions github-actions Bot added the v2 label Jul 30, 2026
fseldow and others added 5 commits July 30, 2026 18:59
Switch the runtime logger to use the local v2 errors package instead of importing errors from the v1 Ratify module.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move legacy Ratify packages used by existing pkg/plugins functionality under the v2 module path so the repository no longer depends on github.com/ratify-project/ratify v1.x. Preserve existing functionality while removing the v1 package dependency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move legacy plugin/provider code to local v2 imports while removing old v1 CRD API/controller surfaces. This keeps non-CRD plugin and provider functionality without depending on github.com/ratify-project/ratify v1.x.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove an accidental BATS temporary file from the draft dependency cleanup PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address lint and vulnerability scan issues introduced while moving legacy compatibility code under the v2 module path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@fseldow
fseldow force-pushed the fseldow/remove-v1-code-refs branch from fb2c89b to f0658cf Compare July 30, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants