Skip to content

Accept v1beta3 relationship schemaVersion at registration - #1096

Open
leecalcote wants to merge 1 commit into
masterfrom
fix/register-v1beta3-relationships
Open

Accept v1beta3 relationship schemaVersion at registration#1096
leecalcote wants to merge 1 commit into
masterfrom
fix/register-v1beta3-relationships

Conversation

@leecalcote

@leecalcote leecalcote commented Aug 18, 2026

Copy link
Copy Markdown
Member

Description

This PR fixes #1095.

getEntity dispatched relationship documents only on the v1beta2 and v1alpha3 schema version strings, so a definition authored against the canonical v1beta3 construct published by meshery/schemas fell through to the default case and failed to register - in Meshery Server seeding and mesheryctl model import alike. Components and models in the same switch already accept both their legacy and current version strings; relationships were left out of that compatibility pattern.

Changes

  • Accept relationships.meshery.io/v1beta3 in the relationship case, decoding into the same shape-compatible registration struct (meshery/meshery's relationship_version_bridge.go already round-trips these shapes with shallow typed copies).
  • Add RelationshipSchemaVersionV1Beta3 beside the existing v1beta2 constant in schema/validator.go.
  • Tests: v1beta3 acceptance plus a pin that unknown versions are still rejected.

Verification

  • go build ./... - clean
  • go test ./... - full suite passes
  • golangci-lint run models/registration/... schema/... - 0 issues

Cross-repo context

meshery/meshery#21479 documents v1beta3 as the relationship authoring target; until this fix reaches a meshkit release consumed by meshery/meshery, definitions that must register on current servers still need to declare v1beta2 (that PR's wording is being corrected to say exactly that).

Summary by CodeRabbit

  • New Features

    • Added support for relationship schema version v1beta3.
    • Existing supported relationship versions continue to work as before.
  • Bug Fixes

    • Unknown relationship schema versions are now correctly rejected.
  • Tests

    • Added coverage for accepting v1beta3 and rejecting unsupported versions.

getEntity dispatched relationships only on the v1beta2 and v1alpha3
schema version strings, so a definition authored against the canonical
v1beta3 construct published by meshery/schemas fell through to the
default case and failed to register - in server seeding and in
mesheryctl model import alike. Components and models in the same switch
already accept both their legacy and current version strings.

Accept relationships.meshery.io/v1beta3 in the relationship case,
decoding into the same shape-compatible registration struct, and add a
RelationshipSchemaVersionV1Beta3 constant beside the existing v1beta2
one. Cover acceptance of the new version and rejection of unknown
versions in tests.

Fixes #1095

Signed-off-by: Arjun Mehta <231106746+arjunmehta-git@users.noreply.github.com>
@leecalcote leecalcote self-assigned this Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd6b08b8-6129-4999-b25a-f947bf612e47

📥 Commits

Reviewing files that changed from the base of the PR and between cf39c57 and 1089784.

📒 Files selected for processing (3)
  • models/registration/utils.go
  • models/registration/utils_test.go
  • schema/validator.go

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The relationship entity parser now accepts the v1beta3 schema version. The schema package defines the corresponding exported constant. Tests cover successful v1beta3 parsing and rejection of the unknown v1beta9 version.

Changes

Relationship schema support

Layer / File(s) Summary
Add v1beta3 schema dispatch
schema/validator.go, models/registration/utils.go
The schema package defines RelationshipSchemaVersionV1Beta3. The relationship parser accepts this version and decodes it as the existing v1alpha3 relationship definition.
Validate accepted and unknown versions
models/registration/utils_test.go
Tests verify successful parsing for v1beta3 and an error for unknown version v1beta9.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 10897

This PR enables registration of v1beta3 relationship definitions while preserving rejection of unknown versions, with no actionable merge-blocking risk remaining after normal checks and review.

Possibly related issues

  • Issue 1095: Directly requests v1beta3 relationship schema support in the parser, schema constants, and tests.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: accepting the v1beta3 relationship schema version during registration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/register-v1beta3-relationships

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

leecalcote added a commit to meshery/meshery that referenced this pull request Aug 18, 2026
The earlier wording claimed v1beta3-authored definitions are consumed
the same way as v1beta2 today. Shape-wise that is true (the server
bridges registered definitions for the policy engine), but meshkit's
registration switch accepts only v1beta2/v1alpha3 relationship
documents, so a v1beta3 file fails to register at all - in server
seeding and mesheryctl model import alike. meshery/meshkit#1096 adds
the missing case (issue meshery/meshkit#1095).

State the gate precisely everywhere the version guidance appears:
author against v1beta3, declare v1beta2 for anything that must
register on current servers. Also fold in skill-review feedback:
trigger phrases and the file-path pattern move into the skill's
frontmatter description, and the combo table now says to open only
the matching example fixture.

Signed-off-by: Lee Calcote <7570704+leecalcote@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relationship registration rejects the canonical v1beta3 schemaVersion

2 participants