Skip to content

Track endpoints that use types to report more useful errors #12

@jgallagher

Description

@jgallagher

We were recently making some changes to a type in omicron-common and got this error when trying to generate the sled-agent API:

     Failure sled-agent (versioned v17.0.0 (blessed)): Oxide Sled Agent API
           error: OpenAPI document generated from the current code is not compatible with the blessed document (from upstream)
                  - at .components.schemas.UplinkAddressConfig -> .components.schemas.UplinkAddressConfig2: change: object required properties changed
                    --- a/blessed
                    +++ b/generated
                    @@ -1,21 +1,24 @@
                     {
                    -  "UplinkAddressConfig": {
                    +  "UplinkAddressConfig2": {
                         "properties": {
                           "address": {
                    -        "$ref": "#/components/schemas/IpNet"
                    +        "allOf": [
                    +          {
                    +            "$ref": "#/components/schemas/IpNet"
                    +          }
                    +        ],
                    +        "description": "The address to be used on the uplink. Set to `None` for an Ipv6 Link Local address.",
                    +        "nullable": true
                           },
                           "vlan_id": {
                             "default": null,
                             "description": "The VLAN id (if any) associated with this address.",
                             "format": "uint16",
                             "minimum": 0,
                             "nullable": true,
                             "type": "integer"
                           }
                         },
                    -    "required": [
                    -      "address"
                    -    ],
                         "type": "object"
                       }
                     }

The contents of the complaint make sense - we were changing UplinkAddressConfig::address from required to optional - but it's not obvious what we need to do to fix the problem. The thing we need to do here is add a new version of any endpoints that use this type (or types that contain this type). I manually grepped for usages of UplinkAddressConfig in the blessed OpenAPI spec to find the type(s) that it contained, then the type(s) that contained those types, and so on, until I found the endpoint we had missed, but it would be great if drift could do that and tell us the relevant endpoint(s) in these errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions