Type ArtifactRegistryRepository.settings with a union/interface before GA
Summary
Types::ArtifactRegistry::RepositoryType#settings currently uses GraphQL::Types::JSON (with a Graphql/JSONType cop disable). The field is polymorphic, discriminated by format and kind (ADR-009), so per the GraphQL styleguide it should be a union or interface rather than JSON once its shape is known.
It was left as JSON for the experiment stage because the concrete shapes are not available yet:
- Hosted (monolith/S07 Phase 1):
settingscarries no settable fields and is omitted when empty, so there is nothing to type today. - Remote / virtual: the
settingscontract (remote cache-validity fields, upstream associations) is gated on the Go-service S13 management phase, which is not yet shipped or fully contracted.
What to do
Before the artifact_registry_ui flag is enabled / before GA, replace GraphQL::Types::JSON with a typed union or interface (e.g. ArtifactRegistryRepositorySettings with per-format/per-kind implementations) and remove the Graphql/JSONType cop disable. Moving JSON to a typed shape after the field ships in the public schema is a breaking change, so this must land before flag removal.
Context
- Raised in review of !248967 (merged) (monolith/S07 Step 1 GraphQL foundation).
- Depends on the Go-service S13 remote/virtual
settingscontract. - Styleguide: avoid
GraphQL::Types::JSONunless data is truly unstructured; use a union when the structure is one of a set of known shapes.