mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-01 21:05:42 +09:00
005e408efbab7a795dda347d7c82d2c6ab8a7f45
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
896a383e32 |
feat: show publish logs in Builder, CLI, and MCP (#6690)
Staging work for publish diagnostics. This PR pairs with webstudio-is/webstudio-saas#681. No production release is authorized. ## What changes People can open Diagnostics from a domain or static export to see warnings, errors, and publishes from the current Builder session. Each publish has its own collapsible report and copy control. A failed publish keeps a short reason and links to its own log when that publish was accepted. Builder, CLI, and MCP use the same publish reference and log access path. Status and logs stay separate. Builder keeps session reports in memory, and Edge retrieves available output from the current publish runner. Reloading Builder loses session reports. An unavailable log does not change publish success or failure. Log pages still require runner retrieval and transfer through Edge and Builder; there is no Webstudio log archive in this PR. The UI now keeps publish state in its owning component, with separate site and static actions, focused diagnostics views, and one domain status control. Both actions share completion handling while retaining their different request and download behavior. Late best-effort checks cannot erase a final rejection. A new rejected request does not make an older publish look like its log. Site errors stay scoped to the selected domains. The existing site and asset publish paths are unchanged. ## Checklist - [x] Keep confirmed session success ahead of stale Build timeout during popover reconciliation; cover an old Build timestamp. - [x] Retry a temporarily pending or failed publish-log read before marking it unavailable; cover session behavior. - [x] Verify CI on the rebased PR head and confirm review threads remain resolved. - [x] Let a matching session's confirmed result clear stale pending controls for site and static; cover success and failure. - [x] Remove redundant static-export loading icon while keeping the export button's pending state and diagnostics access. - [x] Prefer confirmed runner success over a timeout inferred from a stale matching Build; cover site and static publishes. - [x] Keep MCP publish input valid when a target union is converted to tool JSON Schema; cover both the adapter and real CLI contract. - [x] Finish an accepted publish by its build ID even if another publish becomes the project's latest; cover site and static behavior. - [x] Review docs impact, verify local checks and CI, and reply to the new review threads. - [x] Keep current validation findings ahead of an older publish success notice; cover rejected requests and manual validation. - [x] Scope accepted-publish status errors to the domains in that publish; cover another domain's Diagnostics. - [x] Make success, warning, and error publish notices distinct and readable in dark mode; use the existing PanelBanner variants and leave light mode unchanged.\n- [x] Review documentation impact and run focused tests, typecheck, lint, and CI for these fixes. The publishing guide needs no wording change. - [x] Resolve the four Builder review comments and push the focused fix. - [x] Split Diagnostics into findings, detail, publish history, and dialog shell without new copy or icons. - [x] Keep Warnings and Errors separate from Publish logs; preserve current-session history, log copying, and access checks. - [x] Consolidate site/static flow and quota reads; narrow UI access to flow internals. - [x] Preserve completed findings, final rejection, target/domain isolation, and accepted-build log links across both completion orders. - [x] Review the remaining publish UI; share the duplicated domain status control and leave cohesive baseline domain/export UI in place. - [x] Review authoritative publishing docs for this UI change. - [x] Correct the guide's statement that all validation errors block the request; the approved wording is in the publishing guide. - [x] Audit names introduced by this PR against their runtime values and existing repository terminology; fix misleading local names without changing stored or public contracts. - [x] Review docs impact of naming-only changes and verify tests, types, lint, and CI. Docs need no change; 179 publish tests, Builder typecheck, root lint, formatting, diff checks, and all non-visual CI on the previous commit passed. Visual approval remains open. - [x] Remove single-use publish hooks; keep their state/effects in the owning component and test behavior through that component. - [x] Split site and static publish actions into clear component-owned flows without the target-discriminated publish function. - [x] Review docs impact of the structural change. No user-facing copy or behavior changed, so no further docs change is needed. - [x] Verify migrated tests, coverage, Builder core tests, typecheck, lint, formatting, and package boundaries. - [x] Simplify publish component tests: share the tRPC test transport and use named Diagnostics options without losing behavior coverage. - [x] Replace the global fetch test stub with a scoped tRPC request interceptor for publish component tests. - [x] Simplify publish component tests again: share only reusable browser setup and interactions, remove duplicate scenarios and incidental assertions, and preserve behavior coverage. - [x] Review `trpc-interface` package exports and packed-package consumers. Keep the explicit source subpaths; no manifest change is needed. - [x] Review every test changed in this PR for avoidable module mocking; replace only clear cases without reducing behavior coverage. - [x] Update and validate the global testing skill with the decision learned from that review. - [x] Re-run focused tests and relevant checks for the module-mock cleanup. - [x] Finish non-visual CI on the current commit. - [x] Audit Builder-wide global fetch replacements and no-request spies; keep injected fakes and valid narrow spies. - [x] Replace backend-style global fetch stubs and the Storybook fixture override with scoped request handlers. - [x] Preserve success, HTTP/network failure, abort, cleanup, and no-request coverage with red/green checks. - [x] Run focused and broader Builder tests, typecheck, lint, formatting, and package-boundary checks for the fetch-test cleanup. - [x] Review docs impact of the test-only cleanup; no user-facing documentation changes are needed. - [x] Make user database tests verify ownership filters, inserted values, and workspace linkage. - [x] Make patch-service tests prove the intended patch was applied and remove vacuous cases. - [x] Add focused DomainCheckbox integration coverage while keeping useful helper cases. - [x] Make publish test transport fail on unexpected requests and distinguish protocol errors from network failures. - [x] Remove duplicate permission cases and run selected DOM-free tests in Node. - [x] Review documentation impact and run relevant red/green, test, type, lint, and config checks. - [x] Show the latest successful site publish and static export in their popovers with a See logs link to the Publish tab. - [x] Cover success, new-attempt reset, Free-plan access, and both flows in component tests. - [x] Review publishing docs and verify focused tests, types, lint, formatting, and diff. - [x] Review the three expected visual differences and approve the CI rerun; visual regression passed on a0c2ca73f. ## Verification Local: 177 publish tests passed after simplifying the component suites. Two duplicate scenarios were removed; the dedicated suites still cover network failures, paged logs, plan changes, and stale responses. The latest test cleanup removes 174 net lines. Builder production code is unchanged. The earlier test cleanup removed 135 net lines across seven files. Coverage increased from 84.2% statements / 83.3% branches to 88.63% / 86.98%. Builder core passed 1,698 tests with one skip. Builder typecheck, root lint, package-boundary check, formatting, and diff checks passed. Representative migrated tests were shown failing when project scoping, late-check isolation, session eviction, validation reset, or static download behavior was temporarily broken, then passing after restoration. The current commit passed the main workflow, lint, and submodule checks. Visual approval remains open for three previously identified story differences. The prior visual report had the same three known story differences; baseline approval remains open. The visual approval gate remains open for the previously identified story differences; no new local Storybook capture was run at the user's request. The agent evaluation suite remains 8/9 because of an unrelated Form-authoring failure; baselines were not changed. The Builder-wide test cleanup replaces 11 global fetch stubs and one Storybook override. It keeps two narrow no-send spies for a pure preview function. Focused checks passed (43 Node tests, 16 browser tests, typecheck, lint, formatting, package boundaries). Full local core and app runs each had one failure in an unchanged test; the app test passed alone, and the core failure reproduced in its unchanged file. CI will provide the full-matrix check. Local request-interception work remains; no product behavior changes. A follow-up review checked all 30 changed test files for module mocks. Two unnecessary wrappers were removed: the resource-preview call counter and the cross-origin guard fake. The real HTTP boundary and a cross-site request now carry those assertions. The narrow Email preview exception fake remains because malformed real inputs do not reach that catch reliably; seven older Preview-route mocks remain tied to auth, database, protected fetch, and environment setup. This test-only follow-up passed 41 focused tests, Builder typecheck, targeted lint/formatting, diff checks, and independent review. The global testing skill was updated and validated outside this repository. The previous commit's complete main CI passed; the visual baseline approval gate remains open. Commit |