Skip to content

Update organization schema#600

Open
hortison wants to merge 1 commit intomasterfrom
feat/org-schema-update
Open

Update organization schema#600
hortison wants to merge 1 commit intomasterfrom
feat/org-schema-update

Conversation

@hortison
Copy link
Copy Markdown
Contributor

Summary

  • align Organization schema with meshery-cloud Go models
  • add invite_id, payload schemas, and dashboard layout requirements
  • loosen logo/location to match persisted metadata

Signed-off-by: hortison <160366376+hortison@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 23, 2026 22:24
@welcome
Copy link
Copy Markdown

welcome bot commented Jan 23, 2026

Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, you can find updates in the #github-notifications channel in the community Slack.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while performing a commit.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @hortison, 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 refines the organization schema to achieve better alignment with the meshery-cloud Go models. It introduces new, more granular payload schemas for elements like logos, themes, and preferences, providing a structured approach for data handling. Additionally, it loosens the requirements for several fields within the core Organization schema and adds an invite_id field, reflecting a more flexible and comprehensive data model.

Highlights

  • Schema Alignment: The Organization schema has been updated to align more closely with meshery-cloud Go models, including the addition of x-go-type directives for better Go language integration.
  • New Payload Schemas: Introduced several new payload schemas: LogoPayload, ThemePayload, PreferencesPayload, and OrganizationPayload to provide structured data definitions for various organization-related operations and preferences.
  • Relaxed Required Fields: The Organization schema now has fewer required fields, making id, country, region, description, owner, created_at, and updated_at optional. Similarly, svg in Location and id/logo in Theme are no longer strictly required.
  • Dashboard Layout Requirement: The DashboardPrefs schema has been updated to explicitly require a layout object, ensuring a consistent structure for dashboard preferences.
  • New invite_id Field: An invite_id field has been added to the Organization schema, allowing for tracking of organization invitations.
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.

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.

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 updates the organization schema to align with meshery-cloud Go models. The changes include making several fields in Organization, Location, and Theme optional, adding an invite_id to the Organization model, and introducing new payload schemas (LogoPayload, ThemePayload, PreferencesPayload, OrganizationPayload) for creation and update operations. The schema for DashboardPrefs is also updated to include a required layout property.

The changes are well-aligned with the summary provided. I've added a suggestion to improve consistency in the schema definitions by explicitly defining the Go type for object properties with additionalProperties, similar to how it was done for Theme.vars.

Comment on lines +176 to +177
type: object
additionalProperties: true
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

For consistency and to be explicit about the generated Go type, it's good practice to add x-go-type: "map[string]interface{} to properties that are free-form objects. This matches the change made to Theme.vars.

          type: object
          additionalProperties: true
          x-go-type: "map[string]interface{}"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Organization schema to align with meshery-cloud Go models by loosening validation requirements and adding support for invitations and dashboard layout preferences.

Changes:

  • Reduced required fields for Organization (only name and metadata remain required), Theme (id and logo no longer required), and Location (all requirements removed, svg property removed)
  • Added invite_id field to Organization schema to support invitation tracking
  • Added new payload schemas (LogoPayload, ThemePayload, PreferencesPayload, OrganizationPayload) for API request/response handling
  • Modified DashboardPrefs from flexible additionalProperties to structured schema requiring a layout property

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +172 to +177
required:
- layout
properties:
layout:
type: object
additionalProperties: true
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The DashboardPrefs schema now defines a structured type with a required 'layout' property, but it uses x-go-type: "DashboardPrefs" which references the existing Go model defined as type DashboardPrefs map[string]interface{} (see models/v1beta1/organization/organization.go:32). This creates an inconsistency between the schema definition and the Go type it's supposed to map to.

Either remove the x-go-type annotation to let the code generator create a new struct based on the schema, or align the schema definition with the existing Go type by removing the structured properties and keeping it as additionalProperties: true.

Suggested change
required:
- layout
properties:
layout:
type: object
additionalProperties: true
additionalProperties: true

Copilot uses AI. Check for mistakes.
Comment on lines +130 to 131
x-go-type: "Location"
properties:
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The Location schema removed the 'svg' property but uses x-go-type: "Location" which references the existing Go model that requires both 'svg' and 'location' fields (see models/v1beta1/organization/organization.go:34-38). This creates a mismatch where the schema defines only a 'location' property but the Go type expects both 'svg' and 'location'.

Either add back the 'svg' property to match the existing Go type, or remove the x-go-type annotation to let the code generator create a new struct that matches this schema definition.

Suggested change
x-go-type: "Location"
properties:
x-go-type: "Location"
required:
- svg
- location
properties:
svg:
type: string

Copilot uses AI. Check for mistakes.
Comment on lines 204 to 206
required:
- id
- name
- country
- region
- description
- owner
- metadata
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The Organization schema now only requires 'name' and 'metadata' fields, removing requirements for 'id', 'country', 'region', 'description', 'owner', 'created_at', and 'updated_at'. However, the existing Go model (models/v1beta1/organization/organization.go:69-85) defines these fields as non-nullable/non-pointer types. When the Go code is regenerated from this schema, there will be a breaking change where these fields become optional (pointers). Ensure this aligns with the intended behavior mentioned in the PR description about matching meshery-cloud Go models, and update all code that depends on these fields being non-nil.

Copilot uses AI. Check for mistakes.
Comment on lines 164 to +167
vars:
type: object
additionalProperties: true
x-go-type: "map[string]interface{}"
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The vars property uses x-go-type: "map[string]interface{}" which is appropriate for an object with additionalProperties: true. However, this approach should be applied consistently to DashboardPrefs as well, where the existing Go type is also defined as map[string]interface{} (models/v1beta1/organization/organization.go:32).

Copilot uses AI. Check for mistakes.
$ref: "#/components/schemas/PreferencesPayload"
invite_id:
$ref: "#/components/schemas/UUID"
nullable: true
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The OrganizationPayload schema includes an 'invite_id' field (line 384-386), but there's no corresponding 'invite_id' field in the existing Organization Go model (models/v1beta1/organization/organization.go:69-85). While this field is being added to the Organization schema (lines 254-258), ensure that when the Go code is regenerated, both the Organization entity and OrganizationPayload will properly include this field with consistent nullable semantics.

Suggested change
nullable: true

Copilot uses AI. Check for mistakes.
Comment on lines 158 to 160
properties:
id:
type: string
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The Theme schema removed requirements for 'id' and 'logo' fields. However, the existing Go model (models/v1beta1/organization/organization.go:139-144) defines both fields as non-nullable (non-pointer types). When Go code is regenerated from this schema, these fields will become optional pointers, which is a breaking change. Additionally, the Logo schema still requires all four location properties (desktop_view, mobile_view, dark_desktop_view, dark_mobile_view), so even though logo is now optional on Theme, if provided it must be complete. Verify this matches the intended behavior from the PR description about loosening logo/location requirements.

Copilot uses AI. Check for mistakes.
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.

2 participants