Refactor anchor handling when reading dependencies.yaml - #148
Conversation
Preserve more information about anchors and let the handler decide whether or not to descend into an anchor reference. In the future, this will allow us to update the `cuda_suffixed` and `use_cuda_wheels` checks to descent into anchor references. For now, keep them as they are.
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change introduces typed YAML anchor definitions and references. Package traversal now propagates anchor metadata to handlers. Alpha specification and CUDA dependency handlers skip reference-anchored packages, preserve anchor names, and add coverage for definitions, references, and anchored package collections. ChangesAnchor-aware package validation
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/rapids_pre_commit_hooks/alpha_spec.py`:
- Around line 58-68: Update AlphaSpecHandler.__init__ to declare a None return
type, and replace the Any annotation on handle_packages parameter
common_or_matrices_item_context with object to satisfy Ruff while accepting all
values.
In `@tests/rapids_pre_commit_hooks/utils/test_yaml.py`:
- Around line 85-86: Replace the parameter-name list literals with tuples in all
affected pytest.mark.parametrize decorators:
tests/rapids_pre_commit_hooks/utils/test_yaml.py lines 85-86;
tests/rapids_pre_commit_hooks/utils/test_dependencies_yaml.py lines 181-182 and
240-241; tests/rapids_pre_commit_hooks/test_alpha_spec.py lines 137-138 and
168-176; and tests/rapids_pre_commit_hooks/dependencies/test_use_cuda_wheels.py
lines 435-436 and 527-534. Preserve each decorator’s existing parameter names
and test data unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: e31796d2-ed69-4c52-beb5-a173c743bd4b
📒 Files selected for processing (10)
src/rapids_pre_commit_hooks/alpha_spec.pysrc/rapids_pre_commit_hooks/dependencies/cuda_suffixed.pysrc/rapids_pre_commit_hooks/dependencies/use_cuda_wheels.pysrc/rapids_pre_commit_hooks/utils/dependencies_yaml.pysrc/rapids_pre_commit_hooks/utils/yaml.pytests/rapids_pre_commit_hooks/dependencies/test_cuda_suffixed.pytests/rapids_pre_commit_hooks/dependencies/test_use_cuda_wheels.pytests/rapids_pre_commit_hooks/test_alpha_spec.pytests/rapids_pre_commit_hooks/utils/test_dependencies_yaml.pytests/rapids_pre_commit_hooks/utils/test_yaml.py
|
@coderabbitai We don't typically use docstrings in this repository. We generally only use them for complex functions that may not be self-evident to the reader. |
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
You are interacting with an AI system. |
|
/merge |
Preserve more information about anchors and let the handler decide whether or not to descend into an anchor reference. In the future, this will allow us to update the
cuda_suffixedanduse_cuda_wheelschecks to descent into anchor references. For now, keep them as they are.Also check for the new
constraintsoutput type from DFG 1.22.0.