Skip to content

Enforce exact id fields as ID#637

Merged
fitzergerald merged 9 commits intomasterfrom
enforce-exact-id-field-consistency
Mar 18, 2026
Merged

Enforce exact id fields as ID#637
fitzergerald merged 9 commits intomasterfrom
enforce-exact-id-field-consistency

Conversation

@miacycle
Copy link
Copy Markdown
Member

@miacycle miacycle commented Mar 18, 2026

Summary

  • make exact id fields generate as ID by default in the Go generator
  • regenerate the affected Go surfaces locally to validate the normalization pass
  • update handwritten code in schemas and schema-authored GORM references so the generated ID fields remain consistent end to end

Why This Exists

This is the dedicated follow-up for exact id field normalization.

The long-term canonical Go policy should be ID for exact id fields, but that is a repo-wide breaking normalization pass. It should not be smuggled into PR #629 while that branch is already carrying generator refactors and new construct additions.

PR #629 should keep the new cloud-facing constructs aligned with current downstream usage. This PR is the separate, once-and-for-all normalization pass.

Scope

This PR does the follow-up work that should live outside PR #629:

  • make the generator emit ID for exact id fields by default
  • update handwritten code in schemas that referenced .Id
  • fix schema-declared GORM references like references:Id where needed
  • validate the result against schemas
  • validate the downstream impact against local meshery-cloud / meshkit

Validation

  • go test ./... in schemas
  • focused package validation for affected helper/conversion packages
  • local Go regeneration via node build/generate-golang.js
  • downstream compile check surfaced the expected meshkit follow-up at registry.go where model.ModelDefinition{Id: ...} still needs to move to ID

Notes

Copilot AI review requested due to automatic review settings March 18, 2026 21:47
@github-actions github-actions Bot added the area/ci Continuous integration | Build and release label Mar 18, 2026
@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 focuses on enhancing consistency and maintainability within the codebase by standardizing the naming convention for identifier fields. It introduces changes to the Go model generation process to automatically enforce ID for all id fields, reducing manual overrides and potential discrepancies. Concurrently, existing handwritten code and schema definitions are updated to reflect this new standard, ensuring seamless integration and correct data mapping across the application. These changes improve the robustness of the generated code and simplify future development by adhering to a unified identifier naming scheme.

Highlights

  • Go Generator Updates: The Go generator has been enhanced to automatically enforce the use of ID for all id fields, standardizing naming conventions across generated Go models. This includes new logic for intelligent import alias selection and robust struct tag manipulation.
  • Codebase Refactoring for ID Fields: Handwritten helper functions and conversion logic across various models packages (v1alpha3/relationship, v1beta1/category, v1beta1/component, v1beta1/model, v1beta1/pattern) have been updated to consistently use the new ID field instead of Id.
  • Schema Alignment: GORM references within component.yaml and model.yaml schemas have been updated to align with the new ID field name, ensuring database foreign key relationships correctly map to the standardized ID field. Additionally, the model field in component.yaml is now explicitly required and its Go type is updated to a pointer.
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 enforces the Go convention of using ID for fields named id by modifying the Go code generator. It also introduces several enhancements to the generator script, including improved import alias management and more reliable struct tag handling. The related Go helper files and schema definitions have been updated accordingly. The changes are well-aligned with the goal of standardizing the codebase. I have one suggestion regarding code duplication in the generator script to improve maintainability.

Comment thread build/generate-golang.js
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

Updates the Go model generation pipeline and handwritten schema helpers to consistently use ID (instead of Id) for exact id fields, while aligning GORM relationship tags and improving generator output stability.

Changes:

  • Updated schema-authored GORM tags to reference ID and adjusted component schema typing/required fields.
  • Updated Go conversion/helper code to use ID fields and handle Model as a pointer where applicable.
  • Enhanced the Go generator to prefer readable import aliases, enforce idID field naming, and add post-generation validations/compat aliases.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
schemas/constructs/v1beta1/model/model.yaml GORM reference tag updated to use references:ID.
schemas/constructs/v1beta1/component/component.yaml Model field now uses pointer x-go-type, GORM references:ID, and model added to required.
models/v1beta1/pattern/design_conversion.go Switched to ID fields; guarded nil Model; updated to pointer ModelDefinition.
models/v1beta1/model/model_helper.go Switched helper logic from Id to ID, including update queries.
models/v1beta1/component/component_helper.go Switched to ID; added nil-model handling; updated entity detail formatting.
models/v1beta1/category/category_helper.go Switched from Id to ID in helpers/CRUD.
models/v1alpha3/relationship/relationship_helper.go Switched from Id to ID in helpers/CRUD.
build/generate-golang.js Enforced idID naming, improved import alias selection, tag replacement, and added validations/compat aliasing.

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

Comment thread schemas/constructs/v1beta1/component/component.yaml Outdated
Comment thread schemas/constructs/v1beta1/component/component.yaml
Comment thread build/generate-golang.js
Comment thread build/generate-golang.js
Comment thread build/generate-golang.js
Comment thread models/v1beta1/component/component_helper.go Outdated
Comment thread models/v1beta1/component/component_helper.go Outdated
@miacycle miacycle requested a review from Copilot March 18, 2026 21:59
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 Go model generation pipeline to consistently map OpenAPI properties named exactly id to Go struct fields named ID, and then adjusts schema-authored tags and handwritten Go helpers/conversion code to match the new generated field name.

Changes:

  • Enforce idID in the Go generator (and strengthen post-processing/validation around tags and import aliases).
  • Update construct schema GORM references: from Id to ID, and align component model typing/tags/requiredness.
  • Update handwritten helper/conversion code to use ID fields instead of Id.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
build/generate-golang.js Enforces idID, improves tag rewriting, resolves refs for tag extraction, rewrites/validates import aliases, and adds parameter alias compatibility.
build/generate-typescript.js Emits JSON-schema TS exports with as const satisfies ... for stronger typing.
schemas/constructs/v1beta1/model/model.yaml Updates schema-authored GORM reference to references:ID.
schemas/constructs/v1beta1/component/component.yaml Adjusts model field Go typing/tags and updates GORM reference to references:ID; makes model required.
models/v1beta1/pattern/design_conversion.go Switches conversions to use ID fields and guards component.Model access.
models/v1beta1/model/model_helper.go Updates helper methods/queries to use ID.
models/v1beta1/component/component_helper.go Updates helper methods to use ID and adds nil-model handling/errors.
models/v1beta1/category/category_helper.go Updates helper methods to use ID.
models/v1alpha3/relationship/relationship_helper.go Updates helper methods to use ID.
package-lock.json Lockfile changes (peer/dependency metadata churn).

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

Comment thread models/v1beta1/component/component_helper.go
Comment thread models/v1beta1/model/model_helper.go
Comment thread models/v1beta1/category/category_helper.go
Comment thread models/v1alpha3/relationship/relationship_helper.go
Comment thread build/generate-golang.js
Comment thread models/v1beta1/pattern/design_conversion.go
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 Go/TypeScript generation pipeline and schema/model surfaces to normalize exact id fields to Go ID, refresh import alias handling, and align schema-authored tags/refs (notably GORM references:ID) so the ID normalization remains consistent end-to-end.

Changes:

  • Update Go generator post-processing to force exact idID, improve tag rewriting, and prefer readable import aliases (plus add parameter alias compatibility).
  • Update schema-authored tags/refs (e.g., GORM references:Idreferences:ID) and make component.model required/nonnull in generated clients.
  • Regenerate/adjust multiple Go and TypeScript artifacts to reflect the new normalization and aliasing behavior.

Reviewed changes

Copilot reviewed 32 out of 65 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
typescript/rtk/meshery.ts Makes model required in evaluation request/response types; updates version field docstrings.
typescript/rtk/cloud.ts Makes model required in pattern/design request/response types; updates version field docstrings.
typescript/generated/v1beta1/workspace/WorkspaceSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/user/UserSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/team/TeamSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/subscription/SubscriptionSchema.ts Updates plan Go import aliasing metadata; emits as const satisfies ....
typescript/generated/v1beta1/subcategory/SubcategorySchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/schedule/ScheduleSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/role/RoleSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/plan/PlanSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/pattern/Pattern.ts Makes model required across relevant payload shapes; updates version docstrings.
typescript/generated/v1beta1/organization/OrganizationSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/model/ModelSchema.ts Flattens semver schema shapes; updates multiple x-go-type-import aliases; emits as const satisfies ....
typescript/generated/v1beta1/model/Model.ts Updates version field docstrings.
typescript/generated/v1beta1/keychain/KeychainSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/key/KeySchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/invitation/InvitationSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/feature/FeatureSchema.ts Updates plan Go import aliasing metadata; emits as const satisfies ....
typescript/generated/v1beta1/event/EventSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/evaluation/Evaluation.ts Makes model required; updates version docstrings.
typescript/generated/v1beta1/environment/EnvironmentSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/credential/CredentialSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/connection/ConnectionSchema.ts Updates environment Go import aliasing metadata; emits as const satisfies ....
typescript/generated/v1beta1/component/ComponentSchema.ts Makes model required; updates GORM refs to ID; updates x-go-type-import aliases; emits as const satisfies ....
typescript/generated/v1beta1/component/Component.ts Makes model required; updates version docstrings.
typescript/generated/v1beta1/category/CategorySchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/badge/BadgeSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1beta1/academy/AcademySchema.ts Updates invitation Go import aliasing metadata; emits as const satisfies ....
typescript/generated/v1alpha3/relationship/RelationshipSchema.ts Updates model/capability Go import aliasing metadata; emits as const satisfies ....
typescript/generated/v1alpha2/catalog/CatalogSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1alpha1/core/CoreSchema.ts Emits schema constant with as const satisfies ....
typescript/generated/v1alpha1/capability/CapabilitySchema.ts Emits schema constant with as const satisfies ....
schemas/constructs/v1beta1/model/model.yaml Updates schema-authored GORM reference from Id to ID.
schemas/constructs/v1beta1/component/component.yaml Makes model required; switches model Go type to pointer; updates GORM reference to ID; removes omitempty from model tags.
package-lock.json Updates lockfile contents from dependency resolution changes.
models/v1beta1/user/user.go Updates pointer/value shapes and removes omitempty from some json/yaml tags for user payloads.
models/v1beta1/team/team.go Renames IdID and introduces parameter alias types (Order, Page, etc.).
models/v1beta1/subscription/subscription.go Changes Plan field type and introduces parameter alias types (Order, Page, etc.).
models/v1beta1/schedule/schedule.go Renames IdID and introduces parameter alias types (Order, Page, etc.).
models/v1beta1/role/role.go Renames IdID across structs and introduces parameter alias types (Order, Page, etc.).
models/v1beta1/plan/plan.go Renames IdID on Plan.
models/v1beta1/pattern/pattern.go Updates imports and pointer semantics for component/relationship slices; attempts to move to ID naming.
models/v1beta1/pattern/design_conversion.go Updates conversions to use ID fields; adds nil checks for model.
models/v1beta1/organization/organization.go Renames IdID in structs.
models/v1beta1/model/model_helper.go Updates helper methods to use ID.
models/v1beta1/model/model.go Renames IdID and updates tags/GORM references to ID.
models/v1beta1/keychain/keychain.go Introduces parameter alias types (Order, Page, etc.).
models/v1beta1/key/key.go Renames IdID and introduces parameter alias types (Order, Page, etc.).
models/v1beta1/invitation/invitation.go Renames IdID.
models/v1beta1/feature/feature.go Renames IdID and updates Plan/Name field shapes.
models/v1beta1/environment/environment.go Introduces parameter alias types (Order, Page, etc.) and adjusts tag omitempty usage.
models/v1beta1/credential/credential.go Renames IdID, adjusts Secret type, and introduces parameter alias types (Order, Page, etc.).
models/v1beta1/connection/connection.go Adjusts tag omitempty usage; changes environments slice element type; renames IdID in MesheryInstance.
models/v1beta1/component/component_helper.go Updates helper methods to use ID; improves error handling and nil-model handling.
models/v1beta1/component/component.go Renames IdID; makes model required in JSON/YAML tags; updates GORM references:ID.
models/v1beta1/category/category_helper.go Updates helper methods to use ID.
models/v1beta1/category/category.go Renames IdID.
models/v1beta1/academy/academy.go Refactors multiple fields to non-pointer slices/structs; adjusts ID fields naming.
models/v1alpha3/relationship/relationship_helper.go Updates helper methods to use ID.
models/v1alpha3/relationship/relationship.go Renames IdID and adjusts pointer vs value shapes for multiple nested fields/selectors.
models/v1alpha1/core/core.go Updates core alias/type generation output (notably All).
build/generate-typescript.js Changes schema TS emission to as const satisfies Record<string, unknown>.
build/generate-golang.js Adds preferred import alias support, stricter tag replacement, idID enforcement, parameter alias compatibility, and import alias validation.
Comments suppressed due to low confidence (1)

build/generate-golang.js:191

  • rewriteExternalRefAliases() can produce invalid Go files when the same import path already exists with a non-externalRefN alias. In that case chooseImportAlias() may allocate a new alias (e.g., corev1alpha12), the code gets rewritten to use it, and then normalizedImportBlock dedupes by import path and drops the newly-added alias line—leaving references to an alias that is no longer imported (see the current PR's models/v1beta1/pattern/pattern.go). Consider seeding aliasByImportPath from the existing import block (path -> existing alias) and always reusing that alias for externalRefN rewrites, or update the dedupe logic to keep the alias that is referenced after rewrites and rewrite all references to the retained alias.
  const usedAliases = new Set();
  const aliasMappings = [];
  const aliasByImportPath = new Map();
  const preferredAliases = collectPreferredImportAliases(inputPath);
  const originalImportBlock = importBlockMatch[1];

  for (const line of originalImportBlock.split("\n")) {
    const trimmedLine = line.trim();
    if (!trimmedLine) {
      continue;
    }

    const importMatch = trimmedLine.match(/^(?:(\w+)\s+)?"([^"]+)"$/);
    if (!importMatch) {
      continue;
    }

    const [, explicitAlias, importPath] = importMatch;
    const reservedAlias = explicitAlias || sanitizeGoIdentifier(path.basename(importPath));
    if (reservedAlias && !/^externalRef\d+$/.test(reservedAlias)) {
      usedAliases.add(reservedAlias);
    }
  }

  const importBlock = importBlockMatch[1].replace(
    /^(\s*)(externalRef\d+)\s+"([^"]+)"$/gm,
    (_, indent, alias, importPath) => {
      const readableAlias =
        aliasByImportPath.get(importPath) ||
        chooseImportAlias(importPath, preferredAliases, usedAliases);
      aliasByImportPath.set(importPath, readableAlias);
      aliasMappings.push({ alias, readableAlias });
      return `${indent}${readableAlias} "${importPath}"`;
    },
  );

  if (aliasMappings.length === 0) {
    return;
  }

  const seenImportPaths = new Set();
  const normalizedImportBlock = importBlock
    .split("\n")
    .filter((line) => {
      const importPathMatch = line.match(/"([^"]+)"/);
      if (!importPathMatch) {
        return true;
      }

      const importPath = importPathMatch[1];
      if (seenImportPaths.has(importPath)) {
        return false;
      }

      seenImportPaths.add(importPath);
      return true;
    })
    .join("\n")
    .replace(/\n{3,}/g, "\n\n")
    .replace(/^\n+/, "\n")
    .replace(/\n+$/, "");


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

Comment thread models/v1alpha1/core/core.go Outdated
Comment thread schemas/constructs/v1beta1/component/component.yaml Outdated
Comment thread models/v1beta1/pattern/pattern.go Outdated
@miacycle miacycle requested a review from Copilot March 18, 2026 23:06
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 advances the repo-wide normalization to treat exact id schema properties as ID in generated Go types by default, then updates schema/authored tags and downstream handwritten code to stay consistent across generation, GORM tags, and consumers.

Changes:

  • Update the Go generator to default exact id properties to Go field name ID, improve tag application, and prefer readable/import-stable aliases.
  • Update schema-authored GORM references (references:Idreferences:ID) and adjust component/model schema typing/tags to align with regenerated Go surfaces.
  • Regenerate/refresh multiple Go + TypeScript artifacts to reflect the normalization (including TS schema exports switching to as const satisfies ...).

Reviewed changes

Copilot reviewed 35 out of 68 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
typescript/rtk/meshery.ts Makes nested model required in evaluate API types; updates version field docstrings.
typescript/rtk/cloud.ts Makes nested model required in pattern APIs; updates version field docstrings.
typescript/generated/v1beta1/workspace/WorkspaceSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/user/UserSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/team/TeamSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/subscription/SubscriptionSchema.ts Adds explicit Go import aliasing for plan; changes schema export to as const satisfies ....
typescript/generated/v1beta1/subcategory/SubcategorySchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/schedule/ScheduleSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/role/RoleSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/plan/PlanSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/organization/OrganizationSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/model/ModelSchema.ts Normalizes schema structure, adds explicit Go import aliases, and updates version descriptions; changes schema export to as const satisfies ....
typescript/generated/v1beta1/model/Model.ts Updates version field docstrings (model/capability).
typescript/generated/v1beta1/keychain/KeychainSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/key/KeySchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/invitation/InvitationSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/feature/FeatureSchema.ts Adds explicit Go import aliasing for plan; changes schema export to as const satisfies ....
typescript/generated/v1beta1/event/EventSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/evaluation/Evaluation.ts Makes nested model required in evaluate API types; updates version field docstrings.
typescript/generated/v1beta1/environment/EnvironmentSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/credential/CredentialSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/connection/ConnectionSchema.ts Adds explicit Go import aliasing for environment; changes schema export to as const satisfies ....
typescript/generated/v1beta1/component/ComponentSchema.ts Makes model required + adjusts Go type/import metadata; updates GORM references:ID; changes schema export to as const satisfies ....
typescript/generated/v1beta1/component/Component.ts Makes nested model required in component types; updates version docstring.
typescript/generated/v1beta1/category/CategorySchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/badge/BadgeSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1beta1/academy/AcademySchema.ts Adds explicit Go import aliasing for invitation types; changes schema export to as const satisfies ....
typescript/generated/v1alpha3/relationship/RelationshipSchema.ts Adds explicit Go import aliases and flattens version schema blocks; changes schema export to as const satisfies ....
typescript/generated/v1alpha2/catalog/CatalogSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1alpha1/core/CoreSchema.ts Changes schema export to as const satisfies Record<string, unknown>.
typescript/generated/v1alpha1/capability/CapabilitySchema.ts Changes schema export to as const satisfies Record<string, unknown>.
schemas/constructs/v1beta1/model/model.yaml Updates GORM reference tag to references:ID.
schemas/constructs/v1beta1/component/component.yaml Makes model required, adjusts tags, and updates GORM references:ID.
schemas/constructs/v1beta1/academy/api.yml Renames curricula spellings; adjusts operationIds/refs; introduces mixed-case paths (/api/academy/Curricula).
package-lock.json Updates lockfile entries (dependency metadata changes/removals).
models/v1beta1/user/user.go Updates multiple fields to non-omitempty + adjusts pointer/value shapes to match regenerated tags/types.
models/v1beta1/team/team.go Renames IdID in mapping; rewrites parameter alias types; adjusts tags.
models/v1beta1/subscription/subscription.go Makes Plan non-pointer; rewrites parameter alias types.
models/v1beta1/schedule/schedule.go Renames IdID; rewrites parameter alias types.
models/v1beta1/role/role.go Renames IdID; rewrites parameter alias types.
models/v1beta1/plan/plan.go Renames IdID.
models/v1beta1/pattern/pattern.go Updates imports + ID naming; (currently contains an invalid corev1alpha12 reference—see comment).
models/v1beta1/pattern/design_conversion.go Updates field accesses .Id.ID and makes Model pointer-safe.
models/v1beta1/organization/organization.go Renames IdID (including Theme.ID).
models/v1beta1/model/model_helper.go Updates helper to use m.ID consistently.
models/v1beta1/model/model.go Renames IdID; aligns GORM references to ID; adjusts JSON/YAML exposure for some FK fields.
models/v1beta1/keychain/keychain.go Rewrites parameter alias types.
models/v1beta1/key/key.go Renames IdID; rewrites parameter alias types.
models/v1beta1/invitation/invitation.go Renames IdID.
models/v1beta1/feature/feature.go Renames IdID; makes Plan non-pointer; adjusts Name pointer/value.
models/v1beta1/environment/environment.go Rewrites parameter alias types; adjusts tags on several optional-ish fields.
models/v1beta1/credential/credential.go Renames IdID; changes Secret map pointer/value; rewrites parameter alias types.
models/v1beta1/connection/connection.go Adjusts tags, makes Environments a slice of pointers, renames MesheryInstance IdID, and changes StatusSummary map pointer/value.
models/v1beta1/component/component_helper.go Updates helper to use c.ID, handles GenerateID errors, and adds nil-model guard.
models/v1beta1/component/component.go Renames IdID, changes model JSON/YAML tags and GORM references, adjusts styles/capabilities shapes, and hides ModelId in JSON/YAML.
models/v1beta1/category/category_helper.go Updates helper to use cat.ID.
models/v1beta1/category/category.go Renames IdID.
models/v1beta1/academy/academy.go Reflects curricula spelling changes across multiple types and adjusts several field shapes.
models/v1alpha3/relationship/relationship_helper.go Updates helper to use r.ID.
models/v1alpha3/relationship/relationship.go Renames IdID and adjusts several pointer/value container shapes and tags.
models/v1alpha1/core/core.go Adjusts core type aliases (notably All now string, which appears inconsistent with the schema’s boolean parameter).
build/generate-typescript.js Emits TS schema constants as as const satisfies Record<string, unknown>.
build/generate-golang.js Implements default idID, readable/preferred import aliases, robust tag replacement, parameter alias normalization, and stricter validation hooks.
.github/skills/create-openapi-schemas-from-golang-models/assets/academy-api.yml Mirrors curricula renames and introduces the same mixed-case path segments.
.github/agents/schemas-code-contributor.md Updates agent tool configuration list.

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

Comment thread models/v1beta1/pattern/pattern.go
Base automatically changed from add-credential-role-schedule-models to master March 18, 2026 23:16
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
…ate model version comments for clarity

- Updated multiple schema files (PlanSchema, RoleSchema, ScheduleSchema, SubcategorySchema, SubscriptionSchema, TeamSchema, UserSchema, WorkspaceSchema) to use 'as const' for improved type inference.
- Modified SubscriptionSchema to change 'x-go-type' and 'x-go-type-import' for plan references to include versioning.
- Enhanced comments in GetPatternsApiResponse and PostEvaluateApiResponse types to clarify the purpose of version fields.

Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
…ss files

Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
Signed-off-by: Cooper Fitzgerald <cooper.fitzergerald@gmail.com>
@fitzergerald fitzergerald force-pushed the enforce-exact-id-field-consistency branch from eac302d to a876390 Compare March 18, 2026 23:31
@fitzergerald fitzergerald merged commit 65bae89 into master Mar 18, 2026
2 checks passed
@fitzergerald fitzergerald deleted the enforce-exact-id-field-consistency branch March 18, 2026 23:32
@welcome
Copy link
Copy Markdown

welcome Bot commented Mar 18, 2026

Thanks for your contribution to Meshery! 🎉

Meshery Logo
        Join the community, if you haven't yet and please leave a ⭐ star on the project. 😄

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

Labels

area/ci Continuous integration | Build and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants