Repository navigation
Install app templates with one click - #234
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 8fe937b | Nov 19 2026, 11:52 PM |
tnkuehne
force-pushed
the
feat/template-installs
branch
from
November 19, 2026 22:55
469444b to
b7c7c1c
Compare
tnkuehne
force-pushed
the
feat/template-installs
branch
from
November 19, 2026 23:37
98f8c2e to
a1a0583
Compare
tnkuehne
force-pushed
the
feat/template-installs
branch
2 times, most recently
from
November 19, 2026 23:45
593ffb9 to
4c76ff9
Compare
When an app builder is configured, the template page, the API
(POST /api/v1/catalog/templates/{templateId}/install) and the CLI
(`widefleet catalog templates install`) build a template's sources at the
current commit and deploy them as an app in the organization. The control
plane resolves the app first, so app permissions apply before any build, and
publishes through the same upload path as `widefleet deploy`.
Hosted installations bind the builder's two phases as APP_BUILDER and
APP_DOCUMENTER; self-hosted installations set PLATFORM_APP_BUILDER_URL to a
builder on a private network. Without a builder, templates keep the agent
setup prompt only.
Template sources exclude *.test.* and *.spec.* files beside the code as well as test directories. Each builder phase gets a five-minute deadline, also through service bindings, which cannot take the control plane's abort signal.
The page installs into an app named like the template; the API and CLI keep the optional name.
An install now always creates a new app. A taken name ends the install before any build work, and the template page then shows a name field. The app is created only after a successful build, so a failed build leaves the name free for the next attempt.
Storage can fail after an install created its app and before a deployment was queued. A retry under the same name now continues into that empty app instead of reporting the name as taken; apps with any deployment still end the install.
An empty app could be deployed by someone else while the template built. Publishing now checks, under the app's row lock and until the deployment is queued, that the app has no deployment, and the install ends with a name conflict otherwise.
tnkuehne
force-pushed
the
feat/template-installs
branch
from
November 19, 2026 23:51
134d035 to
8fe937b
Compare
tnkuehne
added a commit
that referenced
this pull request
Nov 20, 2026
Hosted installations now deploy the app builder from #232 and bind it to the control plane, which turns on one-click template installs from #234. `deploy-hosted.ts` deploys the same builder Worker twice, as `<name>-app-builder` for `/bundle` and `<name>-app-documenter` for `/document`, so each build phase runs in its own isolate. Both deploy before the control plane, which binds them as `APP_BUILDER` and `APP_DOCUMENTER`. They have no workers.dev or preview URLs and no routes, so only the control plane reaches them. The builder's base configuration is `packages/app-builder/wrangler.jsonc`: the prebuilt `dist/builder.js` with its two WebAssembly modules attached as compiled Wasm, and a CPU limit of 120 seconds for large dependency graphs. The deployment stops with build instructions when the builder or its modules are missing. Hosted deployments therefore build the service documentation module (`cargo build --profile wasm -p platform-service-docs-wasm --target wasm32-wasip1`) and the builder (`pnpm --filter @platform/app-builder build`) before deploying. Stacked on #234. Self-hosted installations follow in a separate change. Validation: `pnpm check`; `hosted-installation.test.ts` (16 tests, including `RUN_CLOUDFLARE_TESTS=1` after `build:cloudflare`) covers both builder configurations and the control plane's bindings. A Wrangler dry run uploads `builder.js` with both modules (25.6 MB, 6.6 MB gzip); CI repeats it in the Rust suite after building the builder. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=113290441&sig=22c4f58bc9a1a179c1e9eee835d1c1f751c3ced826570c1f985601357e275cdb"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=mendra&next=%2Fwidefleet%2Fwidefleet%2Fpull%2F235&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 5/5</h2> <!-- greptile-impact-verdict --> The PR appears safe to merge; no blocking issues were found. <details open><summary><h3>Summary</h3></summary> Hosted installations now deploy separate Workers for app bundling and service documentation, enabling one-click template installs. - Hosted installs now run app bundling and documentation in separate Workers. No actionable issues found. Tests were not run during this review. </details> <details open><summary><h3>Diagram</h3></summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart LR D[Hosted deployment] --> B[Deploy bundler Worker] B --> S[Deploy documentation Worker] S --> C[Deploy control plane] C -->|APP_BUILDER: /bundle| B C -->|APP_DOCUMENTER: /document| S ``` </details> <!-- greptile_confidence_score:5 --> <sub>Reviews (8) · Last reviewed commit: ["Deploy the app builder with hosted insta..."](aa9a6e8) · [Reviewed by Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub> <!-- /greptile_comment -->
tnkuehne
added a commit
that referenced
this pull request
Nov 20, 2026
Self-hosted installations get the app builder from #232 as a Compose service, so one-click template installs (#234) work there as on hosted installations (#235). - The runtime image builds the service documentation module and the app builder and ships them in `/opt/widefleet-builder`, with the tsrs license. No new image or registry repository: the builder uses the runtime image's celld. - `packages/app-builder/build.ts` also writes `dist/wrangler.json`, a celld project with the Worker's name and compatibility date. celld rejects the hosted-only keys of `wrangler.jsonc` (`base_dir`, `limits`, `observability` …); Wrangler does not upload the file. - Compose runs the `builder` service with `celld dev --no-watch`: one stateless node with local storage on a tmpfs, so the builder holds no storage credentials. It runs read-only without capabilities, publishes no port and shares the `builder` network only with the control plane. It reaches the npm registry for dependencies. The control plane gets `PLATFORM_APP_BUILDER_URL=http://builder:8080`. - The local demo starts the builder too. Tests: - `compose.test.ts` checks that only the builder and the control plane are on the builder network, that the builder has no ports, volumes or credentials, and that the control plane finds it. - `builder-container.test.ts` (packaged-runtime suite) starts the Compose service from the runtime image and bundles, documents and rejects a project. - Locally, the container also built and documented the gmail, github and onedrive templates with their npm dependencies. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=113431912&sig=9586ddbfc2a47758bc5d806944ebc5c4494de6abec908fc1a818e90f0202796d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=mendra&next=%2Fwidefleet%2Fwidefleet%2Fpull%2F236&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 5/5</h2> <!-- greptile-impact-verdict --> The PR appears safe to merge. <details open><summary><h3>Summary</h3></summary> Self-hosted installations and the local demo now run the app builder from the runtime image. - Self-hosted installs can build templates through a private app builder. The previously reported startup issue is fixed: starting the control plane now starts the builder and waits for it to be healthy. No new actionable issues were found. Container tests were inspected, not run. </details> <details open><summary><h3>Diagram</h3></summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart LR C[Control plane] -->|Private Compose network| B[Builder service] B --> N[npm registry] I[Runtime image] --> B I --> R[App runtime] B --> W[Bundled app and documentation] ``` </details> <!-- greptile_confidence_score:5 --> <sub>Reviews (8) · Last reviewed commit: ["Start the app builder with the control p..."](dc9785e) · [Reviewed by Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub> <!-- /greptile_comment -->
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.
Installations with an app builder can install a template in one step from its catalog page, the API or the CLI. Widefleet builds the template's sources at the current commit and deploys them as an app in the organization; the template page then continues with its remaining setup steps.
POST /api/v1/catalog/templates/{templateId}/installwith an optionalnamereturns the app, the deployment and build warnings; a taken name is a 409. Templates reportinstallable.widefleet catalog templates install <template> [--name <app>]prints the same result as JSON and allows ten minutes for the build.The control plane loads the template directory at one commit (using
GITHUB_TOKENwhen set) without its tests, checks the creator permission and the name before building, calls the builder's/bundleand/documentphases from #232, creates the app only after a successful build so a failed build leaves the name free (a retry after a failed publish continues into the empty app), and publishes through the same upload path aswidefleet deploy. Builder project errors become 400 responses with the builder's message; an unreachable builder is a 503.Hosted installations bind the two phases as
APP_BUILDERandAPP_DOCUMENTER; self-hosted installations setPLATFORM_APP_BUILDER_URLto a builder on a private network that only the control plane joins. Deploying the builder for each installation type follows in separate changes, so this change leaves existing installations as they are.Stacked on #232.
Screenshots
Template page, 1280 px light, before and after:
390 px light before and after, 1280 px dark before and after:
Installing (1280 and 390 px), the deployment history after the redirect, and 390 px dark:
A taken name: the page asks for another (1280 px light and dark, 390 px light and dark, 390 px with a new name):
Checked with the built Node server, synthetic template repository and a synthetic builder at 390 and 1280 px in light and dark: the default and installing states, a taken name followed by an install under a new name, the redirect to the deployment history, and the page without a builder, which matches main. Not checked visually: the form without JavaScript, and builder failures in the browser (covered by API tests).
Validation
pnpm check, the fullpnpm exec vitest run(1121 tests) andcargo fmt --checkpass.template-installs.integration.test.tscovers the install through the API against PostgreSQL with a synthetic builder: sources without tests, the published artifact's modules, bindings, source map name and documentation, a taken name ending the install before the build, an install under another name, an install into an app that was never deployed, failed builds leaving no app, reserved names, builder errors, unavailable builders, missing templates, and installations without a builder.RUN_CLI_TESTS=1covers the CLI command, its request and invalid template IDs.

Confidence Score: 5/5
This PR appears safe to merge.Summary
Adds one-click template installs through the catalog page, API and CLI, using the app builder and the existing deployment path.
No new actionable issues found. The previous deployment-overwrite finding is fixed.
Reviews (11) · Last reviewed commit: "Recheck under the app lock that a templa..." · Reviewed by Greptile