meshery / meshery/meshkit

Relationship registration rejects the canonical v1beta3 schemaVersion

Open
#1,095 0 comments 0 reactions 1 assignee Claimed by @leecalcote View on GitHub
kind/bug
Dominant language
Go
Stars
223
Forks
225
Avg merge
7d 1h
Merged PRs (30d)
1

Description

### Current Behavior

`models/registration/utils.go` `getEntity()` dispatches on `schemaVersion`. For relationships it accepts only:

```go
case schema.RelationshipSchemaVersionV1Beta2, v1alpha3.RelationshipSchemaVersion:
```

A relationship definition declaring the canonical construct version `relationships.meshery.io/v1beta3` falls through to the default case and registration fails with:

> Not a valid component definition, model definition, relationship definition, or connection definition

The same switch already implements the intended compatibility pattern for components and models - both the legacy and the current schema version strings are accepted (`v1beta1.ComponentSchemaVersion, v1beta3.ComponentSchemaVersion`, with an explanatory comment). Relationships were left out.

### Consequence

- meshery/schemas has published the v1beta3 relationship construct as the authoring target (`schemas/constructs/v1beta3/relationship/`), and meshery/meshery documentation (PR meshery/meshery#21479) directs contributors to author new definitions as v1beta3.
- Any such definition silently fails to register in Meshery Server (seeding and `mesheryctl model import` both route through this switch), so the ecosystem is forced to keep authoring `v1beta2` documents.

### Desired Behavior

Accept `relationships.meshery.io/v1beta3` in the relationship case and decode into the existing registration struct. The v1beta3 wire shape is compatible with the v1alpha3/v1beta2 Go struct used today (meshery/meshery's `relationship_version_bridge.go` already round-trips these shapes with shallow typed copies).

Add a `RelationshipSchemaVersionV1Beta3` constant beside the existing `RelationshipSchemaVersionV1Beta2` in `schema/validator.go` and cover the new case in `models/registration/utils_test.go`.

### Environment
- meshkit master (cf39c573)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.