Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Schema Inaccuracy] Deployment Protection Rule: are these fields truly optional? #3514

Open
roy-work opened this issue Apr 11, 2024 · 1 comment

Comments

@roy-work
Copy link

roy-work commented Apr 11, 2024

Schema Inaccuracy

The schema for a deployment protection rule webhook event is:

    webhook-deployment-protection-rule-requested:
      title: deployment protection rule requested event
      type: object
      properties:
        action:
          type: string
          enum:
          - requested
        environment:
          description: The name of the environment that has the deployment protection
            rule.
          type: string
        event:
          description: The event that triggered the deployment protection rule.
          type: string
        deployment_callback_url:
          description: The URL to review the deployment protection rule.
          type: string
          format: uri
        deployment:
          "$ref": "#/components/schemas/deployment"
        pull_requests:
          type: array
          items:
            "$ref": "#/components/schemas/pull-request"
        repository:
          "$ref": "#/components/schemas/repository-webhooks"
        organization:
          "$ref": "#/components/schemas/organization-simple-webhooks"
        installation:
          "$ref": "#/components/schemas/simple-installation"
        sender:
          "$ref": "#/components/schemas/simple-user-webhooks"

(In the docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#deployment_protection_rule)

All of the fields here are optional. Is that correct? I suspect not.

For example: deployment_callback_url: what is the meaning of a deployment protection rule webhook event that doesn't include a callback URL, and what would one even do with such a thing? Same thing for deployment — how does a deployment protection rule fire on a null or missing deployment…?

(intallation, similarly.)

I've not seen either of those in the wild, either, which further makes me suspect they're actually always present. It'd be nice if the schema had that. (And then, I could just do a rote translation to T, instead of Optional<T> for those fields.)

Expected

Probably, some or all of these fields are required. It'd be great if the docs specified.

@shiftkey
Copy link
Member

@roy-work thanks for the feedback! I've reached out to the team that maintains this area for their expertise on these field.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants