[CFX-4060] Added support for component data and data defaults #210
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.
RATIONALE
Implements managed component updates with preconfigured answers to enable reproducible component installations with minimal user interaction. This feature follows copier's
data_filesemantics, allowing teams to standardize component configurations and reduce manual input during setup.Key Use Cases:
CHANGES
Core Features
1. Configuration System (
internal/config/component.go)LoadComponentDefaults()with priority-based resolution:--data-filepath (highest priority).datarobot/.copier-answers-defaults.yaml~/.config/datarobot/.copier-answers-defaults.yaml~/.config/datarobot/component-defaults.yamlMergeWithCLIData()to allow CLI flags to override config values2. Enhanced Copier Integration (
internal/copier/exec.go)AddWithData()andUpdateWithData()to pass--dataarguments to copierformatDataValue():[3.10, 3.11, 3.12]{key: value}strconvfor numeric conversions3. CLI Commands
--data key=valueflag (repeatable) to bothcomponent addandcomponent update--data-file pathflag for explicit config file pathDocumentation
docs/commands/component-managed-updates.mddocs/examples/.copier-answers-defaults.yamldocs/component-defaults-example.yamlTesting
New Test Suites (63 test cases total):
TestParseDataArgs- Data argument parsing with various types and formatsTestConfigHierarchy- Configuration file priority orderTestMergeWithCLIData- CLI override behavior with lists and mapsTestFormatDataValue- All copier data types including multiselectTestFormatYAMLList- List formatting for multiselect questionsTestFormatYAMLMap- Map formatting for complex objectsTESTING