fix(json/get_value): enhance get_path_value_from_dict with wildcard support#269
fix(json/get_value): enhance get_path_value_from_dict with wildcard support#269
Conversation
…upport This is to fix get_value not being able to do `*.somevalue` and some other cases.
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the get_path_value_from_dict function to properly support wildcard patterns (e.g., *.somevalue, items.*.name) by consolidating duplicate implementations from the JSON and Kubernetes providers into a unified implementation in the common module.
Key Changes:
- Implemented a new recursive wildcard-aware path traversal algorithm that handles
*at any position in the path - Consolidated duplicate path traversal logic from JSON and Kubernetes handlers into
providers/common.py - Modified YAML input loading to return lists directly instead of wrapping them in a
{"yamls": [...]}structure
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tirith/providers/common.py | Added comprehensive wildcard-aware path traversal implementation with documentation |
| src/tirith/providers/json/handler.py | Removed local implementation in favor of common implementation |
| src/tirith/providers/kubernetes/handler.py | Removed local implementation and updated to use direct list input structure |
| src/tirith/core/core.py | Changed YAML loading to return raw list/dict instead of wrapped structure |
| tests/providers/test_common.py | Added comprehensive test suite covering wildcard patterns, nested structures, and edge cases |
| tests/providers/kubernetes/test_attribute.py | Added integration test for Kubernetes wildcard attribute path support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



This is to fix get_value not being able to do
*.somevalueand some other cases.