Refactor the registry+v1 bundle definition package#2
Merged
Merged
Conversation
1. Validate that all CRD versions in the manifests are listed as owned in the CSV spec 2. Validate that there are no duplicate manifests (based on group, kind, and name)
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the registry+v1 bundle definition package to improve API design and structure. The refactoring introduces a new generic File struct that preserves both raw data and typed values, and ensures bundle instances can only be created through validated loaders.
- Adds a new generic
Filestruct for preserving both raw data and typed values - Restructures the API to use interfaces (Loader pattern) for validated bundle creation
- Reorganizes code by moving shared functionality to internal packages
Reviewed Changes
Copilot reviewed 17 out of 216 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/pkg/spec/registryv1.go | Updates bundle loading to use new BundleFSLoader interface |
| internal/pkg/bundle/registry/v1/oci.go | Removes OCI marshaling code (moved to bundle.go) |
| internal/pkg/bundle/registry/v1/oci_test.go | Removes OCI marshaling tests (moved to bundle_test.go) |
| internal/pkg/bundle/registry/v1/metadata.go | Refactors metadata handling with new File struct and loader pattern |
| internal/pkg/bundle/registry/v1/metadata_test.go | Updates tests for new metadata structure and validation |
| internal/pkg/bundle/registry/v1/manifests.go | Refactors manifest handling with improved validation and File struct |
| internal/pkg/bundle/registry/v1/manifests_test.go | Updates manifest tests for new structure |
| internal/pkg/bundle/registry/v1/file.go | Adds new generic File struct for data and value preservation |
| internal/pkg/bundle/registry/v1/bundle.go | Restructures bundle creation with loader pattern and adds OCI marshaling |
| internal/pkg/bundle/registry/v1/bundle_test.go | Updates bundle tests for new loader-based API |
| internal/pkg/bundle/registry/internal/supported_kinds.go | Moves supported kinds definitions to internal package |
| internal/pkg/bundle/registry/internal/do.go | Adds utility function for error collection |
| go.mod | Updates Go version and various dependencies |
| demos/bundles/registryv1/argocd-operator/Makefile | Adds new demo Makefile |
| demos/bundles/registryv1/Makefile | Updates demo Makefile to use subdirectory pattern |
| demos/bundles/Makefile | Adds new demo Makefile for bundle builds |
| demos/Makefile | Updates to limit directory depth search |
Comments suppressed due to low confidence (6)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filestruct that contains raw data AND the typed value it represents. Useful for preserving original user-provided data while also giving programmatic access to the struct value.Bundleinstance can only be initialized by a Loader (new interface) that can validate it before handing back to a user.