Skip to content

Config: align service-info model with the spec #79

Closed as duplicate
Closed as duplicate

Description

@uniqueg

Why?

The custom config models in cloud_registry/service_models/custom_config.py are hand-copied from the API spec and are both stricter and looser than it:

  • ServiceInfoConfig makes all eleven fields required (description, contactUrl, documentationUrl, createdAt, updatedAt, environment included), while the GA4GH service-info schema requires only id, name, type, organization and version. Operators cannot leave optional fields out of config.yaml.
  • All URL and timestamp fields are plain str: invalid values such as contactUrl: foo or createdAt: yesterday are accepted at startup and served as service info, although the spec declares them as format: uri and format: date-time.
  • The models duplicate the schema, so the two drift apart whenever the spec changes; the long docstring examples repeat all fields once more.

How?

  1. Make optional what the spec makes optional.
  2. Validate URLs and RFC 3339 date-times in the models (Pydantic types or validators), or validate custom.endpoints.service_info against the Service schema from the bundled spec at startup, which removes the duplication altogether. Prefer the latter if it stays simple.
  3. Fail at startup with a clear error message for invalid config values.
  4. Shorten the docstrings to what the models add beyond the spec.
  5. Tests for valid and invalid configs.

Acceptance criteria

  • A config without the optional service-info fields starts, and GET /service-info is valid.
  • An invalid URL or date-time in the config fails at startup with a message naming the field.

Dependencies: #75 (service-info handling); after #62. Coordinate with #56 (auto-populated timestamps) and #67 (config via Helm values).

Activity

  1. added
    priority: low
    type: maintenance
    workload: hours
    on Oct 20, 2026
  2. uniqueg commented on Oct 20, 2026

    @uniqueg
    MemberAuthor

    This will be addressed by #100 (service info from config only): the service-info config will be validated at startup against the GA4GH Service schema of the bundled spec, which makes the optional fields optional, validates URLs and date-times, and removes the duplicated models. createdAt and updatedAt become optional and are omitted from the response if not set. I'll close this issue as a duplicate when #100 is merged.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowtype: maintenanceworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions