Skip to content

Add draft provider capability schema#634

Draft
marblom007 wants to merge 1 commit intomasterfrom
provider-capabilities-schema
Draft

Add draft provider capability schema#634
marblom007 wants to merge 1 commit intomasterfrom
provider-capabilities-schema

Conversation

@marblom007
Copy link
Copy Markdown
Member

Summary

Moves the new v1beta1 cloud/provider capability schema out of PR #629 into a separate draft for naming and public API review.

Notes

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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!

This pull request introduces a new v1beta1 OpenAPI schema for Meshery Cloud provider capabilities. Its primary purpose is to establish a dedicated draft for the schema, allowing for focused review and discussion on its naming conventions and overall public API design, separate from a larger, ongoing development effort.

Highlights

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. 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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new OpenAPI schema for provider capabilities in v1beta1. The schema is generally well-structured, but there are several areas for improvement to enhance clarity, validation, and maintainability. My review focuses on adding missing property descriptions, defining empty object schemas, using appropriate types and formats for fields like URIs and version strings, and clarifying ambiguous property definitions.

type:
type: string
allowedTo:
type: object
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The allowedTo property is defined as an empty object, which is ambiguous for clients. Please define its properties. If the structure is not yet finalized, a description indicating this and that it's a placeholder for future properties would be helpful. If it's intended to be a flexible key-value map, consider using additionalProperties: true.

          type: object
          description: "Permissions for this item. Structure to be defined."

Comment on lines +150 to +170
properties:
title:
type: string
onClickCallback:
type: integer
href:
$ref: "#/components/schemas/CapabilityNavigatorExtensionHref"
component:
type: string
icon:
type: string
link:
type: boolean
show:
type: boolean
type:
type: string
allowedTo:
type: object
isBeta:
type: boolean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Many properties within CapabilityNavigatorExtension (and other schemas in this file) lack description fields. For example, it's unclear what onClickCallback, component, icon, and type represent. Adding descriptions is crucial for API clarity and maintainability, making it easier for developers to understand and use the API correctly.

Comment on lines +153 to +154
onClickCallback:
type: integer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The property onClickCallback has type integer, which is an unusual type for a "callback". Please add a description to clarify what this integer represents (e.g., an ID). If it's meant to be a function name, string would be a more appropriate type. This also applies to CapabilityAccountExtension.

Comment on lines +176 to +177
uri:
type: string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The uri property should have format: uri to enable better validation and tooling support. This also applies to the uri property in CapabilityAccountExtensionHref.

        uri:
          type: string
          format: uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant