-
Notifications
You must be signed in to change notification settings - Fork 50
chore: put default properties of capabilities outside items #313
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
chore: put default properties of capabilities outside items #313
Conversation
Signed-off-by: Nikita B <[email protected]>
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.
Hello @n2h9, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request focuses on improving the structure and default values within the Meshery schemas, specifically related to capabilities and relationship templates. The primary goal is to move default properties of capabilities outside of the items
field in several JSON and YAML schema files. Additionally, a match_strategy_matrix
is added to relationship templates to define how values at mutator/mutated paths should be matched.
Highlights
- Capability Schema Restructuring: The
capabilities
schema incomponent_template.json
,component_template.yaml
,design_template.json
, anddesign_template.yaml
has been modified to move default properties outside theitems
field. This change provides a more direct and clear definition of default capability properties. - Relationship Template Enhancement: The
relationship_template.json
,relationship_template.yaml
,design_template.json
,design_template.yaml
and typescript definitionrelationship.d.ts
are updated to include amatch_strategy_matrix
within thefrom
section. This addition allows for defining specific strategies for matching values at mutator/mutated paths, enhancing relationship definition flexibility. - OpenApi Schema Updates: The OpenApi schema definitions for
ComponentOpenApiSchema.ts
andDesignOpenApiSchema.ts
are updated to reflect the changes in capability schema structure, ensuring consistency across the codebase. TheEvaluationOpenApiSchema.ts
andSchemasOpenApiSchema.ts
are also updated to reflect the change fromservice mesh performance
tocloud native performance
. - Feature OpenApi Schema: A new OpenApi schema definition for
FeatureOpenApiSchema.ts
is added to define the structure for features and entitlements. - Subscription OpenApi Schema: The
SubscriptionOpenApiSchema.ts
is updated to change the description and operationId for getting subscriptions.
Changelog
Click here to see the changelog
- schemas/constructs/v1alpha3/relationship_template.json
- Added
match_strategy_matrix
property within thefrom.items
section to define matching strategies.
- Added
- schemas/constructs/v1alpha3/relationship_template.yaml
- Added
match_strategy_matrix
property within thefrom.items
section to define matching strategies.
- Added
- schemas/constructs/v1beta1/component/component.json
- Moved
x-oapi-codegen-extra-tags
anddefault
properties outside theitems
field for capabilities.
- Moved
- schemas/constructs/v1beta1/component/component_template.json
- Restructured the
capabilities
schema to define default properties directly as an array of capability objects, rather than within anitems
field.
- Restructured the
- schemas/constructs/v1beta1/component/component_template.yaml
- Restructured the
capabilities
schema to define default properties directly as an array of capability objects, rather than within anitems
field.
- Restructured the
- schemas/constructs/v1beta1/design/design_template.json
- Restructured the
capabilities
schema to define default properties directly as an array of capability objects, rather than within anitems
field. - Added
match_strategy_matrix
property within thefrom.items
section to define matching strategies.
- Restructured the
- schemas/constructs/v1beta1/design/design_template.yaml
- Restructured the
capabilities
schema to define default properties directly as an array of capability objects, rather than within anitems
field. - Added
match_strategy_matrix
property within thefrom.items
section to define matching strategies.
- Restructured the
- typescript/constructs/v1alpha3/relationship.d.ts
- Added
match_strategy_matrix
property to theHttpsSchemasMesheryIoRelationshipJson
interface to define matching strategies.
- Added
- typescript/constructs/v1beta1/component/ComponentOpenApiSchema.ts
- Removed the
default
property from within theitems
field for capabilities. - Added
default
property outside theitems
field for capabilities. - Added default values for styling, shape, compound drag and drop, and body text.
- Removed the
- typescript/constructs/v1beta1/design/DesignOpenApiSchema.ts
- Removed the
default
property from within theitems
field for capabilities. - Added
default
property outside theitems
field for capabilities. - Added default values for styling, shape, compound drag and drop, and body text.
- Added
match_strategy_matrix
property within thefrom.items
section to define matching strategies.
- Removed the
- typescript/constructs/v1beta1/feature/FeatureOpenApiSchema.ts
- Added a new OpenApi schema definition for features and entitlements.
- typescript/constructs/v1beta1/subscription/SubscriptionOpenApiSchema.ts
- Updated the description and operationId for getting subscriptions.
- typescript/mnt/space2/code/meshery/schemas/schemas/SchemasOpenApiSchema.ts
- Changed
service mesh performance
tocloud native performance
.
- Changed
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A schema's design,
Can make code truly shine,
With defaults in place,
Elegance and grace,
A system that's truly divine.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This PR aims to refactor the structure of component capabilities and relationship templates in several schema files. The changes seem to be focused on improving the organization and flexibility of these schemas. However, there are some areas where the changes could be improved, such as removing redundant default values and ensuring consistency across different schema versions.
Summary of Findings
- Schema updates: The PR updates several JSON and YAML schema files to modify the structure and default values of component capabilities and relationship templates. The key change involves moving default properties of capabilities outside of the
items
field in component and design templates, and adding amatch_strategy_matrix
to relationship templates. - TypeScript definitions: The TypeScript definitions are updated to reflect the changes in the JSON schemas, particularly the addition of
match_strategy_matrix
in theHttpsSchemasMesheryIoRelationshipJson
interface. - Redundant default values in ComponentOpenApiSchema.ts: The
ComponentOpenApiSchema.ts
file contains redundant default values for capabilities. These default values are defined at multiple places, which can lead to inconsistencies and maintenance issues.
Merge Readiness
The pull request is not yet ready for merging. The redundant default values in ComponentOpenApiSchema.ts
should be addressed to avoid potential inconsistencies. Additionally, the high severity comment about the removal of default values in the same file needs to be resolved. After addressing these issues, the pull request should be reviewed again before merging. I am unable to directly approve this pull request, and users should have others review and approve this code before merging.
"default": [ | ||
{ | ||
"description": "Configure the visual styles for the component", | ||
"displayName": "Styling", | ||
"entityState": [ | ||
"declaration" | ||
], | ||
"key": "", | ||
"kind": "mutate", | ||
"schemaVersion": "capability.meshery.io/v1alpha1", | ||
"status": "enabled", | ||
"subType": "", | ||
"type": "style", | ||
"version": "0.7.0" | ||
}, | ||
{ | ||
"description": "Change the shape of the component", | ||
"displayName": "Change Shape", | ||
"entityState": [ | ||
"declaration" | ||
], | ||
"key": "", | ||
"kind": "mutate", | ||
"schemaVersion": "capability.meshery.io/v1alpha1", | ||
"status": "enabled", | ||
"subType": "shape", | ||
"type": "style", | ||
"version": "0.7.0" | ||
}, | ||
{ | ||
"description": "Drag and Drop a component into a parent component in graph view", | ||
"displayName": "Compound Drag And Drop", | ||
"entityState": [ | ||
"declaration" | ||
], | ||
"key": "", | ||
"kind": "interaction", | ||
"schemaVersion": "capability.meshery.io/v1alpha1", | ||
"status": "enabled", | ||
"subType": "compoundDnd", | ||
"type": "graph", | ||
"version": "0.7.0" | ||
}, | ||
{ | ||
"description": "Add text to nodes body", | ||
"displayName": "Body Text", | ||
"entityState": [ | ||
"declaration" | ||
], | ||
"key": "", | ||
"kind": "mutate", | ||
"schemaVersion": "capability.meshery.io/v1alpha1", | ||
"status": "enabled", | ||
"subType": "body-text", | ||
"type": "style", | ||
"version": "0.7.0" | ||
} | ||
] |
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.
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.
hey, gemi, hello 😇
this is auto generated code
Hey @aabidsofi19 👋 hello 😇 |
Nice catch , yeah this can be replaced by the default for capabilities from component schema |
@n2h9 is this good to merge |
hey @aabidsofi19 hello 👋 |
Notes for Reviewers
This PR fixes #
Signed commits