Verify config precedence invariant (#291)#327
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideRefactors and strengthens configuration path precedence testing by moving explicit precedence tests into a dedicated module, exhaustively enumerating selector combinations (CLI, NETSUKE_CONFIG, NETSUKE_CONFIG_PATH), and adding both example-based and property-based tests to ensure the invariant that higher-priority selectors always win, while plugging two missing integration cases. Flow diagram for config selector precedence invariantflowchart TD
A[Start config selection] --> B{--config present?}
B -->|yes| C[Use CLI --config path]
B -->|no| D{NETSUKE_CONFIG present?}
D -->|yes| E[Use NETSUKE_CONFIG path]
D -->|no| F{NETSUKE_CONFIG_PATH present?}
F -->|yes| G[Use NETSUKE_CONFIG_PATH path]
F -->|no| H[Use default config path]
C --> I[Pass selected path to merge_with_config]
E --> I
G --> I
H --> I
I --> J[End config selection]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Add an exhaustive selector matrix for `--config`, `NETSUKE_CONFIG`, and `NETSUKE_CONFIG_PATH`, and express the expected winner as a pure predicate checked by `proptest`. Move the focused precedence tests into their own module so the existing config merge test file stays under the repository line-count limit.
7f861a2 to
c645462
Compare
Summary
Closes #291
--config/NETSUKE_CONFIG/NETSUKE_CONFIG_PATHselector states.proptestpredicate that verifies the highest-priority present selector wins for generated path values.--configwithNETSUKE_CONFIG_PATHand with both config environment variables.Validation
make check-fmtmake lintmake testcoderabbit review --agentexited successfully after setup/status output with no concerns reported.Summary by Sourcery
Verify and enforce the precedence of CLI and environment-based config selectors.
Tests: