Skip to content

fix(cli): fixup / refactor filesystem config handling#615

Merged
jakobmoellerdev merged 4 commits into
open-component-model:mainfrom
jakobmoellerdev:cleanup-cli-fs-handling
Aug 25, 2025
Merged

fix(cli): fixup / refactor filesystem config handling#615
jakobmoellerdev merged 4 commits into
open-component-model:mainfrom
jakobmoellerdev:cleanup-cli-fs-handling

Conversation

@jakobmoellerdev

Copy link
Copy Markdown
Member

What this PR does / why we need it

  • Refactored working directory handling
  • Improved CLI flag precedence logic to ensure CLI flag values override other configurations effectively.
  • Removed hooks and builder logic to reduce complexity and redundancy.
  • Enhanced unit test to validate new working directory and filesystem setup logic is actually set in filesystem context

These changes improve reliability and simplify the implementation of filesystem configuration while ensuring proper value precedence and behavior. They also fixed a bug in the filesystem config defaulting not applying to the context.

Which issue(s) this PR fixes

follow up to #591

#### What this PR does / why we need it
- Refactored working directory handling
- Improved CLI flag precedence logic to ensure CLI flag values override other configurations effectively.
- Removed hooks and builder logic to reduce complexity and redundancy.
- Enhanced unit test to validate new working directory and filesystem setup logic is actually set in filesystem context

These changes improve reliability and simplify the implementation of filesystem configuration while ensuring proper value precedence and behavior. They also fixed a bug in the filesystem config defaulting not applying to the context

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the cleanup-cli-fs-handling branch from 5e2755d to 6d01077 Compare August 22, 2025 10:11
- Migrated `filesystem configuration` to the global `Scheme` introduced in the configuration package.
- Replaced local scheme initialization with `configuration.Scheme`.
- Updated defaulting and conversion logic to leverage the centralized `Scheme` for runtime types.
- Dependency updated: `configuration` package to `v0.0.7` for global scheme support.

This change unifies runtime type handling and simplifies scheme integration by using the shared global scheme.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the cleanup-cli-fs-handling branch from 9ef3d57 to 9190e4e Compare August 22, 2025 11:35
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review August 22, 2025 13:46
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner August 22, 2025 13:46
@jakobmoellerdev jakobmoellerdev merged commit 9798b4c into open-component-model:main Aug 25, 2025
17 checks passed
jakobmoellerdev pushed a commit that referenced this pull request Sep 1, 2025
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it
ocm get cv fails with components in oci registries without specifying
port.

for urls like `ghcr.io` in `ocm get cv` the `credentialCache` fails due
to using `net.SplitHostPort` on the url without a port.

This PR adds a fallback to 443 in those cases and updates the tests.

#### Which issue(s) this PR fixes
Fixes #615

---------

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants