fix(cli): transfer respect resolvers#1888
Merged
jakobmoellerdev merged 8 commits intoMar 3, 2026
Merged
Conversation
1 task
fabianburth
added a commit
that referenced
this pull request
Mar 3, 2026
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Introduces a new method to retrieve the repository specification for a given component version, enhancing the transfer operations. #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Contributes to open-component-model/ocm-project#905 #### Testing ##### How to test the changes <!-- Required files to test the changes: .ocmconfig ```yaml type: generic.config.ocm.software/v1 configurations: - type: credentials.config.ocm.software repositories: - repository: type: DockerConfig/v1 dockerConfigFile: "~/.docker/config.json" ``` Commands that test the change: ```bash ocm get cv xxx ocm transfer xxx ``` --> ##### Verification - [ ] I have tested the changes locally by running `ocm` Manual tests will be performed as part of the follow up TGD adjustment PR: #1888 --------- Signed-off-by: Fabian Burth <fabian.burth@sap.com>
… local blob resources This commit introduces integration tests for the transfer command using resolvers, ensuring that component versions are correctly transferred between repositories. Signed-off-by: Fabian Burth <fabian.burth@sap.com>
- Added SourceRepository to discoveryValue for improved context. - Updated processLocalBlob and processOCIArtifact to use discoveryValue. - Refactored repository type handling for better clarity and error management. Signed-off-by: Fabian Burth <fabian.burth@sap.com>
c38294f to
4da9003
Compare
…r functions Change ChooseAddType, ChooseGetLocalResourceType, and ChooseAddLocalResourceType to return errors instead of panicking. Update all callers to handle the errors properly. Also update ociUploadAsLocalResource to return an error tuple. Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
…ase of fallback resolver Signed-off-by: Fabian Burth <fabian.burth@sap.com>
4da9003 to
cb33a27
Compare
fabianburth
commented
Mar 3, 2026
Remove Ref from discoveryValue struct since the repository was incorrectly inherited from parent. Child components may be stored in different repositories as determined by the resolver's GetRepositorySpecificationForComponent. Now uses simple component:version keys for graph traversal, with the resolver independently determining the correct repository for each component. Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Contributor
Author
|
Didn't do a thorough self-review yet. But generally, this should be close to ready, also tested manually with both legacy and new resolvers. |
…ot exist Signed-off-by: Fabian Burth <fabian.burth@sap.com>
jakobmoellerdev
approved these changes
Mar 3, 2026
matthiasbruns
approved these changes
Mar 3, 2026
frewilhelm
pushed a commit
to frewilhelm/open-component-model
that referenced
this pull request
Mar 12, 2026
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it So far, we were doing a prefetch of the components. The prefetch used the configured resolvers. Since those components are added to the environment of the TGD and not fetched via transformations, we did not run into issues here. But the Generiererich hard coded against the from spec. This created issues for local blobs, as they now were trying to be fetched from the source repo instead of the correct repo configured by the resolvers. #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Contributes to open-component-model/ocm-project#905 #### Testing ##### How to test the changes <!-- Required files to test the changes: .ocmconfig ```yaml type: generic.config.ocm.software/v1 configurations: - type: credentials.config.ocm.software repositories: - repository: type: DockerConfig/v1 dockerConfigFile: "~/.docker/config.json" ``` Commands that test the change: ```bash ocm get cv xxx ocm transfer xxx ``` --> ##### Verification - [x] I have tested the changes locally by running `ocm` --------- Signed-off-by: Fabian Burth <fabian.burth@sap.com>
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.
What this PR does / why we need it
So far, we were doing a prefetch of the components. The prefetch used the configured resolvers. Since those components are added to the environment of the TGD and not fetched via transformations, we did not run into issues here.
But the Generiererich hard coded against the from spec. This created issues for local blobs, as they now were trying to be fetched from the source repo instead of the correct repo configured by the resolvers.
Which issue(s) this PR fixes
Contributes to open-component-model/ocm-project#905
Testing
How to test the changes
Verification
ocm