-
Notifications
You must be signed in to change notification settings - Fork 6
Finalize typing on ctl.schema #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## develop #451 +/- ##
========================================
Coverage 75.56% 75.56%
========================================
Files 100 100
Lines 8790 8790
Branches 1716 1716
========================================
Hits 6642 6642
Misses 1669 1669
Partials 479 479
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
WalkthroughReferences to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
a47231e
to
8e357b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
infrahub_sdk/ctl/schema.py (1)
176-176
: Good defensive programming with null safety.The
response or {}
pattern provides a safe fallback when response might be None, preventing potential issues indisplay_schema_load_errors
.Consider adding test coverage for this edge case where
response
could be None, as indicated by the static analysis warning.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
infrahub_sdk/ctl/schema.py
(6 hunks)pyproject.toml
(0 hunks)
💤 Files with no reviewable changes (1)
- pyproject.toml
🧰 Additional context used
🪛 GitHub Check: codecov/patch
infrahub_sdk/ctl/schema.py
[warning] 176-176: infrahub_sdk/ctl/schema.py#L176
Added line #L176 was not covered by tests
🔇 Additional comments (6)
infrahub_sdk/ctl/schema.py (6)
39-39
: LGTM! Consistent attribute access.The change from
.content
to.payload
aligns with the SchemaFile interface and improves consistency across the codebase.
51-51
: Excellent type safety improvement.Updated the parameter type from
list[dict]
tolist[SchemaFile]
which provides better type checking and aligns with the actual usage in the function.
90-90
: Direct dictionary access is safe in this context.The change from
.get("errors")
to["errors"]
is appropriate since theelif "errors" in response
condition above guarantees the key exists.
100-102
: Consistent typing and attribute access improvements.The function signature now properly types the parameter as
list[SchemaFile]
and consistently uses.payload
to access schema data. These changes improve type safety and maintain consistency with the SchemaFile interface.
125-125
: Consistent payload access in load function.The change from
.content
to.payload
maintains consistency with the SchemaFile interface refactoring throughout the module.
173-173
: Consistent payload access in check function.The change from
.content
to.payload
follows the same pattern as other functions and maintains consistency with the SchemaFile interface.
Deploying infrahub-sdk-python with
|
Latest commit: |
8e357b9
|
Status: | ✅ Deploy successful! |
Preview URL: | https://40ccd39f.infrahub-sdk-python.pages.dev |
Branch Preview URL: | https://pog-ctl-schema-typing-202506.infrahub-sdk-python.pages.dev |
Summary by CodeRabbit
Refactor
Chores