feat(hosting): render deploy event type and outcome in deploy history - #6681
Draft
nicacioliveira wants to merge 6 commits into
Draft
feat(hosting): render deploy event type and outcome in deploy history#6681nicacioliveira wants to merge 6 commits into
nicacioliveira wants to merge 6 commits into
Conversation
…e BFF proxy
Adds a per-site "Hosting" tab (deployments / env / redirects) that appears
next to CMS only when the deployment configures the Deco control-plane REST
integration. Data is proxied server-side so the service token never reaches
the browser — the client only sees `hostingEnabled` and the proxied JSON.
Server (apps/api):
- settings: add controlplaneRestUrl / controlplaneServiceToken (env-mapped)
- routes/hosting.ts: BFF proxy GET /:site/{deployments,env,redirects}, 503
when unconfigured, propagates upstream non-2xx
- mount at /api/:org/hosting; expose hostingEnabled on /api/config
Client (apps/web):
- new "hosting" system tab (Server01 icon), gated on publicConfig.hostingEnabled
- HostingTab renders control-plane reads via useQuery + @decocms/ui tables
- query-key constants + en/pt-br i18n
Read-only prototype for design + platform review. Write/deploy actions TBD.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…type Baseline commit capturing the pre-existing, previously-uncommitted native Hosting/E2E/Analytics tabs prototype (control-plane BFF proxy) so the deploy type/outcome feature can land as an isolated follow-up commit on top. Also wraps three interpolated classNames in e2e-run-detail with cn() to satisfy the require-cn-classname lint rule. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The control-plane deploy-history API now returns `type` (build | fast-deploy | deploy) and `outcome` (pending | success | failure) on each event. Surface both in the Studio-native Hosting tab's Deploy history: - add `type` / `outcome` to DeploymentHistoryEvent (the BFF proxies the control-plane JSON verbatim, so no passthrough change was needed) - a type badge (Build / Fast-deploy / Deploy) that falls back to the existing action badge for legacy rows without a `type` - an outcome badge using design-system variant tokens — success, destructive for failure, and a neutral "in progress" for pending — omitted on legacy rows - en + pt-br dictionary keys for the type and outcome labels Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nicacioliveira
marked this pull request as draft
August 28, 2026 14:08
The native hosting tab showed only CP-managed platform vars and store secrets, so a site's wrangler.jsonc `vars` (igor's DECO_* code vars) and secrets bound on the worker out-of-band were invisible. Render the control-plane read-back: - Env: a read-only "From wrangler.jsonc" block from the new `codeVars` field (kept separate from the editable replace-set so a save never promotes them). - Secrets: an "On worker" badge for `origin: "worker"` entries. i18n keys added (en + pt-br). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a Runtime/Build scope to the per-site Secrets UI: a selector on Add, a scope badge per row, and scope carried on PUT (body) + DELETE (query). A name may exist in both scopes. Build secrets are mounted by the build Job only; runtime secrets go to the runtime bundle. i18n en + pt-br. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Env section gains a Runtime/Build scope per variable (mirrors the secret scope): a scope Select on add, a scope badge per row, and add/edit/delete keyed by (name, scope) so a name may exist in both scopes. Build vars ride spec.build.envs (build Job only); runtime vars stay on serving.vars. Reuses the existing Runtime/Build i18n labels. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
The control-plane deploy-history API now returns
type(build|fast-deploy|deploy) andoutcome(pending|success|failure) on each event. This surfaces both in the Studio-native Hosting tab's Deploy history table, matching the feature just shipped in the control-plane.Per-history-row, in the Action cell:
type.success→success,failure→destructive,pending→ neutral "in progress" (with a clock icon). Omitted on legacy rows with nooutcome.Row layout unchanged otherwise — the two badges sit in a
flex flex-wrap gap-1.5wrapper in the same Action cell; the Commit / Framework / Actor / Date columns are untouched.i18n: added
typeBuild/typeFastDeploy/typeDeploy/outcomePending/outcomeSuccess/outcomeFailureundermainPanelTabs.hostingTab.*in bothenandpt-br(mirrored —bun run checkproves completeness).BFF
No passthrough change needed:
apps/api/src/api/routes/hosting.tsproxies the control-plane JSON verbatim (c.json(payload ?? {})) with no field whitelist/reshape, sotypeandoutcomealready reach the client.Notes on commits / base
This branch's first commit snapshots the pre-existing, previously-uncommitted native Hosting/E2E/Analytics tabs prototype (so this PR can compile against
main); the deploy type/outcome feature is the isolated second commit (hosting-tab.tsx+ the two i18n dictionaries, +85/-1). Review the second commit for the actual change. The baseline commit also wraps three interpolatedclassNames ine2e-run-detail.tsxwithcn()to satisfy therequire-cn-classnamelint rule.Gates
bun run fmt— cleanbun run lint— exit 0 (0 errors)bun run check— my three files produce zero TS errors. One pre-existing, unrelated error remains inpackages/mcp-utils(an ajv 8.18/8.20 local dedup artifact, untouched by this PR); theapps/benchmarkreadme-check failure is a local-only untracked dir and does not exist on CI.Do not merge/deploy.
Summary by cubic
Extends the per-site Hosting tab (gated by the
hostingEnabledconfig flag): deploy history rows now show deploy type and outcome badges, env vars and secrets gain Runtime/Build scopes, and read-only code vars plus worker-bound secrets are surfaced.Deploy history
Env & secrets
enandpt-brlabels for all new UI.The branch's first commit snapshots the previously-uncommitted Hosting/E2E/Analytics tabs prototype; the feature commits are isolated on top. Do not merge/deploy.
Written for commit 0a0de05. Summary will update on new commits.