feat: #565 relative file pointers#540
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for relative file pointers by introducing working directory configuration to the filesystem. The changes enable relative paths to be resolved against a configurable working directory instead of the current working directory.
- Adds
WorkingDirectoryfield to filesystem configuration - Implements path resolution utilities to handle absolute vs relative paths
- Updates file input method to use the configured working directory for path resolution
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/internal/plugin/builtin/input/file/method.go | Updates registration functions to accept filesystem configuration |
| cli/internal/plugin/builtin/builtin.go | Passes filesystem configuration to file input registration |
| cli/cmd/setup_filesystem_config.go | Refactors configuration setup and adds working directory flag support |
| cli/cmd/cmd.go | Adds working directory flag constant |
| bindings/go/input/file/path_test.go | Adds comprehensive tests for path utilities |
| bindings/go/input/file/path.go | Implements path resolution utilities |
| bindings/go/input/file/method.go | Updates InputMethod to use working directory for path resolution |
| bindings/go/configuration/filesystem/v1alpha1/spec/config.go | Adds WorkingDirectory field to filesystem configuration |
|
|
jakobmoellerdev
left a comment
There was a problem hiding this comment.
Remember that when actually opening the PR you shouldn't push the go workspace but separate your changes into the individual modules as single PRs so we can version them separately too!
Cherry picking filesystem changes from #540 #### What this PR does / why we need it Resolve file/dir inputs relative to the constructor file by wiring a filesystem working directory through input methods; default-deny path escapes with an explicit opt-out. Changes (high level): - Added WorkingDirectory to FS config #### Which issue(s) this PR fixes Fixes [#565](open-component-model/ocm-project#565) Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
# Conflicts: # bindings/go/configuration/filesystem/v1alpha1/spec/config.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
99fdb66 to
5606614
Compare
Cherry picking constructor changes from #540 #### What this PR does / why we need it Resolve file/dir inputs relative to the constructor file by wiring a filesystem working directory through input methods; default-deny path escapes with an explicit opt-out. Changes (high level): - Added WorkingDirectory handling to the input bindings #### Which issue(s) this PR fixes Fixes [#565](open-component-model/ocm-project#565) --------- Signed-off-by: Matthias Bruns <git@matthiasbruns.com> Co-authored-by: Fabian Burth <fabian.burth@sap.com> Co-authored-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
322d864 to
7a5a232
Compare
What this PR does / why we need it
Resolve file/dir inputs relative to the constructor file by wiring a filesystem working directory through input methods; default-deny path escapes with an explicit opt-out.
Changes (high level):
Which issue(s) this PR fixes
Fixes #565