-
Notifications
You must be signed in to change notification settings - Fork 0
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-35816: Support for viewing GitHub PR previews in Squareone #42
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jonathansick
force-pushed
the
tickets/DM-35816
branch
2 times, most recently
from
August 5, 2022 20:49
dcfd24c
to
a39b647
Compare
jonathansick
force-pushed
the
tickets/DM-35816
branch
from
August 15, 2022 16:03
fbd1a6c
to
d5e1759
Compare
The fastapi.Path class lets us properly document the path parameters in the Open API spec.
jonathansick
force-pushed
the
tickets/DM-35816
branch
from
August 15, 2022 16:51
93346de
to
c91408e
Compare
This provides access to the pages that are built automatically by the GitHub Check run handlers for a GitHub pull request. - New PageService.get_github_pr_page - New /github-pr/ endpoints, similar to the existing /github/ endpoints, but have the PR's head commit SHA in the path to show pages for a specific PR check run - Revised GitHubTree domain model. The new domain model separates path segments (which are used to add nodes relative to other nodes) from the Squareone URL path. This dramatically simplifies the tree domain construction and makes it possible to use the same domain object for PR preview trees as well. The new GitHubNode is a dataclass; in the REST API we transform that dataclass into a Pydantic model for the response.
jonathansick
force-pushed
the
tickets/DM-35816
branch
from
August 16, 2022 22:58
548f6ce
to
d03e774
Compare
jonathansick
force-pushed
the
tickets/DM-35816
branch
from
August 18, 2022 19:21
079368b
to
341d2aa
Compare
Normally we create a GitHubRepoService in webhook handlers where the installation ID is know. This new create_github_repo_service classmethod lets us look-up the installation ID for a specific repository, and then create the service using a GitHub client authenticated for that installation.
Get the check run resources from the GitHub API for a specific commit.
This method, along with the required domain models, allow us to get the PR resources related to GitHub check runs for a specific commit.
The contents for a GitHub pull request now include info about pull requests and the status of check runs.
This sets the "details_url" field for check runs to the Squareone landing page for the check run, /times-square/github-pr/:owner/:repo/:commit
jonathansick
force-pushed
the
tickets/DM-35816
branch
from
August 18, 2022 23:41
341d2aa
to
122598a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds new endpoints to support the UI for previewing a repository based on a GitHub check run:
GET /times-square/api/v1/github-pr/:org/:repo/:sha
provides metadata about the GitHub contents for that commit, along with check runs and related pull requests. This endpoint powers the side bar in Squareone's views.GET /times-square/api/v1/github-pr/:org/:repo/:sha/:path
provides metadata about a specific notebook. This endpoint essentially maps to the traditional page resource given its context in a GitHub repository and commit.These endpoints are specializations of the equivalent APIs for GitHub-backed pages in
/times-square/api/v1/github
.