Skip to content

[Schema Inaccuracy] Webhook actions of one event disagree: workflow_run in_progress, review thread resolved/unresolved, review head.label, simple-check-suite deployment #7248

Description

@HardMax71

Schema Inaccuracy

Some webhook schemas in the 2022-11-28 description on main (c6721f3) describe the same object differently from one action to the next, or leave out a field GitHub's own examples carry. All four were the same at 3cef12e.

  1. webhook-workflow-run-in-progress: workflow_run has no display_title, which completed declares and requested requires, and actor, triggering_actor, repository.owner and head_repository.owner have no user_view_type, which both other actions declare. Its conclusion is nullable: true, but the enum has no null, so a validator that follows OAS 3.0.3 rejects conclusion: null, which is what an in-progress run carries. requested lists null in its enum.
  2. webhook-pull-request-review-thread-resolved and -unresolved describe the same payload apart from action, but four fields are nullable only in resolved: pull_request.auto_merge.commit_title, pull_request.head.label, pull_request.head.repo and thread.comments[].original_line. head.repo is null once a fork is deleted, and original_line can be null on outdated comments, so unresolved rejects payloads resolved accepts.
  3. webhook-pull-request-review-submitted has a nullable pull_request.head.label, while -dismissed and -edited don't. [Schema Inaccuracy] head.label and head.user can be null in pull-request schema #5562 covers head.label being null in pull-request; the review actions should agree with each other.
  4. simple-check-suite, which all four check_run webhooks reach through check-run-with-simple-check-suite.check_suite, has no deployment. The description's own check-run-created, check-run-completed and check-run-rerequested examples carry check_run.check_suite.deployment.

Expected

The actions of one event describe the shared objects the same way: display_title, user_view_type and a null conclusion on in_progress; the same nullability on both review-thread actions and on all review actions; and deployment on simple-check-suite.

Reproduction Steps

$ jq -c '.components.schemas["webhook-workflow-run-in-progress"].properties.workflow_run.properties | [has("display_title"), .conclusion.nullable, (.conclusion.enum | index(null))]' api.github.com.2022-11-28.json
[false,true,null]

$ jq -c '.components.schemas["webhook-workflow-run-completed"].properties.workflow_run.properties | [has("display_title"), (.actor.properties | has("user_view_type"))]' api.github.com.2022-11-28.json
[true,true]

$ jq -c '[.components.schemas["webhook-pull-request-review-thread-resolved", "webhook-pull-request-review-thread-unresolved"].properties.pull_request.properties.head.properties.repo.nullable]' api.github.com.2022-11-28.json
[true,null]

$ jq -c '[.components.schemas["webhook-pull-request-review-thread-resolved", "webhook-pull-request-review-thread-unresolved"].properties.thread.properties.comments.items.properties.original_line.nullable]' api.github.com.2022-11-28.json
[true,null]

$ jq -c '[.components.schemas["webhook-pull-request-review-submitted", "webhook-pull-request-review-dismissed", "webhook-pull-request-review-edited"].properties.pull_request.properties.head.properties.label.nullable]' api.github.com.2022-11-28.json
[true,null,null]

$ jq -c '[(.components.schemas["simple-check-suite"].properties | has("deployment")), (.components.examples["check-run-created"].value.check_run.check_suite | has("deployment"))]' api.github.com.2022-11-28.json
[false,true]

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions