Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

DM-35149: Integrate GitHub Checks API for validating YAML configs in repositories #40

Merged
merged 9 commits into from
Jun 23, 2022

Conversation

jonathansick
Copy link
Member

@jonathansick jonathansick commented Jun 16, 2022

This PR implements the GitHub Checks API in Times Square, which enables Times Square to provide status checks on commits in PRs. For this initial PR, Times Square will validate the YAML files in a notebook repository using Pydantic as a validation engine.

Future work will implement check runs for individual notebooks to validate that they run given their default parameters. Most of the code created for YAML check runs will carry over to other types of check runs like the notebook runs.

@jonathansick jonathansick force-pushed the tickets/DM-35149 branch 2 times, most recently from 869c5fc to e16e7d9 Compare June 23, 2022 00:14
@jonathansick jonathansick changed the title DM-35149: Add models for check suite and check run payloads DM-35149: Integrate GitHub Checks API for validating YAML configs in repositories Jun 23, 2022
These are the webhook event payloads for check suites and check runs,
and corresponding models that can be obtained with GitHub's API.

These are checks with examples from GitHub's webhook docs.
This catches check suite/run related GitHub webhook events, fires off
async tasks and, creates + computes check runs in the GitHubRepoService.
Rather than wait for the check_run webhook, we can actually run the
check run immediately given the result from the check run creation
endpoint.
It's convenient to know the git_ref corresponding to a checkout, but in
truth only the head_sha is required. We're making it "optional" here to
allow users to still set this metadata if relevant.
This classmethod makes it possible for a GitHubRepositoryCheckout to
create itself from a github client, repository, and sha. This eliminates
need for the "create_checkout" method on the RepositoryService. Overall
this means it's easier to create checkouts from different parts of the
code, which will be useful when writing the check run validation code.
@jonathansick jonathansick force-pushed the tickets/DM-35149 branch 4 times, most recently from 43a8af9 to 5e264c7 Compare June 23, 2022 16:17
This is an initial attempt at implementing a check run, GitHubConfigsCheck,
that reports Pydantic validation errors.
- There was a typo in the function name
- No need to validate the app id for rerequests (and in fact, we were
  probably checking the wrong thing?
@jonathansick jonathansick marked this pull request as ready for review June 23, 2022 17:19
@jonathansick
Copy link
Member Author

Snapshot of a check run with failures:

Screen Shot 2022-06-23 at 5 18 16 PM

Snapshot of a clean check run:

Screen Shot 2022-06-23 at 5 17 16 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant