Repository navigation
Keep API documentation in artifact storage and raise its limits - #290
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 7f2a0f3 | Nov 22 2026, 03:22 PM |
tnkuehne
force-pushed
the
feat/service-documentation-storage
branch
from
November 22, 2026 13:35
be8c2e3 to
3e131ae
Compare
This was referenced Nov 22, 2026
Service documentation was stored inside artifact metadata, which about twenty control-plane reads load and validate. Publishing now writes the document to artifact storage, under the key the app runtime already reads, and keeps only a small summary in a new artifact column. The API description, the agent package lease and the catalog read the document or summary where they need it, and Hosted deployments no longer copy it. The limits grow to 1,024 methods, 4,096 types, 262,144 characters per text and 8 MiB per document, so generated clients for large APIs can be documented. Artifacts published before this change keep no documentation until the app is deployed again.
The metadata part of a worker upload kept its 64 KiB limit including the documentation, so documentation within the new limits failed the upload. The documentation now counts against its own 8 MiB limit and the rest of the metadata keeps 64 KiB. A publish can write documentation and then roll back. A retry of that session without documentation now fails instead of publishing an artifact whose runtime key still holds the first attempt's document. The browser test for service documentation publishes its fixtures through storage and the artifact summary.
The service documentation test now writes documentation to artifact storage, which the default bucket does not provide on a fresh test service.
The CLI now sends API documentation as a separate multipart part instead of a field inside the worker metadata. Metadata keeps its 64 KiB limit unchanged, the documentation part has its own 8 MiB limit, and the metadata contract no longer carries documentation at all. Publishing checks that documentation describes only the entrypoints the worker publishes, which the metadata schema checked before.
tnkuehne
force-pushed
the
feat/service-documentation-storage
branch
from
November 22, 2026 15:21
3e131ae to
7f2a0f3
Compare
tnkuehne
added a commit
that referenced
this pull request
Nov 22, 2026
## Why With #290 an app can publish documentation for large APIs (hundreds of methods, thousands of types). MCP `describe` and `widefleet services describe` still returned an entrypoint's whole document with every type, which floods an agent's context before it calls anything. ## What changes **MCP** - `search` returns **methods**: hostname, entrypoint, method and the first line of its summary, best matches first. `hostname` and `entrypoint` filters narrow a query or, without words, list every method of a service. They replace the former "exact hostname as query" rule. - `describe` takes `methods` (1–20) and returns the entrypoint's documentation with only those methods, plus the types their signatures use, directly or through other types. - The service index stores one entry per method (format 2). Indexes of the earlier format are rebuilt like expired ones. Entrypoints without documented methods are not listed, since `call` only reaches methods. **API and CLI** - `GET /app-services/{service}` returns `documented`, the list of methods with summaries, and `documentation: null`. With `entrypoint` and `methods` (comma-separated), `documentation` holds the selected methods and their types. - `widefleet services describe APP [--entrypoint NAME] [--method NAME]…` - The API reference page in the control plane keeps the complete documentation (`connections.reference`). Selecting methods and their types is shared contract logic (`selectServiceMethods`, `listServiceMethods`), used by the runtime and the control plane. ## Verification - `pnpm check` - `pnpm exec vitest run` (all suites) - `RUN_SERVICE_TESTS=1 pnpm exec vitest run apps/control-plane/tests/app-services-runtime.test.ts` (workerd and celld) - `RUN_CLOUDFLARE_TESTS=1 pnpm exec vitest run apps/control-plane/tests/cloudflare` - `RUN_CLI_TESTS=1 pnpm exec vitest run apps/control-plane/tests/app-services-cli.test.ts apps/control-plane/tests/service-documentation.test.ts` with a freshly built CLI - `pnpm exec playwright test tests/e2e/auth.spec.ts` - `bash tools/cargo.sh clippy -p platform-cli --all-targets -- -D warnings`, `fmt --all --check` Documentation: #298 (draft until a release includes #290 and this PR). <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=115781343&sig=ba35fdbf0170c98e3c6618b2f7aae8f198a6e4dd455c4745161612814adb2ebf"><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%2F297&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, with the documentation updates supplied by PR #298. <details open><summary><h3>Summary</h3></summary> Changes API discovery from whole services to individual methods. - MCP search returns matching app methods. - MCP describe returns documentation for selected methods. - The API and CLI list methods and describe selected ones. No new actionable issues were found. Tests were inspected, not run. </details> <details open><summary><h3>Diagram</h3></summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart LR A[Published API documentation] --> B[Method index] B --> C[MCP search] A --> D[selectServiceMethods] D --> E[MCP describe] D --> F[HTTP and CLI selected descriptions] A --> G[Complete reference page] ``` </details> <!-- greptile_confidence_score:5 --> <sub>Reviews (4) · Last reviewed commit: ["Match type names only as whole names"](1701c54) · [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.
Why
API documentation travelled inside
artifact.metadata. About twenty control-plane reads load that column (catalog, network, workflows, telemetry, jobs, uploads …) and validate the whole document each time. That was fine at the old 256 KiB limit, but generated clients for large APIs need far more: a GraphQL API such as Linear's has about 500 operations and 1,000 types, and single type definitions exceed 32,768 characters.What changes
apps/{appId}/service-documentation/{artifactId}.json, the key the app runtime already reads, and stores a small summary in the newartifact.documentationcolumn (hash plus, per entrypoint, whether it documents anything).metadatano longer carries the document.__widefleet_documentation(the platform prefix keeps it apart from module names), instead of a field inside the worker metadata. Metadata keeps its 64 KiB limit; the documentation part is bounded by the documentation limit. The metadata contract no longer hasservice_documentation, and publishing checks that the documentation only describes published entrypoints.MCP
describestill returns a whole entrypoint. Per-method search anddescribefollow in a separate PR, before any app publishes documentation of this size.Verification
pnpm checkpnpm exec vitest run(all suites afterpnpm -C apps/control-plane buildandbuild:cloudflare)RUN_SERVICE_TESTS=1 pnpm exec vitest run apps/control-plane/tests/app-services-runtime.test.tspnpm exec playwright test tests/e2e/auth.spec.tsRUN_CLOUDFLARE_TESTS=1 pnpm exec vitest run apps/control-plane/tests/cloudflareRUN_CLI_TESTS=1 pnpm exec vitest run apps/control-plane/tests/service-documentation.test.ts apps/control-plane/tests/app-services-cli.test.tswith a freshly built CLIbash tools/cargo.sh test -p platform-service-docs -p platform-cli -p platform-core,clippyon those crates andplatform-agentwith--all-targets -D warnings,fmt --all --check

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues remain.Summary
Moves API documentation from
artifact.metadatainto artifact storage, with a small summary inartifact.documentation.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR CLI[CLI or template builder] --> Upload[Publish worker and documentation] Upload --> Storage[Artifact storage: full document] Upload --> Database[Database: hash and entrypoint summary] Database --> Catalog[Service catalog] Database --> Reader[Service description or agent packages] Storage --> Reader Storage --> Hosted[Hosted runtime]Reviews (5) · Last reviewed commit: "Upload API documentation as its own part" · Reviewed by Greptile