Skip to content

feat(#4209): add ai-model-server API spec type extension - #4211

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4209-ai-model-server-spec
Open

feat(#4209): add ai-model-server API spec type extension#4211
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4209-ai-model-server-spec

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

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

  • Branch is not main/master (agent/4209-ai-model-server-spec)
  • Secret scan passed (gitleaks — 6c752b60d5bdc359d1eb6b5b81a34880a0c71c21..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

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
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
backend workspaces/ai-integrations/packages/backend none v0.0.0
@red-hat-developer-hub/backstage-plugin-catalog-backend-module-ai-model-server workspaces/ai-integrations/plugins/catalog-backend-module-ai-model-server minor v0.1.0
@red-hat-developer-hub/backstage-plugin-catalog-model-ai-model-server workspaces/ai-integrations/plugins/catalog-model-ai-model-server minor v0.1.0

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.33%. Comparing base (6c752b6) to head (70eaec4).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4211   +/-   ##
=======================================
  Coverage   58.33%   58.33%           
=======================================
  Files        2432     2434    +2     
  Lines       96774    96796   +22     
  Branches    26955    26957    +2     
=======================================
+ Hits        56451    56469   +18     
+ Misses      40125    40122    -3     
- Partials      198      205    +7     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from 6c752b6
ai-integrations 69.61% <81.81%> (+0.44%) ⬆️
app-defaults 69.79% <ø> (ø) Carriedforward from 6c752b6
augment 46.67% <ø> (ø) Carriedforward from 6c752b6
boost 76.77% <ø> (ø) Carriedforward from 6c752b6
bulk-import 72.79% <ø> (ø) Carriedforward from 6c752b6
cost-management 13.55% <ø> (ø) Carriedforward from 6c752b6
dcm 67.21% <ø> (ø) Carriedforward from 6c752b6
extensions 56.59% <ø> (ø) Carriedforward from 6c752b6
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 6c752b6
global-header 66.50% <ø> (ø) Carriedforward from 6c752b6
homepage 47.50% <ø> (ø) Carriedforward from 6c752b6
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from 6c752b6
intelligent-assistant 75.24% <ø> (ø) Carriedforward from 6c752b6
konflux 91.98% <ø> (ø) Carriedforward from 6c752b6
lightspeed 69.02% <ø> (ø) Carriedforward from 6c752b6
mcp-integrations 83.40% <ø> (ø) Carriedforward from 6c752b6
orchestrator 66.91% <ø> (ø) Carriedforward from 6c752b6
quickstart 63.74% <ø> (ø) Carriedforward from 6c752b6
sandbox 79.56% <ø> (ø) Carriedforward from 6c752b6
scorecard 86.17% <ø> (ø) Carriedforward from 6c752b6
theme 88.77% <ø> (ø) Carriedforward from 6c752b6
translations 5.12% <ø> (ø) Carriedforward from 6c752b6
x2a 79.20% <ø> (ø) Carriedforward from 6c752b6

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c752b6...70eaec4. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2026

Copy link
Copy Markdown

@gabemontero

Copy link
Copy Markdown
Contributor

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:48 PM UTC · Completed 12:07 AM UTC

Commit: 70eaec4 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [potential-registration-overlap] workspaces/ai-integrations/packages/backend/src/index.ts:80 — The dev backend registers both the upstream @backstage/plugin-catalog-backend-module-ai-model (line 79) and this new catalog-backend-module-ai-model-server module. Both register CatalogModelLayers for the API kind. Once upstream feat(catalog-model): add ai-model-server spec type for API kind backstage/backstage#34476 merges and adds ai-model-server support to the upstream module, a double-registration conflict could occur. Consider adding a code comment clarifying this is a stopgap, or opening a follow-up issue to track removal when upstream lands.

Low

  • [edge-case] workspaces/ai-integrations/plugins/catalog-model-ai-model-server/src/API.v1alpha1.ai-model-server.schema.jsonmodels.default is not cross-validated against models.available. An entity with default: "nonexistent-model" and available: ["llama3"] passes schema validation. This is a JSON Schema draft-07 limitation and cannot be addressed at the schema layer.

  • [backward-compatibility] workspaces/ai-integrations/plugins/catalog-model-ai-model-server/src/AiModelServerApiEntity.ts:52 — The type guard isAiModelServerApiEntity only checks kind and spec.type but narrows to a type asserting all required spec fields exist. This follows the standard Backstage type guard pattern (e.g., upstream isApiEntity); consumers should call aiModelServerApiEntityValidator.check() for full validation.

  • [api-versioning] workspaces/ai-integrations/plugins/catalog-model-ai-model-server/src/AiModelServerApiEntity.ts:75 — Both v1alpha1 and v1beta1 are registered with identical schemas from the initial release. This follows the upstream pattern from feat(catalog-model): add ai-model-server spec type for API kind backstage/backstage#34476 but creates version ambiguity — consider whether launching with only v1alpha1 would be cleaner.

  • [naming-convention] workspaces/ai-integrations/plugins/catalog-backend-module-ai-model-server/src/module.ts:34 — The moduleId 'ai-model-server' deviates from sibling packages that use the full directory name (e.g., 'catalog-backend-module-model-catalog').

  • [backstage-metadata] workspaces/ai-integrations/plugins/catalog-backend-module-ai-model-server/package.json — Missing pluginPackages array in the backstage section. Some sibling packages include it, though catalog-backend-module-ai-resource-extensions also omits it.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

),
);
backend.add(import('@backstage/plugin-catalog-backend-module-ai-model'));
backend.add(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] potential-registration-overlap

The dev backend registers both the upstream @backstage/plugin-catalog-backend-module-ai-model (line 79) and this new catalog-backend-module-ai-model-server module. Both register CatalogModelLayers for the API kind. Once upstream backstage/backstage#34476 merges and adds ai-model-server support, a double-registration conflict could occur.

Suggested fix: Add a code comment clarifying this is a stopgap until upstream backstage/backstage#34476 merges, or open a follow-up issue to track removal.

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

Labels

ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment workspace/ai-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add ai-model-server API spec type (catalog-model layer + backend module)

1 participant