feat(#4209): add ai-model-server API spec type extension - #4211
feat(#4209): add ai-model-server API spec type extension#4211fullsend-ai-coder[bot] wants to merge 7 commits into
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4211 +/- ##
==========================================
- Coverage 57.55% 57.54% -0.02%
==========================================
Files 2447 2449 +2
Lines 97659 97649 -10
Branches 27268 27261 -7
==========================================
- Hits 56204 56188 -16
- Misses 41181 41187 +6
Partials 274 274
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 11:48 PM UTC · Completed 12:07 AM UTC Commit: |
ReviewFindingsHigh
Medium
Low
Labels: PR adds new catalog entity kind and plugins in the ai-integrations workspace, which is a feature enhancement. Next steps:
Previous runReviewFindingsHigh
Medium
Low
Next steps:
Previous run (2)ReviewFindingsMedium
Low
|
Add two new plugins implementing the ai-model-server spec type for the API kind, replicating the upstream backstage/backstage#34476 schema as an rhdh-plugins module while the upstream PR is pending. catalog-model-ai-model-server provides the AiModelServerApiEntity TypeScript type, JSON schema, KindValidator, type guard, and CatalogModelLayer. The schema requires serverType and serverUrl fields and supports optional requiresApiKey, apiEntityRef, and models (discoverable, available, default). catalog-backend-module-ai-model-server registers the model layer with the catalog via catalogModelExtensionPoint.addModelSource. Includes example YAML, changeset, API reports, and dev backend wiring. Closes #4209 Assisted-by: Claude
… API Switch from extending the upstream API kind with specType ai-model-server to a dedicated AiModelServerAPI kind. This avoids colliding with the upstream catalog model layer for API entities while backstage/backstage#34476 is pending. The schema is identical to upstream — only the kind field differs. When #34476 merges, a migration processor can convert AiModelServerAPI entities into API entities with spec.type: ai-model-server by simply changing the kind field. Signed-off-by: gabemontero <gmontero@redhat.com> Assisted-by: Claude Opus 4.6 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite ModelCatalogGenerator to produce a single AiModelServerAPI entity per ModelCatalog instead of separate Component, Resource, and API entities. Model names are collected into spec.models.available. - Rewrite GenerateCatalogEntities to build AiModelServerAPI from ModelCatalog.modelServer data (tags, links, annotations, techdocs) - Return empty array when modelServer is absent - Add catalog-model-ai-model-server workspace dependency - Update entity provider log message and test fixtures - Fix typo and syntax error in dev backend index.ts - Add major changeset bump for catalog-backend-module-model-catalog Signed-off-by: gabemontero <gmontero@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Assisted-by: Claude Opus 4.6
CatalogModelSources.static() auto-includes the default entity model layer. When multiple backend modules each call it, the default model annotations (e.g. backstage.io/managed-by-location) get declared multiple times, crashing the catalog plugin on startup. Replace CatalogModelSources.static() with a bare CatalogModelSource implementation that yields only the custom layer, leaving the default model to be provided once by the catalog plugin itself. Signed-off-by: gabemontero <gmontero@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Assisted-by: Claude Opus 4.6
addKindVersion requires the kind to already exist in the catalog model. Since AiModelServerAPI is a brand-new kind (not extending an existing one like AiResource), the layer must use addKind to declare the kind with its group, names, description, and versions together. Signed-off-by: gabemontero <gmontero@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Assisted-by: Claude Opus 4.6
70eaec4 to
ec1915a
Compare
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 1:38 PM UTC · Completed 1:55 PM UTC Commit: |
Response to review findings — approach change rationale
|
- Return [] from GenerateCatalogEntities when modelServer.API?.url is falsy, preventing entities with empty serverUrl that would fail schema validation (minLength: 1) - Fix plural form: aimodelserverapies -> aimodelserverapis - Add test for modelServer present but API undefined - Add test for empty models array (available: [], no default) Signed-off-by: gabemontero <gmontero@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Assisted-by: Claude Opus 4.6
Response to remaining review findings
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 2:32 PM UTC · Completed 2:52 PM UTC Commit: |
The CatalogModelSources.static() -> bare CatalogModelSource fix in catalog-backend-module-ai-resource-agent is a behavioral change to a published package and needs a changeset entry. Signed-off-by: gabemontero <gmontero@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Assisted-by: Claude Opus 4.6
Response to second fullsend review (review 4907533546)Action taken
No change (with rationale)
|
|



Add two new plugins implementing the ai-model-server spec type for the API kind, replicating the upstream backstage/backstage#34476 schema as an rhdh-plugins module while the upstream PR is pending.
catalog-model-ai-model-server provides the AiModelServerApiEntity TypeScript type, JSON schema, KindValidator, type guard, and CatalogModelLayer. The schema requires serverType and serverUrl fields and supports optional requiresApiKey, apiEntityRef, and models (discoverable, available, default).
catalog-backend-module-ai-model-server registers the model layer with the catalog via catalogModelExtensionPoint.addModelSource.
Includes example YAML, changeset, API reports, and dev backend wiring.
Assisted-by: Claude
Closes #4209
Post-script verification
agent/4209-ai-model-server-spec)6c752b60d5bdc359d1eb6b5b81a34880a0c71c21..HEAD)