-
Notifications
You must be signed in to change notification settings - Fork 6
Add menu validate command to validate the format of menu files.
#363
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
Conversation
Deploying infrahub-sdk-python with
|
| Latest commit: |
247d209
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://deb29408.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://dga-20250416-fix-menu-cmd.infrahub-sdk-python.pages.dev |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop #363 +/- ##
===========================================
+ Coverage 73.77% 73.91% +0.14%
===========================================
Files 92 92
Lines 8498 8536 +38
Branches 1664 1676 +12
===========================================
+ Hits 6269 6309 +40
+ Misses 1791 1781 -10
- Partials 438 446 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
LGTM, though I'd need some clafification regarding the MenuFile class.
|
|
||
| def validate_content(self) -> None: | ||
| super().validate_content() | ||
| InfrahubFile.validate_content(self) |
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.
Why are we making this change? Swapping from inheriting from InfrahubFile and moving to ObjectFile instead but we override the spec method from ObjectFile completely and then call the .validate_content on InfrahubFile I assume to avoid using the one from ObjectFile. Am I missing something here?
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.
I agree this isn't ideal, and it calls for a larger redesign / cleaned of the ObjectFile / YamlFile / MenuFile but I think this is a larger effort and I would prefer to manage that separately
I will open a dedicated issue to track that
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.
Sounds good to me
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.
|
|
||
| @app.command() | ||
| @catch_exception(console=console) | ||
| async def validate( |
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.
Would be nice with a unit test even if it's just for the failure scenario
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.
Good point, I added some unit tests
… be a generic Add `menu validate` command to validate the format of menu files.
f53022d to
247d209
Compare
and a few fixes and cleanup following the changes on
object loadcommand