Skip to content

feat(web): connect GitHub and create an application from a repository (part of #213) - #528

Merged
samuelmbabhazi merged 4 commits into
mainfrom
feat/213-github-web
Nov 27, 2026
Merged

samuelmbabhazi merged 4 commits into
mainfrom
feat/213-github-web

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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.

  • Integrations (/orgs/:id/integrations) replaces the Preview screen with a live page:
    • Without an App: an owner chooses their GitHub account or a GitHub organization and creates the App. The control plane returns GitHub's manifest URL and the manifest. The page posts them to GitHub as a form, only when the URL's origin is https://github.com. Others read that an owner creates it.
    • With the App: its name and owner account, with "Install on repositories" and "Open on GitHub". The repositories its installations reach show with their default branch and whether they are private. Unreachable installations and truncation are said.
    • GitLab, Gitea and Bitbucket are said to be planned. No sample data.
  • integrations/github: where GitHub sends the owner back. It gives code and state to the control plane once, then leaves for the integrations without them in the URL.
    • An expired or used link says so.
    • An App GitHub created that could not be kept links to its page, for deletion. Only https://github.com/apps/<slug> pages are linked.
  • The environment's Resources tab: a "From a GitHub repository" form: repository (each proposes its default branch), branch, and the path of 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 as owner/repo · branch.
  • New resource: the GitHub repository card is live and opens that form.
  • A Git application's page: its shipkeep.yml shows read-only, with which repository, branch and path it comes from, and that a push deploys it unless the environment is protected.
  • CSP: form-action 'self' https://github.com, for the manifest form.
  • requestProblem keeps an appUrl detail when it is a GitHub App page.
  • French translations for every new text.

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

  • Unit tests (14 new):
    • the manifest posted as a form to GitHub only, with the organization name trimmed;
    • non-owners see no form;
    • the App, its links and its repositories; GitHub unreachable, then "Try again";
    • the return page: connected, then redirected; invalid; not kept, with the App link; unreachable;
    • the form: the body sent, default branches, the refusal texts, no App, no repository.
  • Browser test github.browser.spec.ts, Chromium against the production build, real API and PostgreSQL, with a fake GitHub on both sides:
    • an owner creates the App; Playwright stands in for github.com and checks the posted manifest (private, named for the organization), then redirects back with a code;
    • a signed installation webhook arrives, and the repository lists;
    • an application is created from it, and the list shows acme-corp/billing · main;
    • no console error and no CSP report.
    • Mutation check: with form-action 'self', the test fails, because the form never reaches GitHub.
  • web lint, typecheck and tests (63 files) and api lint, typecheck and unit tests (941) pass.
  • Screenshots, desktop and 390 px, English and French: on the review page linked in the conversation.

Security considerations

  • The CSP gains one form target, https://github.com, and the page refuses to post anywhere else.
  • The manifest holds no secret. GitHub returns the App's secrets to the control plane, never to the browser.
  • The return page sends code and state once, over the session, and removes them from the address.
  • Links in refusals are limited to GitHub App pages.

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]>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 15c0840 and 42b42d5.

Files selected for processing: 17

  • apps/api/src/platform/http/web-app.ts
  • apps/api/src/testing/github.browser.spec.ts
  • apps/web/src/app/app.routes.ts
  • apps/web/src/app/dashboard/new-resource-page.ts
  • apps/web/src/app/delivery/application-page.ts
  • apps/web/src/app/delivery/applications-panel.ts
  • apps/web/src/app/delivery/configuration-editor.ts
  • apps/web/src/app/delivery/delivery-api.ts
  • apps/web/src/app/delivery/github-application-form.spec.ts
  • apps/web/src/app/delivery/github-application-form.ts
  • apps/web/src/app/identity/identity-api.ts
  • apps/web/src/app/integrations/github-api.ts
  • apps/web/src/app/integrations/github-return-page.spec.ts
  • apps/web/src/app/integrations/github-return-page.ts
  • apps/web/src/app/integrations/integrations-page.spec.ts
  • apps/web/src/app/integrations/integrations-page.ts
  • apps/web/src/app/ui/fr.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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
@samuelmbabhazi
samuelmbabhazi merged commit 720aed0 into main Nov 27, 2026
27 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/213-github-web branch November 27, 2026 09:07
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.

1 participant