Code generator scripts refactor; Add credential, role, and schedule construct schemas with Go models#629
Conversation
… Go models
- Add OpenAPI schemas for credential, role, schedule, and capability constructs
under schemas/constructs/v1beta1/{construct}/api.yml
- Generate Go models for credential, role, schedule, and capability packages
under models/v1beta1/{construct}/ with db struct tags for Pop ORM
- Extend design/api.yml (pattern package) with cloud-specific paths
(x-internal: ["cloud"]) merged from the former pattern/api.yml
- Update pattern Go model with db tags and additional type aliases
These types serve as the canonical source of truth for meshery-cloud to
import instead of maintaining duplicate local struct definitions.
Summary of ChangesHello, 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 significantly enhances the Meshery Cloud API and data models by introducing new OpenAPI schemas and their corresponding Go models for core constructs like credentials, roles, schedules, and capabilities. The primary goal is to establish a single source of truth for shared types, enabling Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces OpenAPI schemas and corresponding Go models for credential, role, schedule, and capability. It also expands the design schema with new cloud-specific endpoints. The changes are extensive and foundational for standardizing types.
My review focuses on the new schema definitions and helper functions. I've identified a few issues in the required fields of the new schemas, where server-generated fields like id, created_at, and user_id are incorrectly marked as required from the client. This would cause issues with resource creation endpoints. I've also suggested an improvement in error handling in one of the new Go helper files.
Overall, this is a significant and valuable contribution to making meshery/schemas the single source of truth for shared types.
There was a problem hiding this comment.
Pull request overview
Adds new v1beta1 construct OpenAPI specs and corresponding Go types to make Meshery Cloud’s credential/role/schedule/capability models shared via meshery/schemas, and extends the design (pattern) API with cloud-internal endpoints.
Changes:
- Added OpenAPI
api.ymlspecs for credential, role, schedule, and capability constructs (cloud-internal endpoints). - Expanded
design/api.ymlwith cloud-specific pattern endpoints and shared parameters/responses. - Added/updated Go model packages under
models/v1beta1/*to match the new/updated specs.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/constructs/v1beta1/credential/api.yml | New credential endpoints and schemas, including db tags and paging model |
| schemas/constructs/v1beta1/role/api.yml | New role/keychain/holder APIs and schemas, including mapping and paging |
| schemas/constructs/v1beta1/schedule/api.yml | New schedule APIs and schemas |
| schemas/constructs/v1beta1/capability/api.yml | New capability handshake API and schemas |
| schemas/constructs/v1beta1/design/api.yml | Expanded design/pattern API surface for cloud-internal endpoints |
| models/v1beta1/credential/credential.go | Generated Credential and CredentialPage Go types |
| models/v1beta1/credential/helpers.go | Adds EventCategory hook for Credential |
| models/v1beta1/role/role.go | Generated Role-related Go types |
| models/v1beta1/role/helpers.go | Adds EventCategory and String helper for Role |
| models/v1beta1/schedule/schedule.go | Generated Schedule and SchedulePage Go types |
| models/v1beta1/schedule/helpers.go | Adds EventCategory hook for Schedule |
| models/v1beta1/capability/capability.go | Generated Capability Go types |
| models/v1beta1/pattern/pattern.go | Adds additional type aliases in the pattern package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- credential/api.yml: move DELETE to /credentials/{id} path param (was query param)
- credential/api.yml: use core created_at/updated_at $refs; drop redundant x-oapi-codegen-extra-tags
- role/api.yml: remove id/created_at/updated_at from Role required list (server-managed fields)
- role/api.yml: use core created_at/updated_at $refs for Role and RolesKeychainsMapping
- role/api.yml: rename getKeyChains → getKeychains, unAssignKeychainFromRole → unassignKeychainFromRole
- schedule/api.yml: add required list to SchedulePage (page, page_size, total_count, schedules)
- schedule/api.yml: use core created_at/updated_at $refs; drop redundant x-oapi-codegen-extra-tags
- design/api.yml: add root-level security: [{jwt: []}] block
- credential/helpers.go: fix EventCategory to return "credential" (was "connection")
- role/helpers.go: handle json.Marshal error in String() method
- Remove generated Go model files from commit per AGENTS.md (auto-generated by build pipeline)
Signed-off-by: Lee Calcote <leecalcote@gmail.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces new OpenAPI schemas and corresponding Go models for credential, role, schedule, and capability constructs, which is a great step towards a unified type system. The changes also expand the design API.
My review has identified a few critical issues. A core file (pattern.go) is removed, which will break the build due to existing dependencies. Additionally, there are inconsistencies in the new schemas, particularly around required fields for resource creation (id, created_at, updated_at), which could lead to issues for API clients. Please see the detailed comments for suggestions on how to resolve these.
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
…com/meshery/schemas into add-credential-role-schedule-models
|
/gemini review |
Added a comprehensive design document outlining the implementation of schema-backed validation methods for Meshery's entity types. This document addresses validation architecture, dependency management, and proposed solutions for integrating validation into the Meshery ecosystem. Signed-off-by: Lee Calcote <lee.calcote@layer5.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
… Go models
- Add OpenAPI schemas for credential, role, schedule, and capability constructs
under schemas/constructs/v1beta1/{construct}/api.yml
- Generate Go models for credential, role, schedule, and capability packages
under models/v1beta1/{construct}/ with db struct tags for Pop ORM
- Extend design/api.yml (pattern package) with cloud-specific paths
(x-internal: ["cloud"]) merged from the former pattern/api.yml
- Update pattern Go model with db tags and additional type aliases
These types serve as the canonical source of truth for meshery-cloud to
import instead of maintaining duplicate local struct definitions.
Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
- credential/api.yml: move DELETE to /credentials/{id} path param (was query param)
- credential/api.yml: use core created_at/updated_at $refs; drop redundant x-oapi-codegen-extra-tags
- role/api.yml: remove id/created_at/updated_at from Role required list (server-managed fields)
- role/api.yml: use core created_at/updated_at $refs for Role and RolesKeychainsMapping
- role/api.yml: rename getKeyChains → getKeychains, unAssignKeychainFromRole → unassignKeychainFromRole
- schedule/api.yml: add required list to SchedulePage (page, page_size, total_count, schedules)
- schedule/api.yml: use core created_at/updated_at $refs; drop redundant x-oapi-codegen-extra-tags
- design/api.yml: add root-level security: [{jwt: []}] block
- credential/helpers.go: fix EventCategory to return "credential" (was "connection")
- role/helpers.go: handle json.Marshal error in String() method
- Remove generated Go model files from commit per AGENTS.md (auto-generated by build pipeline)
Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: Lee Calcote <lee.calcote@layer5.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: Lee Calcote <lee.calcote@layer5.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: Lee Calcote <lee.calcote@layer5.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Bumps [minimatch](https://github.com/isaacs/minimatch) from 10.1.1 to 10.2.4. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v10.1.1...v10.2.4) --- updated-dependencies: - dependency-name: minimatch dependency-version: 10.2.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: meshery <ci@meshery.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: Raunak Madan <143412156+CodexRaunak@users.noreply.github.com> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
…ct information for Meshery components Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: meshery <ci@meshery.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
Signed-off-by: meshery <ci@meshery.io> Signed-off-by: marblom007 <158522975+marblom007@users.noreply.github.com>
...i-schema-best-practices-workspace/iteration-1/eval-build-pipeline/without_skill/grading.json
Outdated
Show resolved
Hide resolved
Move agent config update and skill evaluation workspace to a separate PR to keep this branch focused on schema and code generator changes.
Code reviewFound 1 issue:
schemas/models/v1beta1/component/component.go Lines 96 to 97 in 8443a2d Schema source of truth: schemas/schemas/constructs/v1beta1/component/component.yaml Lines 76 to 82 in 8443a2d Generator root cause: schemas/build/generate-golang.js Lines 340 to 344 in 8443a2d 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…cated event category methods Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
There was a problem hiding this comment.
Pull request overview
Refactors the schema-driven code generation pipeline (Go + TypeScript) to use construct source schemas as the primary input, adds new v1beta1 constructs (credential/role/schedule), and updates schemas/models to keep downstream Meshery consumers compatible with regenerated types.
Changes:
- Added new v1beta1 construct schemas for
credential,role, andschedule, plus corresponding generated Go models/helpers. - Normalized
$refentrypoints to constructapi.yml#/components/...and made cross-package Go import aliases explicit via schema metadata. - Updated generators/config (Go helper generation + TypeScript schema export typing) and regenerated/adjusted Go models accordingly.
Reviewed changes
Copilot reviewed 76 out of 119 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/constructs/v1beta1/team/team.yaml | Switches deleted_at to core nullTime reference (removes manual Go type/import overrides). |
| schemas/constructs/v1beta1/team/api.yml | Normalizes auth scheme casing, retargets time refs to named core schemas, adds DB tags for mapping fields. |
| schemas/constructs/v1beta1/subscription/api.yml | Adds explicit Go import alias to stabilize generated cross-package type references. |
| schemas/constructs/v1beta1/schedule/api.yml | Introduces new Schedule construct OpenAPI surface + schemas. |
| schemas/constructs/v1beta1/role/api.yml | Introduces new Role construct OpenAPI surface + schemas. |
| schemas/constructs/v1beta1/model/model.yaml | Normalizes refs to construct api.yml entrypoints and adds explicit Go import aliases. |
| schemas/constructs/v1beta1/model/api.yml | Removes unnecessary allOf wrappers and inlines/normalizes Model schema fields. |
| schemas/constructs/v1beta1/keychain/api.yml | Normalizes item $ref to local component schema anchor. |
| schemas/constructs/v1beta1/key/api.yml | Normalizes item $ref to local component schema anchor. |
| schemas/constructs/v1beta1/feature/api.yml | Adds explicit Go import alias for plan reference. |
| schemas/constructs/v1beta1/evaluation/api.yml | Retargets design refs to design api.yml and stabilizes Go import aliasing. |
| schemas/constructs/v1beta1/environment/environment.yaml | Switches deleted_at to core nullTime reference (removes manual Go type/import overrides). |
| schemas/constructs/v1beta1/design/design.yaml | Restores pointer-slice contract via x-go-type and normalizes item refs. |
| schemas/constructs/v1beta1/design/api.yml | Expands design endpoints, adds security/responses/params blocks, stabilizes cross-package Go imports. |
| schemas/constructs/v1beta1/credential/api.yml | Introduces new Credential construct OpenAPI surface + schemas. |
| schemas/constructs/v1beta1/connection/connection.yaml | Normalizes deleted_at to nullTime, stabilizes env item ref + Go import alias. |
| schemas/constructs/v1beta1/component/component.yaml | Normalizes refs to model api.yml schemas and stabilizes type imports/aliases. |
| schemas/constructs/v1beta1/academy/api.yml | Replaces deep refs with named reusable schemas; stabilizes invitation imports and adds typed helper schemas. |
| schemas/constructs/v1alpha3/relationship/relationship.yaml | Stabilizes model/capability cross-package import aliasing. |
| schemas/constructs/v1alpha1/core/api.yml | Fixes semver description bounds/text. |
| models/v1beta1/workspace/workspace.go | Regenerates model types to use core v1alpha1 primitives instead of stdlib/sql/uuid/time types. |
| models/v1beta1/user/zz_generated.helpers.go | Adds generated scan/value helpers and event category for user package. |
| models/v1beta1/user/user.go | Updates user models to use core v1alpha1 primitives and stabilizes nested config structures. |
| models/v1beta1/user/helpers.go | Removes hand-written helpers superseded by generated helpers. |
| models/v1beta1/team/zz_generated.helpers.go | Adds generated event category for team package. |
| models/v1beta1/team/team_helper.go | Removes hand-written event category helper superseded by generated helper. |
| models/v1beta1/team/team.go | Regenerates model types to use core v1alpha1 primitives and updates generated param aliases. |
| models/v1beta1/subscription/zz_generated.helpers.go | Adds generated event category for subscription package. |
| models/v1beta1/subscription/subscription.go | Regenerates subscription models; adjusts enum constant names and updates plan import aliasing. |
| models/v1beta1/subscription/helpers.go | Adds deprecated constant aliases for renamed PaymentProcessor values. |
| models/v1beta1/schedule/zz_generated.helpers.go | Adds generated event category for schedule package. |
| models/v1beta1/schedule/schedule.go | Adds generated schedule models from new Schedule construct. |
| models/v1beta1/role/zz_generated.helpers.go | Adds generated event category for role package. |
| models/v1beta1/role/role.go | Adds generated role models from new Role construct. |
| models/v1beta1/role/helpers.go | Adds Role stringer helper. |
| models/v1beta1/plan/zz_generated.helpers.go | Adds generated event category for plan package. |
| models/v1beta1/plan/plan.go | Regenerates plan model to use core v1alpha1 UUID. |
| models/v1beta1/plan/helpers.go | Removes hand-written event category helper superseded by generated helper. |
| models/v1beta1/pattern/pattern.go | Updates pattern models and cross-package imports/types after schema refactor and regen. |
| models/v1beta1/pattern/evaluation_models.go | Renames imported core alias and updates schemaVersion type. |
| models/v1beta1/pattern/design_conversion.go | Updates conversion logic for regenerated component/model types. |
| models/v1beta1/organization/zz_generated.helpers.go | Adds generated json scan/value helpers and event category for organization package. |
| models/v1beta1/organization/organization.go | Regenerates organization models to use core v1alpha1 primitives and replaces inline structs with named types. |
| models/v1beta1/organization/helpers.go | Removes hand-written scan/value + event helpers superseded by generated helper. |
| models/v1beta1/model/model.go | Regenerates model definitions to use core v1alpha1 primitives and normalized schema shapes/types. |
| models/v1beta1/keychain/zz_generated.helpers.go | Adds generated header to helpers file. |
| models/v1beta1/keychain/keychain.go | Regenerates keychain models to use core v1alpha1 primitives; updates generated param aliases. |
| models/v1beta1/key/zz_generated.helpers.go | Adds generated header to helpers file. |
| models/v1beta1/key/key.go | Regenerates key models to use core v1alpha1 primitives; updates generated param aliases. |
| models/v1beta1/invitation/invitation.go | Updates invitation to use core v1alpha1 UUID types. |
| models/v1beta1/feature/feature.go | Updates feature model to use core v1alpha1 primitives and plan import aliasing. |
| models/v1beta1/event/event.go | Updates event request UUID slices to use core v1alpha1 UUID type. |
| models/v1beta1/evaluation/evaluation.go | Updates evaluation to depend on pattern v1beta1 import alias and typed item declarations. |
| models/v1beta1/environment/zz_generated.helpers.go | Adds generated event category for environment package. |
| models/v1beta1/environment/environment_helper.go | Removes hand-written event category helper superseded by generated helper. |
| models/v1beta1/environment/environment.go | Regenerates environment models to use core v1alpha1 primitives and updates generated param aliases. |
| models/v1beta1/credential/zz_generated.helpers.go | Adds generated event category for credential package. |
| models/v1beta1/credential/credential.go | Adds generated credential models from new Credential construct. |
| models/v1beta1/connection/zz_generated.helpers.go | Adds generated event categories for connection types. |
| models/v1beta1/connection/connection_helper.go | Fixes Create() to pass correct pointer type; adds deprecated enum constant aliases. |
| models/v1beta1/connection/connection.go | Regenerates connection models to use core v1alpha1 primitives; introduces ConnectionPage status/type changes. |
| models/v1beta1/component/component_helper.go | Aligns Styles alias to core type + updates SVG replacement logic. |
| models/v1beta1/category/category.go | Updates category to use core v1alpha1 UUID type. |
| models/v1beta1/badge/badge.go | Updates badge to use core v1alpha1 UUID/time primitives. |
| models/v1beta1/academy/zz_generated.helpers.go | Adds generated scan/value helpers for map-backed types. |
| models/v1beta1/academy/helpers.go | Removes hand-written scan/value helpers superseded by generated helper. |
| models/v1beta1/academy/academy.go | Regenerates academy models to use core v1alpha1 primitives and stabilizes invitation import aliasing. |
| models/v1alpha3/relationship/relationship_helper.go | Adds deprecated type/const aliases to preserve compatibility with renamed generated types. |
| models/v1alpha3/relationship/relationship.go | Updates relationship models to use core v1alpha1 primitives; renames patch types and stabilizes model import aliasing. |
| models/v1alpha1/core/core.go | Regenerates core types/enums; consolidates enums and tightens semantic string types. |
| models/v1alpha1/capability/capability.go | Updates capability fields to use core v1alpha1 string/version primitives; removes older enum type. |
| build/openapi.config.yml | Empties base import-mapping in favor of generator-derived reachable-$ref mapping. |
| build/lib/generated-go-helpers.js | Adds generator for per-package Go helper files (scan/value + event category). |
| build/generate-typescript.js | Changes TS schema constant typing mechanism from as const to satisfies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Refactors the schema→Go/TypeScript generation pipeline to treat construct source schemas as the source of truth, adds new v1beta1 constructs (credential/role/schedule), and normalizes $ref boundaries/import aliases to keep generated Go models compatible with downstream Meshery consumers.
Changes:
- Added v1beta1 construct schemas for
credential,role, andschedule(OpenAPI specs + generated Go models/helpers). - Normalized many schema references to construct
api.yml#/components/...entrypoints and stabilized Go import aliases viax-go-type-import.name. - Updated generated Go models and introduced a generator-driven helpers mechanism (
zz_generated.helpers.go) for EventCategory + Scan/Value helpers.
Reviewed changes
Copilot reviewed 76 out of 119 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/constructs/v1beta1/team/team.yaml | Switch deleted_at to nullTime ref for consistent nullability modeling. |
| schemas/constructs/v1beta1/team/api.yml | Normalize security scheme casing and align timestamps/DB tags with core refs. |
| schemas/constructs/v1beta1/subscription/api.yml | Stabilize plan import alias (planv1beta1) for deterministic generated code. |
| schemas/constructs/v1beta1/schedule/api.yml | Add new Schedule construct schema (paths + Schedule/SchedulePage schemas). |
| schemas/constructs/v1beta1/role/api.yml | Add new Role construct schema (role assignment APIs + schemas). |
| schemas/constructs/v1beta1/model/model.yaml | Normalize refs to construct api.yml entrypoints and add explicit Go import aliases. |
| schemas/constructs/v1beta1/model/api.yml | Remove unnecessary allOf wrappers and inline/clarify request fields. |
| schemas/constructs/v1beta1/keychain/api.yml | Normalize intra-doc $ref to #/components/schemas/.... |
| schemas/constructs/v1beta1/key/api.yml | Normalize intra-doc $ref to #/components/schemas/.... |
| schemas/constructs/v1beta1/feature/api.yml | Stabilize plan import alias (planv1beta1) for deterministic generated code. |
| schemas/constructs/v1beta1/evaluation/api.yml | Normalize design ref to design/api.yml#/... and stabilize Go import alias. |
| schemas/constructs/v1beta1/environment/environment.yaml | Switch deleted_at to nullTime ref for consistent nullability modeling. |
| schemas/constructs/v1beta1/design/design.yaml | Restore pointer-slice intent via x-go-type + explicit import aliasing. |
| schemas/constructs/v1beta1/design/api.yml | Expand design REST surface and stabilize catalog import aliasing. |
| schemas/constructs/v1beta1/credential/api.yml | Add new Credential construct schema (CRUD-like endpoints + schemas). |
| schemas/constructs/v1beta1/connection/connection.yaml | Normalize deleted_at + environment refs and stabilize env import alias. |
| schemas/constructs/v1beta1/component/component.yaml | Normalize model/capability refs and stabilize cross-package import aliases. |
| schemas/constructs/v1beta1/academy/api.yml | Replace deep refs with named schemas; stabilize invitation import alias. |
| schemas/constructs/v1alpha3/relationship/relationship.yaml | Stabilize model/capability import aliases for deterministic generation. |
| schemas/constructs/v1alpha1/core/api.yml | Fix semver string description / constraints consistency. |
| models/v1beta1/workspace/workspace.go | Migrate primitives to core-v1alpha1 strong types (Uuid/Time/Text/etc). |
| models/v1beta1/user/zz_generated.helpers.go | Add generated Scan/Value + EventCategory helpers for Preference/User. |
| models/v1beta1/user/user.go | Move to core v1alpha1 types and factor SelectedGrafanaConfig types. |
| models/v1beta1/user/helpers.go | Remove handwritten duplicates now generated into zz_generated.helpers.go. |
| models/v1beta1/team/zz_generated.helpers.go | Generate Team EventCategory helper. |
| models/v1beta1/team/team_helper.go | Remove handwritten Team EventCategory (now generated). |
| models/v1beta1/team/team.go | Move to core v1alpha1 strong types and generated alias types. |
| models/v1beta1/subscription/zz_generated.helpers.go | Generate Subscription EventCategory helper. |
| models/v1beta1/subscription/subscription.go | Update plan import aliasing and consolidate payment processor constants. |
| models/v1beta1/subscription/helpers.go | Add deprecated constant aliases to preserve prior exported names. |
| models/v1beta1/schedule/zz_generated.helpers.go | Generate Schedule EventCategory helper. |
| models/v1beta1/schedule/schedule.go | Add generated Go models for schedule construct. |
| models/v1beta1/role/zz_generated.helpers.go | Generate Role EventCategory helper. |
| models/v1beta1/role/role.go | Add generated Go models for role construct. |
| models/v1beta1/role/helpers.go | Add Role String() helper. |
| models/v1beta1/plan/zz_generated.helpers.go | Generate Plan EventCategory helper. |
| models/v1beta1/plan/plan.go | Move plan ID to core v1alpha1 Uuid type. |
| models/v1beta1/plan/helpers.go | Remove handwritten Plan EventCategory (now generated). |
| models/v1beta1/pattern/pattern.go | Update pattern models to new core types and cross-package imports. |
| models/v1beta1/pattern/evaluation_models.go | Rename core import alias for clarity and remove stray whitespace. |
| models/v1beta1/pattern/design_conversion.go | Adjust conversion logic for regenerated types and pointer semantics. |
| models/v1beta1/organization/zz_generated.helpers.go | Generate OrgMetadata Scan/Value + Organization EventCategory. |
| models/v1beta1/organization/organization.go | Migrate to core v1alpha1 strong types; reduce inline anonymous structs. |
| models/v1beta1/organization/helpers.go | Remove handwritten helpers replaced by generated ones. |
| models/v1beta1/model/model.go | Migrate model types to strong core types + stabilized imports; simplify unions. |
| models/v1beta1/keychain/zz_generated.helpers.go | Add generated header and keep EventCategory helper. |
| models/v1beta1/keychain/keychain.go | Migrate keychain primitives to core v1alpha1 types. |
| models/v1beta1/key/zz_generated.helpers.go | Add generated header and keep EventCategory helper. |
| models/v1beta1/key/key.go | Migrate key primitives to core v1alpha1 types. |
| models/v1beta1/invitation/invitation.go | Migrate invitation UUID types to core v1alpha1 Uuid. |
| models/v1beta1/feature/feature.go | Stabilize plan import alias and migrate primitives to core v1alpha1 types. |
| models/v1beta1/event/event.go | Migrate event bulk request IDs to core v1alpha1 Uuid. |
| models/v1beta1/evaluation/evaluation.go | Stabilize pattern import alias and strengthen action payload types. |
| models/v1beta1/environment/zz_generated.helpers.go | Generate Environment EventCategory helper. |
| models/v1beta1/environment/environment_helper.go | Remove handwritten Environment EventCategory (now generated). |
| models/v1beta1/environment/environment.go | Migrate environment primitives to core v1alpha1 types; normalize schemaVersion typing. |
| models/v1beta1/credential/zz_generated.helpers.go | Generate Credential EventCategory helper. |
| models/v1beta1/credential/credential.go | Add generated Go models for credential construct. |
| models/v1beta1/connection/zz_generated.helpers.go | Generate Connection + MesheryInstance EventCategory helpers. |
| models/v1beta1/connection/connection_helper.go | Fix GORM create call and add deprecated status constant aliases. |
| models/v1beta1/connection/connection.go | Migrate primitives to core v1alpha1 types and expand ConnectionPage shape constants. |
| models/v1beta1/component/component_helper.go | Align Styles alias with core type and harden SVG replacement conditions. |
| models/v1beta1/category/category.go | Migrate category ID to core v1alpha1 Uuid. |
| models/v1beta1/badge/badge.go | Migrate badge IDs/timestamps to core v1alpha1 types. |
| models/v1beta1/academy/zz_generated.helpers.go | Generate Scan/Value helpers for Map-backed quiz structs. |
| models/v1beta1/academy/helpers.go | Remove handwritten Scan/Value helpers replaced by generated ones. |
| models/v1beta1/academy/academy.go | Migrate to core v1alpha1 types, stabilize invitation alias, and reduce inline structs. |
| models/v1alpha3/relationship/relationship_helper.go | Add deprecated type/const aliases to preserve older exported names. |
| models/v1alpha3/relationship/relationship.go | Migrate to core types, normalize patch types, and rework metadata/style enums. |
| models/v1alpha1/core/core.go | Consolidate enum constant names and adjust shared scalar aliases (e.g., Endpoint). |
| models/v1alpha1/capability/capability.go | Migrate fields to core scalar types and tighten schemaVersion/semver typing. |
| build/openapi.config.yml | Make base import-mapping empty; rely on generator-derived mappings. |
| build/lib/generated-go-helpers.js | Add generator for zz_generated.helpers.go (EventCategory + Scan/Value helpers). |
| build/generate-typescript.js | Emit TS schemas with satisfies Record<string, unknown> to keep builds reliable. |
Comments suppressed due to low confidence (1)
models/v1beta1/subscription/subscription.go:1
- The JSON/YAML tags for
Subscription.IDareID(uppercase), which is inconsistent with the rest of the models (json:"id") and is very likely to break API serialization/deserialization expectations for consumers. Adjust the schema/generator so the serialized field name isid(lowercase), while keeping the Go field nameID.
// Package subscription provides primitives to interact with the openapi HTTP API.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Tracking the exact Per decision, PR #629 should not carry a partial repo-wide |
There was a problem hiding this comment.
Pull request overview
Refactors the schema-driven Go/TypeScript generation workflow and introduces new v1beta1 construct schemas (credential, role, schedule), while updating existing schemas/models to preserve compatibility for downstream Meshery consumers.
Changes:
- Added new construct OpenAPI specs for
credential,role, andscheduleand generated corresponding Go models/helpers. - Normalized many construct
$reftargets to use constructapi.yml#/components/...entrypoints and added explicit Go import aliases for deterministic generation. - Updated generated Go models to use shared
corev1alpha1scalar/types (Uuid, Time, SemverString, etc.) and moved repetitive helper methods into generatedzz_generated.helpers.gofiles.
Reviewed changes
Copilot reviewed 76 out of 119 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/constructs/v1beta1/team/team.yaml | Switches deleted_at to shared nullTime schema reference. |
| schemas/constructs/v1beta1/team/api.yml | Normalizes bearer scheme casing; aligns timestamps to core created_at / updated_at; adds db tags. |
| schemas/constructs/v1beta1/subscription/api.yml | Makes plan import alias explicit for deterministic Go generation. |
| schemas/constructs/v1beta1/schedule/api.yml | Adds new Schedule REST surface and schemas. |
| schemas/constructs/v1beta1/role/api.yml | Adds new Role REST surface and schemas. |
| schemas/constructs/v1beta1/model/model.yaml | Normalizes refs to construct API entrypoints; makes import aliases explicit. |
| schemas/constructs/v1beta1/model/api.yml | Removes unnecessary allOf; replaces deep property refs with inline schema definitions. |
| schemas/constructs/v1beta1/keychain/api.yml | Normalizes keychain item refs to schema component entrypoint. |
| schemas/constructs/v1beta1/key/api.yml | Normalizes key item refs to schema component entrypoint. |
| schemas/constructs/v1beta1/feature/api.yml | Makes plan import alias explicit for deterministic Go generation. |
| schemas/constructs/v1beta1/evaluation/api.yml | Updates design refs to construct API entrypoints; makes pattern import alias explicit. |
| schemas/constructs/v1beta1/environment/environment.yaml | Switches deleted_at to shared nullTime schema reference. |
| schemas/constructs/v1beta1/design/design.yaml | Adjusts component/relationship list typing and refs to preserve pointer-slice semantics. |
| schemas/constructs/v1beta1/design/api.yml | Adds a large set of Cloud design endpoints and shared components. |
| schemas/constructs/v1beta1/credential/api.yml | Adds new Credential REST surface and schemas. |
| schemas/constructs/v1beta1/connection/connection.yaml | Switches deleted_at to nullTime; normalizes environment ref; makes env import alias explicit. |
| schemas/constructs/v1beta1/component/component.yaml | Normalizes model/capability refs; makes import aliases explicit. |
| schemas/constructs/v1beta1/academy/api.yml | Replaces brittle deep refs with named reusable schemas; adds explicit invitation import alias. |
| schemas/constructs/v1alpha3/relationship/relationship.yaml | Makes model/capability import aliases explicit; normalizes model refs. |
| schemas/constructs/v1alpha1/core/api.yml | Fixes semver description text/length mismatch. |
| models/v1beta1/workspace/workspace.go | Moves workspace scalars to shared corev1alpha1 types. |
| models/v1beta1/user/zz_generated.helpers.go | Adds generated Scan/Value + EventCategory helpers for user models. |
| models/v1beta1/user/user.go | Switches to shared corev1alpha1 types; refactors selected nested types. |
| models/v1beta1/user/helpers.go | Removes handwritten Scan/Value + EventCategory now generated elsewhere. |
| models/v1beta1/team/zz_generated.helpers.go | Adds generated EventCategory helper for Team. |
| models/v1beta1/team/team_helper.go | Removes handwritten EventCategory helper now generated elsewhere. |
| models/v1beta1/team/team.go | Switches to shared corev1alpha1 types and regenerated aliases. |
| models/v1beta1/subscription/zz_generated.helpers.go | Adds generated EventCategory helper for Subscription. |
| models/v1beta1/subscription/subscription.go | Switches to shared core types; consolidates payment processor enums; updates plan import alias. |
| models/v1beta1/subscription/helpers.go | Adds deprecated compatibility constants for renamed PaymentProcessor values. |
| models/v1beta1/schedule/zz_generated.helpers.go | Adds generated EventCategory helper for Schedule. |
| models/v1beta1/schedule/schedule.go | Adds generated Schedule models using shared core types. |
| models/v1beta1/role/zz_generated.helpers.go | Adds generated EventCategory helper for Role. |
| models/v1beta1/role/role.go | Adds generated Role models using shared core types. |
| models/v1beta1/role/helpers.go | Adds Role.String helper. |
| models/v1beta1/plan/zz_generated.helpers.go | Adds generated EventCategory helper for Plan. |
| models/v1beta1/plan/plan.go | Switches plan ID to shared corev1alpha1.Uuid. |
| models/v1beta1/plan/helpers.go | Removes handwritten EventCategory helper now generated elsewhere. |
| models/v1beta1/pattern/pattern.go | Updates pattern model types/import aliases; modifies component/relationship collection types. |
| models/v1beta1/pattern/evaluation_models.go | Renames import alias and updates schema version type reference. |
| models/v1beta1/pattern/design_conversion.go | Updates conversion logic to match regenerated types and avoid pointer pitfalls. |
| models/v1beta1/organization/zz_generated.helpers.go | Adds generated JSON Scan/Value + EventCategory helpers for Organization. |
| models/v1beta1/organization/organization.go | Switches organization scalars to shared corev1alpha1 types and aliases. |
| models/v1beta1/organization/helpers.go | Removes handwritten helpers now generated elsewhere; reserves file for package-specific helpers. |
| models/v1beta1/model/model.go | Refactors unions and types to use shared core scalars; normalizes imported model references. |
| models/v1beta1/keychain/zz_generated.helpers.go | Adds generated header to helper file. |
| models/v1beta1/keychain/keychain.go | Switches keychain scalars to shared corev1alpha1 types and aliases. |
| models/v1beta1/key/zz_generated.helpers.go | Adds generated header to helper file. |
| models/v1beta1/key/key.go | Switches key scalars to shared corev1alpha1 types and aliases. |
| models/v1beta1/invitation/invitation.go | Switches invitation IDs to shared corev1alpha1.Uuid. |
| models/v1beta1/feature/feature.go | Switches feature scalars to shared core types; updates plan import alias. |
| models/v1beta1/event/event.go | Switches bulk request IDs to shared corev1alpha1.Uuid. |
| models/v1beta1/evaluation/evaluation.go | Updates pattern import alias and uses typed declarations in ops. |
| models/v1beta1/environment/zz_generated.helpers.go | Adds generated EventCategory helper for Environment. |
| models/v1beta1/environment/environment_helper.go | Removes handwritten EventCategory helper now generated elsewhere. |
| models/v1beta1/environment/environment.go | Switches environment scalars to shared core types; updates deleted_at typing. |
| models/v1beta1/credential/zz_generated.helpers.go | Adds generated EventCategory helper for Credential. |
| models/v1beta1/credential/credential.go | Adds generated Credential models using shared core types and core Map. |
| models/v1beta1/connection/zz_generated.helpers.go | Adds generated EventCategory helpers for Connection and MesheryInstance. |
| models/v1beta1/connection/connection_helper.go | Adjusts Create() db call; adds deprecated compatibility constants for renamed status values. |
| models/v1beta1/connection/connection.go | Switches connection scalars to shared core types; changes ConnectionPage shape/types. |
| models/v1beta1/component/component_helper.go | Aligns Styles alias with core ComponentStyles; refines SVG replacement conditions. |
| models/v1beta1/category/category.go | Switches category ID to shared corev1alpha1.Uuid. |
| models/v1beta1/badge/badge.go | Switches badge scalars to shared core types. |
| models/v1beta1/academy/zz_generated.helpers.go | Adds generated Scan/Value helpers for map-backed types. |
| models/v1beta1/academy/helpers.go | Removes handwritten Scan/Value helpers now generated elsewhere. |
| models/v1beta1/academy/academy.go | Aligns academy types/aliases with new named schemas and shared core types. |
| models/v1alpha3/relationship/relationship_helper.go | Adds deprecated type/constant aliases for renamed generated symbols. |
| models/v1alpha3/relationship/relationship.go | Switches IDs/scalars to shared core types; renames/reshapes selector patch types; adds arrow-shape enum. |
| models/v1alpha1/core/core.go | Consolidates some enums; changes Endpoint alias; normalizes Shapes; prunes redundant union variant. |
| models/v1alpha1/capability/capability.go | Switches string fields to shared core scalar types; uses core semver/schemaVersion types. |
| build/openapi.config.yml | Clears base import-mapping and documents generator-owned augmentation. |
| build/lib/generated-go-helpers.js | Adds generator for per-package zz_generated.helpers.go (event category + Scan/Value helpers). |
| build/generate-typescript.js | Changes schema constant typing to use satisfies Record<string, unknown>. |
Comments suppressed due to low confidence (1)
models/v1beta1/subscription/subscription.go:1
- Using
corev1alpha1.SqlNullTimeforDeletedAtis likely to serialize as a struct ({\"Time\":...,\"Valid\":...}) rather than the intended timestamp-or-null shape used elsewhere (many other models usecorev1alpha1.NullTime). IfSqlNullTimeis an alias ofdatabase/sql.NullTime, this will be a breaking API behavior for JSON/YAML. Prefercorev1alpha1.NullTime(or ensure the chosen null-time type implements the desired JSON/YAML marshaling consistently).
// Package subscription provides primitives to interact with the openapi HTTP API.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Refactors schema-driven Go/TypeScript generation and introduces new v1beta1 construct schemas (credential, role, schedule) while normalizing $refs and updating generated Go models/helpers to maintain downstream compatibility.
Changes:
- Added new v1beta1 construct OpenAPI specs for credential, role, and schedule, plus supporting generated models/helpers.
- Normalized construct
$refentrypoints towardapi.yml#/components/...and made Go import aliases deterministic viax-go-type-import.name. - Updated generated Go models/helpers across multiple packages (IDs/timestamps/types, helper generation, compatibility aliases).
Reviewed changes
Copilot reviewed 76 out of 119 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/constructs/v1beta1/team/team.yaml | Switches deleted_at to core nullTime schema reference. |
| schemas/constructs/v1beta1/team/api.yml | Normalizes JWT bearer scheme casing; aligns timestamp refs/tags. |
| schemas/constructs/v1beta1/subscription/api.yml | Makes plan import alias explicit for deterministic Go generation. |
| schemas/constructs/v1beta1/schedule/api.yml | Adds schedule construct OpenAPI schema and endpoints. |
| schemas/constructs/v1beta1/role/api.yml | Adds role construct OpenAPI schema and endpoints. |
| schemas/constructs/v1beta1/model/model.yaml | Normalizes refs to api.yml#/components/... and pins Go import aliases. |
| schemas/constructs/v1beta1/model/api.yml | Removes unnecessary allOf wrapper; replaces deep refs with explicit schemas. |
| schemas/constructs/v1beta1/keychain/api.yml | Avoids local-file $ref in favor of #/components/schemas/.... |
| schemas/constructs/v1beta1/key/api.yml | Avoids local-file $ref in favor of #/components/schemas/.... |
| schemas/constructs/v1beta1/feature/api.yml | Makes plan import alias explicit for deterministic Go generation. |
| schemas/constructs/v1beta1/evaluation/api.yml | Normalizes design refs and uses pinned import alias for pattern types. |
| schemas/constructs/v1beta1/environment/environment.yaml | Switches deleted_at to core nullTime schema reference. |
| schemas/constructs/v1beta1/design/design.yaml | Forces pointer-slice Go types and explicit import aliases for items. |
| schemas/constructs/v1beta1/design/api.yml | Adds/expands Cloud endpoints and normalizes referenced types/import aliases. |
| schemas/constructs/v1beta1/credential/api.yml | Adds credential construct OpenAPI schema and endpoints. |
| schemas/constructs/v1beta1/connection/connection.yaml | Switches deleted_at to nullTime; normalizes environment refs/import aliasing. |
| schemas/constructs/v1beta1/component/component.yaml | Normalizes model refs and pins import aliases for cross-package types. |
| schemas/constructs/v1beta1/academy/api.yml | Replaces deep refs with named schemas; pins invitation import alias. |
| schemas/constructs/v1alpha3/relationship/relationship.yaml | Pins model/capability import aliases; normalizes $ref entrypoints. |
| schemas/constructs/v1alpha1/core/api.yml | Fixes semverString description bounds/text. |
| models/v1beta1/workspace/workspace.go | Moves IDs/timestamps/text to shared core types (v1alpha1/core). |
| models/v1beta1/user/zz_generated.helpers.go | Introduces generated scan/value + event category helpers. |
| models/v1beta1/user/user.go | Replaces uuid/time usage with shared core types; restructures nested config types. |
| models/v1beta1/user/helpers.go | Removes handwritten helpers now generated elsewhere. |
| models/v1beta1/team/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/team/team_helper.go | Removes handwritten helper replaced by generated helper. |
| models/v1beta1/team/team.go | Moves IDs/timestamps/text to shared core types; adjusts paging aliases. |
| models/v1beta1/subscription/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/subscription/subscription.go | Renames enum constants; replaces uuid/time/sql types with shared core types + plan alias. |
| models/v1beta1/subscription/helpers.go | Adds deprecated compatibility aliases for renamed constants. |
| models/v1beta1/schedule/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/schedule/schedule.go | Adds generated schedule Go models. |
| models/v1beta1/role/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/role/role.go | Adds generated role Go models. |
| models/v1beta1/role/helpers.go | Adds handwritten String() helper for Role. |
| models/v1beta1/plan/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/plan/plan.go | Switches UUID type to shared core type. |
| models/v1beta1/plan/helpers.go | Removes handwritten helper replaced by generated helper. |
| models/v1beta1/pattern/pattern.go | Updates imports/types to use pinned aliases and shared core types. |
| models/v1beta1/pattern/evaluation_models.go | Renames core import alias for clarity/consistency. |
| models/v1beta1/pattern/design_conversion.go | Updates conversion logic to match regenerated types (pointer/id handling). |
| models/v1beta1/organization/zz_generated.helpers.go | Introduces generated scan/value + event category helpers. |
| models/v1beta1/organization/organization.go | Switches uuid/time/sql types to shared core aliases and reuses named structs. |
| models/v1beta1/organization/helpers.go | Removes handwritten helper implementations now generated elsewhere. |
| models/v1beta1/model/model.go | Refactors types/import aliases; normalizes nested structs; updates semver fields. |
| models/v1beta1/keychain/zz_generated.helpers.go | Marks helper file as generated. |
| models/v1beta1/keychain/keychain.go | Switches uuid/time/sql types to shared core types; normalizes paging aliases. |
| models/v1beta1/key/zz_generated.helpers.go | Marks helper file as generated. |
| models/v1beta1/key/key.go | Switches uuid/time/sql types to shared core types; normalizes paging aliases. |
| models/v1beta1/invitation/invitation.go | Switches UUID types to shared core types. |
| models/v1beta1/feature/feature.go | Switches time/uuid/plan imports to shared core + pinned plan alias. |
| models/v1beta1/event/event.go | Switches UUID arrays to shared core UUID type. |
| models/v1beta1/evaluation/evaluation.go | Pins pattern import alias and strengthens action item types. |
| models/v1beta1/environment/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/environment/environment_helper.go | Removes handwritten helper replaced by generated helper. |
| models/v1beta1/environment/environment.go | Switches IDs/timestamps/text to shared core types; aligns schemaVersion type. |
| models/v1beta1/credential/zz_generated.helpers.go | Adds generated EventCategory() helper. |
| models/v1beta1/credential/credential.go | Adds generated credential Go models. |
| models/v1beta1/connection/zz_generated.helpers.go | Adds generated EventCategory() helpers. |
| models/v1beta1/connection/connection_helper.go | Fixes GORM create call; adds deprecated compatibility constants. |
| models/v1beta1/connection/connection.go | Switches IDs/timestamps to shared core types; restructures page responses. |
| models/v1beta1/component/component_helper.go | Updates style type alias and SVG replacement logic to match regenerated style type. |
| models/v1beta1/category/category.go | Switches UUID to shared core UUID type. |
| models/v1beta1/badge/badge.go | Switches UUID/CreatedAt/UpdatedAt to shared core types. |
| models/v1beta1/academy/zz_generated.helpers.go | Adds generated scan/value helpers for JSONB-backed structs. |
| models/v1beta1/academy/helpers.go | Removes handwritten scan/value helpers replaced by generated equivalents. |
| models/v1beta1/academy/academy.go | Pins invitation import alias; switches many IDs/timestamps to shared core types. |
| models/v1alpha3/relationship/relationship_helper.go | Adds deprecated aliases to preserve pre-rename identifiers. |
| models/v1alpha3/relationship/relationship.go | Normalizes core/model/capability types and enum constant naming. |
| models/v1alpha1/core/core.go | Renames several exported constants/types; adjusts Endpoint/Semver docs and UUID usages. |
| models/v1alpha1/capability/capability.go | Replaces several string fields with shared core types (InputString/Semver/VersionString). |
| build/openapi.config.yml | Clears static import-mapping in favor of generator-derived mapping. |
| build/lib/generated-go-helpers.js | Adds generator for package-scoped Go helper methods (scan/value/event category). |
| build/generate-typescript.js | Emits TS schema constants using satisfies Record<string, unknown> for buildability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| path: github.com/meshery/schemas/models/v1beta1/environment | ||
| $ref: ../environment/environment.yaml | ||
| name: environmentv1beta1 | ||
| $ref: ../environment/api.yml#/components/schemas/environment |
build/generate-typescript.js
Outdated
| `const ${pascalName}Schema = ` + | ||
| jsonContent + | ||
| ` as const;\n\nexport default ${pascalName}Schema;\n`; | ||
| ` satisfies Record<string, unknown>;\n\nexport default ${pascalName}Schema;\n`; |
| json: "invite_id" | ||
| yaml: "invite_id" | ||
|
|
||
| AcademyCirriculaWorkspaceId: |
| json: "workspace_id" | ||
| yaml: "workspace_id" | ||
|
|
||
| AcademyCirriculaCreatedAt: |
| json: "created_at" | ||
| yaml: "created_at" | ||
|
|
||
| AcademyCirriculaUpdatedAt: |
| json: "updated_at" | ||
| yaml: "updated_at" | ||
|
|
||
| AcademyCirriculaDeletedAt: |
| json: "deleted_at" | ||
| yaml: "deleted_at" | ||
|
|
||
| AcademyCirriculaMetadata: |
There was a problem hiding this comment.
Pull request overview
Refactors schema-driven code generation (Go + TypeScript) to use source construct schemas as the source of truth, adds new v1beta1 constructs (credential/role/schedule), and applies schema/model compatibility adjustments for downstream Meshery consumers.
Changes:
- Added new v1beta1 construct OpenAPI schemas for
credential,role, andschedule, plus normalized several construct$refentrypoints. - Updated multiple schemas to stabilize Go type generation (explicit import aliases, nullTime usage, ref normalization).
- Regenerated/adjusted Go models and introduced generated helper files for Scan/Value + EventCategory methods.
Reviewed changes
Copilot reviewed 77 out of 120 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/constructs/v1beta1/team/team.yaml | Switches deleted_at to core nullTime schema and removes ad-hoc Go type/import overrides. |
| schemas/constructs/v1beta1/team/api.yml | Normalizes bearer scheme casing and aligns created/updated/deleted refs + db tags. |
| schemas/constructs/v1beta1/subscription/api.yml | Makes plan import alias explicit for deterministic cross-package Go generation. |
| schemas/constructs/v1beta1/schedule/api.yml | Introduces schedule construct OpenAPI spec and schemas. |
| schemas/constructs/v1beta1/role/api.yml | Introduces role construct OpenAPI spec and schemas. |
| schemas/constructs/v1beta1/model/model.yaml | Normalizes refs and makes cross-package Go import aliases explicit for model dependencies. |
| schemas/constructs/v1beta1/model/api.yml | Removes unnecessary allOf wrapper and replaces deep property refs with named schema definitions. |
| schemas/constructs/v1beta1/keychain/api.yml | Replaces local file ref with components schema ref for keychain items. |
| schemas/constructs/v1beta1/key/api.yml | Replaces local file ref with components schema ref for key items. |
| schemas/constructs/v1beta1/feature/api.yml | Makes plan import alias explicit for deterministic cross-package Go generation. |
| schemas/constructs/v1beta1/evaluation/api.yml | Normalizes design refs to construct API entrypoint and adds explicit Go import alias. |
| schemas/constructs/v1beta1/environment/environment.yaml | Switches deleted_at to core nullTime schema and removes ad-hoc Go type/import overrides. |
| schemas/constructs/v1beta1/design/design.yaml | Adjusts component/relationship slice typing and ref entrypoints to preserve expected Go shapes. |
| schemas/constructs/v1beta1/design/api.yml | Adds Cloud design REST paths and stabilizes cross-package Go type imports. |
| schemas/constructs/v1beta1/credential/api.yml | Introduces credential construct OpenAPI spec and schemas. |
| schemas/constructs/v1beta1/connection/connection_page.yaml | Sets connections array Go typing intent for pointer-slice. |
| schemas/constructs/v1beta1/connection/connection.yaml | Normalizes deleted_at and environment refs; adds explicit Go import alias for environment. |
| schemas/constructs/v1beta1/component/component.yaml | Normalizes model/capability refs and makes cross-package Go import aliases explicit. |
| schemas/constructs/v1beta1/academy/api.yml | Replaces deep property refs with named schemas and pins invitation import alias. |
| schemas/constructs/v1alpha3/relationship/relationship.yaml | Makes model/capability import aliases explicit for deterministic generation. |
| schemas/constructs/v1alpha1/core/api.yml | Fixes semverString description text and length statement. |
| models/v1beta1/workspace/workspace.go | Updates workspace model types to reuse v1alpha1 core primitives. |
| models/v1beta1/user/zz_generated.helpers.go | Adds generated Scan/Value (Preference) + EventCategory (User). |
| models/v1beta1/user/user.go | Aligns user model field types and nested config types with core primitives and named structs. |
| models/v1beta1/user/helpers.go | Removes handwritten helpers now generated elsewhere. |
| models/v1beta1/team/zz_generated.helpers.go | Adds generated EventCategory (Team). |
| models/v1beta1/team/team_helper.go | Removes handwritten EventCategory now generated elsewhere. |
| models/v1beta1/team/team.go | Aligns team model types with core primitives and updates pagination types. |
| models/v1beta1/subscription/zz_generated.helpers.go | Adds generated EventCategory (Subscription). |
| models/v1beta1/subscription/subscription.go | Consolidates payment processor enums and aligns IDs/timestamps with core primitives. |
| models/v1beta1/subscription/helpers.go | Adds deprecated constant aliases to preserve old PaymentProcessor constant names. |
| models/v1beta1/schedule/zz_generated.helpers.go | Adds generated EventCategory (Schedule). |
| models/v1beta1/schedule/schedule.go | Adds generated schedule Go models from new construct schema. |
| models/v1beta1/role/zz_generated.helpers.go | Adds generated EventCategory (Role). |
| models/v1beta1/role/role.go | Adds generated role Go models from new construct schema. |
| models/v1beta1/role/helpers.go | Adds Role.String() helper for debugging/logging. |
| models/v1beta1/plan/zz_generated.helpers.go | Adds generated EventCategory (Plan). |
| models/v1beta1/plan/plan.go | Aligns plan ID type with v1alpha1 core UUID. |
| models/v1beta1/plan/helpers.go | Removes handwritten EventCategory now generated elsewhere. |
| models/v1beta1/pattern/pattern.go | Updates pattern types/import aliases and refactors embedded structs to named types. |
| models/v1beta1/pattern/evaluation_models.go | Renames core import alias to a stable name used in the file. |
| models/v1beta1/pattern/design_conversion.go | Updates conversion logic to account for regenerated type shapes and pointer semantics. |
| models/v1beta1/organization/zz_generated.helpers.go | Adds generated JSON Scan/Value (OrgMetadata) + EventCategory (Organization). |
| models/v1beta1/organization/organization.go | Aligns org-related types with core primitives and replaces inline structs with named types. |
| models/v1beta1/organization/helpers.go | Removes handwritten Scan/Value/EventCategory now generated elsewhere. |
| models/v1beta1/model/model.go | Stabilizes cross-package imports, replaces inline model struct with named type, and aligns core types. |
| models/v1beta1/keychain/zz_generated.helpers.go | Adds generator header comment for helper file. |
| models/v1beta1/keychain/keychain.go | Aligns keychain types with core primitives and normalizes pagination types. |
| models/v1beta1/key/zz_generated.helpers.go | Adds generator header comment for helper file. |
| models/v1beta1/key/key.go | Aligns key types with core primitives and normalizes pagination types. |
| models/v1beta1/invitation/invitation.go | Aligns invitation UUID types with core primitives. |
| models/v1beta1/feature/feature.go | Aligns feature types with core primitives and stabilizes plan import alias. |
| models/v1beta1/event/event.go | Aligns event bulk ID slices with core UUID type. |
| models/v1beta1/evaluation/evaluation.go | Stabilizes pattern import alias and replaces map items with named schema types. |
| models/v1beta1/environment/zz_generated.helpers.go | Adds generated EventCategory (Environment). |
| models/v1beta1/environment/environment_helper.go | Removes handwritten EventCategory now generated elsewhere. |
| models/v1beta1/environment/environment.go | Aligns environment types with core primitives and normalizes deleted_at handling. |
| models/v1beta1/credential/zz_generated.helpers.go | Adds generated EventCategory (Credential). |
| models/v1beta1/credential/credential.go | Adds generated credential Go models from new construct schema. |
| models/v1beta1/connection/zz_generated.helpers.go | Adds generated EventCategory (Connection/MesheryInstance). |
| models/v1beta1/connection/connection_helper.go | Fixes GORM Create usage and adds deprecated constant aliases for status values. |
| models/v1beta1/connection/connection.go | Aligns core UUID/time types, stabilizes status constants, and reshapes ConnectionPage. |
| models/v1beta1/component/component_helper.go | Updates Styles alias and adjusts SVG replacement logic for new styles type. |
| models/v1beta1/category/category.go | Aligns category ID with core UUID. |
| models/v1beta1/badge/badge.go | Aligns badge UUID/time types with core primitives. |
| models/v1beta1/academy/zz_generated.helpers.go | Adds generated Scan/Value helpers for Map-backed structs. |
| models/v1beta1/academy/helpers.go | Removes handwritten Scan/Value helpers now generated elsewhere. |
| models/v1beta1/academy/academy.go | Stabilizes constants/import aliases and replaces deep refs with named types in Go. |
| models/v1alpha3/relationship/relationship_helper.go | Adds deprecated type/constant aliases to preserve older generated names. |
| models/v1alpha3/relationship/relationship.go | Aligns core UUID/semver types, introduces new typed enums, and reshapes patch/metadata types. |
| models/v1alpha1/core/core.go | Normalizes constant naming, tightens Endpoint alias, and removes large unused union type. |
| models/v1alpha1/capability/capability.go | Aligns capability fields with core primitives and schemaVersion/semver types. |
| build/openapi.config.yml | Clears static import-mapping in favor of generator-derived per-package mappings. |
| build/lib/generated-go-helpers.js | Adds generator for zz_generated.helpers.go (EventCategory + Scan/Value helpers). |
| build/generate-typescript.js | Adjusts schema constant emission to keep buildable while validating shape via satisfies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| // Components A list of one or more component declarations. | ||
| Components []*component.ComponentDefinition `json:"components" yaml:"components"` | ||
| Components []componentv1beta1.ComponentDefinition `json:"components" yaml:"components"` |
|
|
||
| // Relationships List of relationships between components | ||
| Relationships []*relationship.RelationshipDefinition `json:"relationships" yaml:"relationships"` | ||
| Relationships []relationshipv1alpha3.RelationshipDefinition `json:"relationships" yaml:"relationships"` |
| if component == nil { | ||
| continue | ||
| } | ||
|
|
| compStyle := c.Styles | ||
| if compStyle != nil { | ||
| if compStyle.SvgColor != "" { | ||
| svgColor, err := utils.ReadSVGData(baseDir, compStyle.SvgColor) | ||
| if err == nil { | ||
| compStyle.SvgColor = svgColor | ||
| } else { | ||
| return err | ||
| } | ||
| } |
| Connections []struct { | ||
| // Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas. | ||
| Id corev1alpha1.Uuid `json:"id" yaml:"id"` | ||
|
|
||
| // Name Connection Name | ||
| Name string `db:"name" json:"name" yaml:"name"` | ||
|
|
||
| // CredentialId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas. | ||
| CredentialId *corev1alpha1.Uuid `json:"credential_id,omitempty" yaml:"credential_id,omitempty"` | ||
|
|
||
| // Type Connection Type (platform, telemetry, collaboration) | ||
| Type string `db:"type" json:"type" yaml:"type"` | ||
|
|
||
| // SubType Connection Subtype (cloud, identity, metrics, chat, git, orchestration) | ||
| SubType string `db:"sub_type" json:"sub_type" yaml:"sub_type"` | ||
|
|
||
| // Kind Connection Kind (meshery, kubernetes, prometheus, grafana, gke, aws, azure, slack, github) | ||
| Kind string `db:"kind" json:"kind" yaml:"kind"` | ||
|
|
||
| // Metadata Additional connection metadata | ||
| Metadata core.Map `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"` | ||
|
|
||
| // Status Connection Status | ||
| Status ConnectionPageConnectionsStatus `db:"status" json:"status" yaml:"status"` | ||
|
|
||
| // UserId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas. | ||
| UserId *corev1alpha1.Uuid `json:"user_id,omitempty" yaml:"user_id,omitempty"` | ||
| CreatedAt corev1alpha1.Time `json:"created_at,omitempty" yaml:"created_at,omitempty"` | ||
| UpdatedAt corev1alpha1.Time `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` | ||
|
|
||
| // DeletedAt SQL null Timestamp to handle null values of time. | ||
| DeletedAt corev1alpha1.NullTime `json:"deleted_at,omitempty" yaml:"deleted_at,omitempty"` | ||
|
|
||
| // Environments Associated environments for this connection | ||
| Environments []environmentv1beta1.Environment `db:"-" gorm:"-" json:"environments,omitempty" yaml:"environments,omitempty"` | ||
|
|
||
| // SchemaVersion API version of the object, optionally prefixed with an API group (e.g. "group.example.io/v1beta1" or bare "v1beta1"). | ||
| SchemaVersion corev1alpha1.VersionString `json:"schemaVersion" yaml:"schemaVersion"` | ||
| } `json:"connections" yaml:"connections"` | ||
|
|
|
Addressed the latest generator feedback on PR #629 in Changes made:
Validated locally against the PR 629 branch with:
This keeps the exact |
Summary
This PR refactors the Go schema generation workflow to operate from source construct schemas, adds the new
credential,role, andscheduleconstructs for v1beta1, and applies the compatibility fixes required to keep downstream Meshery consumers building against the generated types.Why this PR exists
The repository is moving further toward schemas as the source of truth for shared object models.
This PR does three things that are tightly related:
What changed
1. Refactored Go generation to use source schemas directly
Files:
build/generate-golang.jsbuild/openapi.config.ymlbuild/generate-typescript.jsRationale:
api.yml/ subschema structure instead of relying only on fully bundled output$reftargets at generation timex-oapi-codegen-extra-tags,x-go-name, and explicitx-go-typeoverrides more reliablyx-go-type-import.name, avoiding unstable alias guessing in generated codesatisfies Record<string, unknown>instead ofas constWhy this matters:
2. Added new v1beta1 constructs
Files:
schemas/constructs/v1beta1/credential/api.ymlschemas/constructs/v1beta1/role/api.ymlschemas/constructs/v1beta1/schedule/api.ymlRationale:
3. Normalized schema references onto construct index files
Representative files:
schemas/constructs/v1beta1/component/component.yamlschemas/constructs/v1beta1/connection/connection.yamlschemas/constructs/v1beta1/model/model.yamlschemas/constructs/v1beta1/evaluation/api.ymlschemas/constructs/v1beta1/design/api.ymlschemas/constructs/v1alpha3/relationship/relationship.yamlschemas/constructs/v1beta1/academy/api.ymlRationale:
api.yml#/components/...entrypoints instead of deprecated or fragile deep-path patternsWhy this matters:
4. Restored compatibility for generated Go types after the generator refactor
Representative files:
schemas/constructs/v1beta1/design/design.yamlschemas/constructs/v1beta1/design/api.ymlschemas/constructs/v1beta1/evaluation/api.ymlschemas/constructs/v1beta1/component/component.yamlschemas/constructs/v1beta1/model/model.yamlschemas/constructs/v1beta1/feature/api.ymlschemas/constructs/v1beta1/subscription/api.ymlschemas/constructs/v1beta1/connection/connection.yamlschemas/constructs/v1beta1/academy/api.ymlschemas/constructs/v1alpha3/relationship/relationship.yamlmodels/v1beta1/component/component_helper.gomodels/v1beta1/pattern/design_conversion.gomodels/v1alpha3/relationship/relationship_helper.goRationale:
PatternFile.ComponentsandPatternFile.Relationshipsas pointer slices where downstream Meshery code expects pointer semanticscomponent,relationship,model,connection,feature,subscription,academy, andevaluationWhy this matters:
5. Review-driven scope cleanup
Removed from this PR:
Rationale:
Notable review outcomes addressed here
allOfwrapper churn in the relationship index where the wrapper was not required$refsibling behavior from schedule schema definitionsx-go-typealiases instead of depending on guessed import namesValidation
Validated locally with:
make buildgo test ./...Scope after split
This PR is now focused on:
This PR no longer includes: