Skip to content

Build App Platform services as images so DigitalOcean needs no GitHub link - #28

Merged
juicycleff merged 1 commit into
mainfrom
do-app-platform-images
Nov 25, 2026
Merged

juicycleff merged 1 commit into
mainfrom
do-app-platform-images

Conversation

@juicycleff

Copy link
Copy Markdown
Contributor

Why

A DigitalOcean deploy failed with GitHub user not authenticated. App Platform built from the repository through DigitalOcean's own GitHub connection, and DigitalOcean's API has no way to set that connection up. Only someone signed in to DigitalOcean's control panel can.

What changes

  • Planning (internal/planning/app_platform.go): a DigitalOcean service or worker with a Dockerfile, or a Go module, gets a build target. It builds on the default runner pool, or on build.builder, and pushes to the account's DigitalOcean container registry, or build.registry. A registry outside DigitalOcean's, a CodeBuild builder, or a builder that doesn't build amd64 is a plan problem.
  • Fallback: static sites (App Platform can't run them from an image), services with no Dockerfile, and any service without a runner pool and DigitalOcean registry still build on App Platform from the repository. The plan warns that those need DigitalOcean's GitHub or GitLab link and says what's missing. Existing projects keep deploying.
  • Deploy (internal/deployments/digitalocean.go): checks that the reviewed registry is in the app's account before building, builds through ImageBuilder, and sets the component's image source (DOCR, repository, digest; registry only when the account has several). WaitImageDeployment checks that the live deployment's spec runs the built digest. Retries resume from the checkpoint.
  • Promotion and rollback: a promotion reuses the earlier image when both environments push to the same registry. A rollback returns to the recorded App Platform deployment and checks its image. A rollback across the switch between repository builds and image builds is refused. The rollback proof ignores the image's registry name, which comes and goes with the account's registry count.
  • Repository hosts: image builds skip the check that limits App Platform builds to repositories it can read, so a self-managed GitLab works.
  • Docs: the DigitalOcean page, the promotion table, the GitLab guide, how-it-works, and the regenerated agent docs index.

Setup it needs

  • The token needs the registry scope. Each image deploy lists the account's registries.
  • The DigitalOcean container registry must be added under Integrations, from the DigitalOcean account.
  • A runner pool must build for the project.

Verification

  • go test passes for internal/planning, internal/deployments, internal/clouds/digitalocean, extensions/planning and internal/agentknowledge.
  • golangci-lint is clean on the same packages.
  • New tests cover planning (default pool, each fallback case, static sites, foreign registry, arm builder, promotion reuse, repository hosts, rollback) and the deploy path (spec shape, several registries, registry outside the account checked before building, wrong digest refused, image rollback).

Not verified against real DigitalOcean. Its app spec reference doesn't say whether App Platform pulls a same-team DOCR image without credentials, whether it accepts a nested repository path like loomplane/api, or what format the digest takes. These tests use a fake App Platform API. A real deploy should confirm all three before this is relied on.

… link

DigitalOcean's API can't connect a GitHub or GitLab account to App
Platform; only someone signed in to its control panel can. A deploy
without that link failed with "GitHub user not authenticated".

A DigitalOcean service or worker with a Dockerfile, or a Go module, now
plans a build target: the default runner pool builds it, and it's pushed
to the account's DigitalOcean container registry, the only one App
Platform pulls from without a password. The app runs the image by
digest, and the wait checks the live deployment runs that digest, so
nothing at DigitalOcean reads the repository and any repository host
works. The registry is checked against the app's account before
anything builds.

Static sites, which App Platform can't run from an image, and services
with no Dockerfile still build on App Platform from the repository. So
does every service until a runner pool and a DigitalOcean registry are
set up, so existing projects keep deploying; the plan warns what's
missing. Promotions reuse an image pushed to the same registry, and a
rollback returns to the recorded deployment and checks its image. A
rollback across the switch between the two kinds of build is refused.

Verified: go test for internal/planning, internal/deployments,
internal/clouds/digitalocean, extensions/planning and
internal/agentknowledge; golangci-lint on the same packages. Tested
against a fake App Platform API only: whether App Platform pulls a
same-team DOCR image without credentials, accepts a nested repository
path, and takes a sha256: digest isn't stated in its docs.
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loomplane-docs Ready Ready Preview Nov 25, 2026 3:11am UTC

Request Review

@juicycleff
juicycleff merged commit 668c683 into main Nov 25, 2026
30 checks passed
@juicycleff
juicycleff deleted the do-app-platform-images branch November 25, 2026 14:52
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