Repository navigation
refactor(ui)!: take the dashboard's API paths from the generated client - #625
Draft
PiquelChips wants to merge 2 commits into
Draft
PiquelChips wants to merge 2 commits into
PiquelChips wants to merge 2 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
The dashboard wrote its manifest download link and its two event streams' paths by hand, and the client its TOML, local preview and exec requests' paths, so a route could change under them unnoticed. generate_openapi now also writes piqueld_client::paths, one function per operation named like its client method, from the OpenAPI document, and they take their paths from it. API_PREFIX, which nothing uses any more, goes. Fixes PQD-162
The path functions are named after the API's operation IDs, as the generated client's methods are, not like the public Client methods; the docs now say so. The generator names them with heck's snake case, as Progenitor does, so the two can't disagree, and takes the document's paths from run() instead of reading them again. Part of PQD-162
PiquelChips
force-pushed
the
refactor/client-boundary-api-paths
branch
from
November 22, 2026 22:12
2455bd9 to
8a3df82
Compare
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 and why
The dashboard wrote some API paths by hand (the manifest download link, and the operation timeline and event streams it opens with
EventSource), as did the client for the requests Progenitor can't generate (TOML apply and plan, the local preview upload, the exec WebSocket). Nothing tied those strings to the API, so a route could change under them unnoticed.generate_openapinow also writespiqueld_client::pathsfrom the OpenAPI document: one function per operation, named after its operation ID as the generated client's methods are (withheck, as Progenitor names them), that builds the path with string parameters percent-encoded as the client encodes them. The dashboard and the client's hand-written requests take their paths from it, andjust openapi-checkkeeps it current.API_PREFIX, which nothing uses any more, goes (a public Rust item ofpiqueld-coreandpiqueld-client; the HTTP API is unchanged, andgenerated.rsandopenapi-v1.jsondon't change).The links and streams stay as they are: the browser downloads the manifest from the link and reconnects the
EventSourcestreams itself, so they need a URL rather than a client call. What's left in the dashboard is a doc comment namingGET /api/v1/system/checks; the client keeps its/api/v1/auth/prefix checks in its transport, which test a namespace, not a route.Fixes PQD-162
Proved with
just openapi-check,just ui-check,just check-wasm, wasm32 and native Clippy for the changed crates and the generator, andjust docs.cargo test -p piqueld-clientpasses.just test-playwright tests/editor.spec.ts tests/deployments.spec.tscould not run locally: the overloaded host Docker engine took over 120 seconds to create the browser container, three times. The Playwright job runs both specs once this is marked ready.Checklist
AGENTS.mdit applies to,documentation included, with its reverse states. (A refactor: no surface changes; the module-boundaries page and the client-generation README describe
paths.)Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)