Skip to content

ai-integrations: retool OCI AIResource validation onto url:oci:// source-location #3955

Description

@johnmcollier

Summary

Retool OCI-backed AIResource support to use the upstream backstage.io/source-location convention (url:oci://…) instead of the RHDH spec.location field.

Upstream AiResource has no spec.location. Skill/rule content is referenced via backstage.io/source-location. Keep format-only OCI validation (zero registry/network I/O). An OCI UrlReader is not in scope.

Tracks Jira: RHIDP-15739 (Epic RHIDP-13942, Feature RHDHPLAN-1113).

OpenSpec for this change was updated in #3938.

Tasks

  • Remove RHDH spec.location usage from AIResource OCI/git asset location support (schema/types, processor input, docs, examples)
  • Retool OCI validation to read metadata.annotations["backstage.io/source-location"] as a Backstage location-ref
  • Enforce location-ref form url:oci://… (type url, target starts with oci:// and is a well-formed OCI reference)
  • Reject bare oci://… (missing url: prefix) and other malformed OCI refs with actionable errors
  • Keep zero outbound HTTP/registry calls during validation
  • Update unit tests for valid/invalid url:oci://… annotations, bare oci://…, whitespace/malformed targets, and non-OCI source-locations
  • Update examples (examples/ai-resource-*.yaml) and plugin README registration guidance for the new model
  • Keep tests non-interactive (CI=true yarn test --watchAll=false style)

Acceptance Criteria

  • AIResource entities no longer require or use spec.location for asset location
  • Valid backstage.io/source-location: url:oci://quay.io/org/skills:latest passes ingest validation
  • Malformed OCI source-location values (including bare oci://…) are rejected with actionable errors
  • Processor performs zero outbound registry/network calls
  • Git/HTTPS source-location entities continue to work and are not subject to OCI format rules
  • Examples, README/docs, and tests match the OpenSpec contract

Specifications

All paths below are relative to workspaces/ai-integrations/.

  • openspec/changes/ai-resource-catalog-entity-kind/proposal.md
  • openspec/changes/ai-resource-catalog-entity-kind/design.md (esp. D2–D5, D10; RHIDP-14557 git UrlReader verification)
  • openspec/changes/ai-resource-catalog-entity-kind/tasks.md (Sections 1–2 and 6)
  • openspec/changes/ai-resource-catalog-entity-kind/specs/ai-resource-entity-schema/spec.md
  • openspec/changes/ai-resource-catalog-entity-kind/specs/ai-resource-catalog-ingestion/spec.md

Out of Scope

  • OCI UrlReader / registry content fetch / layer pull
  • Catalog location type oci / readLocation for discovering entities from registries
  • Custom AI catalog frontend beyond standard entity-page adaptations
  • Changes to spec.scope (keep as RHDH extension)
  • Replacing git/HTTPS registration flows (entity YAML still comes from normal url/file/git locations)

Context

Related prior work:

Prefer updating the existing catalog-backend-module-catalog-backend-module-ai-resource-extensions processor(s) and tests rather than introducing a new module.

Important location-ref detail: the annotation must be url:oci://…, not bare oci://…. Bare oci://… parses as location type oci with a non-URL target and breaks future UrlReader integration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions