Move object commands into own package#935
Conversation
The CRUD command files (create, delete, get, update) and their shared utilities lived in a generic "commands" directory that didn't convey what they were for. Since they all belong to the "infrahubctl object" subgroup, it makes sense to colocate them as an "object" package. Test files follow the same restructuring.
WalkthroughThis pull request refactors the CLI architecture from a centralized 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying infrahub-sdk-python with
|
| Latest commit: |
40aa0a3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d4f39c73.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://gma-20260409-refactor-object.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## develop #935 +/- ##
===========================================
+ Coverage 75.59% 81.10% +5.50%
===========================================
Files 134 131 -3
Lines 13252 10918 -2334
Branches 2306 1653 -653
===========================================
- Hits 10018 8855 -1163
+ Misses 2585 1514 -1071
+ Partials 649 549 -100
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 44 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dev/knowledge/cli-architecture.md (1)
24-24: Optional wording polish for sentence repetition.Line 24 starts with “For …” in a sequence that reads slightly repetitive; a small rephrase would improve flow.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/knowledge/cli-architecture.md` at line 24, Reword the sentence at line 24 to avoid starting with "For" after the previous sentence; e.g., rephrase the phrase that mentions subcommands and where to place them so it reads smoothly while preserving the examples "infrahub_sdk/ctl/object/" and "__init__.py" (object subcommands live in that package and are registered on the object app in __init__.py). Ensure the meaning stays identical but change the sentence structure to reduce repetition and improve flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@dev/knowledge/cli-architecture.md`:
- Line 24: Reword the sentence at line 24 to avoid starting with "For" after the
previous sentence; e.g., rephrase the phrase that mentions subcommands and where
to place them so it reads smoothly while preserving the examples
"infrahub_sdk/ctl/object/" and "__init__.py" (object subcommands live in that
package and are registered on the object app in __init__.py). Ensure the meaning
stays identical but change the sentence structure to reduce repetition and
improve flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8ff3d26-d833-4123-8951-603f75cc3d8b
📒 Files selected for processing (16)
dev/knowledge/cli-architecture.mdinfrahub_sdk/ctl/commands/__init__.pyinfrahub_sdk/ctl/object/__init__.pyinfrahub_sdk/ctl/object/create.pyinfrahub_sdk/ctl/object/delete.pyinfrahub_sdk/ctl/object/get.pyinfrahub_sdk/ctl/object/update.pyinfrahub_sdk/ctl/object/utils.pytests/unit/ctl/object/__init__.pytests/unit/ctl/object/test_create.pytests/unit/ctl/object/test_delete.pytests/unit/ctl/object/test_get.pytests/unit/ctl/object/test_update.pytests/unit/ctl/object/test_utils.pytests/unit/ctl/schema/__init__.pytests/unit/ctl/schema/test_schema.py
💤 Files with no reviewable changes (1)
- infrahub_sdk/ctl/commands/init.py
| """Command modules for the ``infrahub`` end-user CLI.""" | ||
|
|
||
| from __future__ import annotations |
Why & What
The CRUD command files (create, delete, get, update) and their shared utilities lived in a generic "commands" directory that didn't convey what they were for. Since they all belong to the "infrahubctl object" subgroup, it makes sense to colocate them as an "object" package.
Test files follow the same restructuring.
Checklist
uv run towncrier create ...)Summary by CodeRabbit