-
Notifications
You must be signed in to change notification settings - Fork 1
Add validation for required title and description fields in properties #48
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: main
Are you sure you want to change the base?
Conversation
|
this fix is because if title was not present in the spec properties UI nor the backend threw error stating title is missing and the form never rendered |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 17752 @vishnukv-facets Thank you for the detailed explanation! I can see this is an excellent fix for a critical UX issue. Problem you solved:
Your solution:
Implementation quality:
This will significantly improve the developer experience by catching these issues early with clear feedback instead of silent form rendering failures. ✏️ Learnings added
|
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
|
""" WalkthroughA new recursive validation function is introduced to ensure that all properties in a schema have both Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Utils
User->>CLI: Run YAML validation command
CLI->>Utils: validate_yaml(spec_obj)
Utils->>Utils: Schema validation
Utils->>Utils: check_properties_have_required_fields(spec_obj)
alt All properties valid
Utils-->>CLI: Validation passes
else Missing title/description
Utils-->>CLI: Raise click.UsageError
end
CLI-->>User: Output result or error
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🪧 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 (
|
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ftf_cli/utils.py(2 hunks)tests/test_utils_validation.py(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
ftf_cli/utils.py (1)
Learnt from: vishnukv-facets
PR: Facets-cloud/module-development-cli#0
File: :0-0
Timestamp: 2025-05-26T13:13:07.039Z
Learning: All user-facing properties in spec must have both 'title' and 'description' fields. Properties with 'x-ui-override-disable': true are considered internal and skip this validation, while properties with 'x-ui-overrides-only': true are still user-facing and require validation. This is enforced by the check_properties_have_required_fields() function in ftf_cli/utils.py.
tests/test_utils_validation.py (1)
Learnt from: vishnukv-facets
PR: Facets-cloud/module-development-cli#0
File: :0-0
Timestamp: 2025-05-26T13:13:07.010Z
Learning: All user-facing properties in spec must have both 'title' and 'description' fields. Properties with 'x-ui-override-disable': true are considered internal and skip this validation, while properties with 'x-ui-overrides-only': true are still user-facing and require validation. This is enforced by the check_properties_have_required_fields() function in ftf_cli/utils.py.
- Introduced a new function `check_properties_have_required_fields` to ensure that all user-facing properties in the spec have both title and description fields. - Updated the `validate_yaml` function to include this new validation check. - Added comprehensive unit tests to cover various scenarios, including missing title, description, and both fields, as well as handling of override-disabled properties.
… objects - Updated `check_properties_have_required_fields` to include a `skip_validation` parameter, allowing validation to be skipped for properties marked with `x-ui-override-disable`. - Added a new test case to ensure that nested properties under override-disabled objects are correctly skipped during validation.
3236cba to
703b2c5
Compare
check_properties_have_required_fieldsto ensure that all user-facing properties in the spec have both title and description fields.validate_yamlfunction to include this new validation check.Summary by CodeRabbit