Skip to content

[Schema Inaccuracy] check-run conclusion lacks stale, security-and-analysis lacks secret_scanning_validity_checks, installation-token example uses another repository shape #7247

Description

@HardMax71

Schema Inaccuracy

A few response schemas in the 2022-11-28 description on main (c6721f3) don't match what the API returns or what their own examples show. They're small and separate, so I've put them together; happy to split them if that's easier to track.

  1. The check-run schema's conclusion enum has success, failure, neutral, cancelled, skipped, timed_out and action_required, but not stale. The REST checks guide says "If a check run is in an incomplete state for more than 14 days, then the check run's conclusion becomes stale", and the POST /repos/{owner}/{repo}/check-runs body lists stale with the note "only GitHub can set this". check-suite.conclusion already includes stale.
  2. security-and-analysis has no secret_scanning_validity_checks, though GET /repos/{owner}/{repo} returns it for admins next to the other secret scanning settings.
  3. The installation-token example (#/components/examples/installation-token) gives its repositories network_count, subscribers_count and template_repository, which belong to full-repository. The response schema's repositories items are #/components/schemas/repository, which has none of the three. [Schema Inaccuracy] Example and schema mismatch for #/paths/~1app~1installations~1{installation_id}~1access_tokens/post #5662 reported template_repository and was closed after a check against 5b1274f, but that commit and main still have it in the example and not in the schema.

Expected

  1. check-run.conclusion includes stale.
  2. security-and-analysis has secret_scanning_validity_checks with the same {status: enabled|disabled} shape as its neighbours.
  3. The example matches repository, or the schema says which repository shape the endpoint returns.

Reproduction Steps

$ jq -c '.components.schemas["check-run"].properties.conclusion.enum' api.github.com.2022-11-28.json
["success","failure","neutral","cancelled","skipped","timed_out","action_required"]

$ jq -c '.components.schemas["check-suite"].properties.conclusion.enum' api.github.com.2022-11-28.json
["success","failure","neutral","cancelled","skipped","timed_out","action_required","startup_failure","stale",null]

$ gh api -H "X-GitHub-Api-Version: 2022-11-28" repos/HardMax71/amiss --jq .security_and_analysis
{"dependabot_security_updates":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_non_provider_patterns":{"status":"disabled"},"secret_scanning_push_protection":{"status":"enabled"},"secret_scanning_validity_checks":{"status":"disabled"}}

$ jq -c '.components.schemas["security-and-analysis"].properties | keys' api.github.com.2022-11-28.json
["advanced_security","code_security","dependabot_security_updates","secret_scanning","secret_scanning_ai_detection","secret_scanning_delegated_alert_dismissal","secret_scanning_delegated_bypass","secret_scanning_delegated_bypass_options","secret_scanning_non_provider_patterns","secret_scanning_push_protection"]

$ jq -c '.components.examples["installation-token"].value.repositories[0] | [has("network_count"), has("subscribers_count"), has("template_repository")]' api.github.com.2022-11-28.json
[true,true,true]

$ jq -c '.components.schemas.repository.properties | [has("network_count"), has("subscribers_count"), has("template_repository")]' api.github.com.2022-11-28.json
[false,false,false]

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