fix: various cli fixes on transfer and construction behavior#1807
Merged
jakobmoellerdev merged 8 commits intoFeb 20, 2026
Merged
Conversation
…sitories #### What this commit does - Implemented repository type-specific logic for handling resource transformations. - Introduced a check to instantiate repository objects based on the `toSpec.GetType()` dynamically. - Updated `ociUploadAsArtifact` and `ociUploadAsLocalResource` transformations to correctly handle both OCI and CTF repository types. - Added error handling for unsupported repository types for better robustness. #### Why this is needed This change ensures resource transformations can dynamically adapt to the repository type, providing greater flexibility and extensibility for handling both OCI and CTF repository schemes in component versions. Fixes edge cases where incorrect repository handling could occur. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
### What this commit does - Updated the resource download logging statement to use a `defer` construct for consistent logging behavior, ensuring it executes after all operations complete. ### Why this is needed This change ensures better readability and avoids premature logging of success before all related operations and error checks have concluded. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
### What this commit does - Added handling for `credentials.ErrNotFound` during credential resolution to prevent unnecessary errors when credentials are missing but non-critical. - Introduced the `errors` package to enable error comparison for better accuracy. ### Why this is needed This change ensures the CLI behaves gracefully when certain credentials are not required, improving overall robustness and user experience. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
### What this commit does - Replaced references to `OCM_CONFIG_PATH` with `OCM_CONFIG` across all CLI documentation files for consistency. - Updated the `RegisterConfigFlag` function and associated CLI configuration documentation. ### Why this is needed This change reflects the correct environment variable name (`OCM_CONFIG`) and avoids confusion in configuration flag usage. Aligns documentation with the current implementation. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
…ualizer ### What this commit does - Updated log levels for "transformation started" and "transformation completed" events in `simpleVisualizer` from `Info` to `Debug`. ### Why this is needed This change reduces unnecessary log noise during normal CLI operation by aligning the log levels to better reflect the intended granularity, improving the developer debugging experience. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
### What this commit does - Added a `defer` statement to close the `constructorStream` after it is opened, preventing potential file descriptor leaks. - Expanded the constructor data with environment variable substitution using `os.Expand`. ### Why this is needed This change ensures that file handles are properly closed, improving resource management and preventing system issues caused by unclosed streams. It also enhances component constructor functionality by substituting environment variables, adding flexibility for runtime configurations. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
piotrjanik
reviewed
Feb 19, 2026
piotrjanik
previously approved these changes
Feb 19, 2026
matthiasbruns
previously approved these changes
Feb 20, 2026
973d220
eeeed0e to
973d220
Compare
… constructor files
### What this commit does
- Introduced environment variable substitution in component constructor files using `${VAR_NAME}` or `$VAR_NAME` syntax.
- Updated processing logic to expand environment variables during file reading.
- Extended CLI documentation to include examples and use cases for environment variable substitution.
- Added explanation of dynamic configuration scenarios in relevant ADR and reference documentation.
### Why this is needed
This change enhances flexibility by enabling dynamic configuration of component constructor files. It supports use cases like CI/CD pipeline integrations, registry-specific configurations, and runtime-dependent metadata injection.
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
973d220 to
d61cda2
Compare
frewilhelm
approved these changes
Feb 20, 2026
piotrjanik
approved these changes
Feb 20, 2026
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
defer, preventing “success” from being printed before later work can still fail.Which issue(s) this PR fixes
part of my sovereign scenario testing (open-component-model/ocm-project#842)