Repository navigation
feat(web): connect GitHub and create an application from a repository (part of #213) - #528
Merged
Merged
Conversation
Part of #213 (ADR 0031, SPEC 4). An application can take its configuration from the shipkeep.yml of a repository that the organization's GitHub App reaches: POST …/applications/github reads it at the branch head with a token scoped to that repository (contents: read), revoked once read, validates it, and stores the installation, the repository's identifier and name, the branch and the path. Until builds land it names a built image. Its configuration is the repository's, so the API does not replace it, and an environment holding one is not cloned yet. Releases get a commit_sha column for the push deployments that come next. Signed-off-by: samuel mbabhazi <[email protected]>
Part of #213. Integrations becomes a live page: an owner creates the organization's GitHub App through GitHub's manifest flow (the CSP's form-action now allows https://github.com, the only target the page posts to), GitHub sends them back to integrations/github, and the page lists the repositories the App's installations reach. The environment's Resources tab gets a form that creates an application from a repository, a branch and the path of shipkeep.yml, and a Git application's configuration shows read-only with where to change it. Signed-off-by: samuel mbabhazi <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
It shows an image for an image application and the repository and branch for a Git one (#213), as the maintainer asked when validating #528. Signed-off-by: samuel mbabhazi <[email protected]>
Signed-off-by: samuel mbabhazi <[email protected]> # Conflicts: # apps/api/openapi.json # apps/api/prisma/migrations/20261127100000_git_applications/migration.sql # apps/api/prisma/schema.prisma # apps/api/src/modules/apps/application/application-commands.ts # apps/api/src/modules/apps/application/ports.ts # apps/api/src/modules/apps/domain/application.ts # apps/api/src/modules/apps/git-applications-http.integration.spec.ts # apps/api/src/modules/apps/infrastructure/prisma-application.store.ts # apps/api/src/modules/apps/interface/application.dto.ts # apps/api/src/modules/git/application/github-sources.ts # apps/api/src/modules/git/infrastructure/github-api.client.ts # packages/api-client/src/gen/openapi.ts
This file contains hidden or 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
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.
What changed
Part of #213: the web side of Git applications. UI change: the maintainer validates it before merge. Until #526 merges, this pull request also shows #526's commits; its own commit is
a02207b./orgs/:id/integrations) replaces the Preview screen with a live page:https://github.com. Others read that an owner creates it.integrations/github: where GitHub sends the owner back. It givescodeandstateto the control plane once, then leaves for the integrations without them in the URL.https://github.com/apps/<slug>pages are linked.shipkeep.yml. Each refusal of the API (feat(api): create an application from a GitHub repository (part of #213) #526) gets its own words. The list shows a Git application asowner/repo · branch.shipkeep.ymlshows read-only, with which repository, branch and path it comes from, and that a push deploys it unless the environment is protected.form-action 'self' https://github.com, for the manifest form.requestProblemkeeps anappUrldetail when it is a GitHub App page.Why
#213's application side needs a way to connect GitHub and choose a repository without calling the API by hand.
How it was tested
github.browser.spec.ts, Chromium against the production build, real API and PostgreSQL, with a fake GitHub on both sides:installationwebhook arrives, and the repository lists;acme-corp/billing · main;form-action 'self', the test fails, because the form never reaches GitHub.weblint, typecheck and tests (63 files) andapilint, typecheck and unit tests (941) pass.Security considerations
https://github.com, and the page refuses to post anywhere else.codeandstateonce, over the session, and removes them from the address.