Skip to content

fix(blueprint): show why an update preview timed out - #2912

Merged
rmnbrd merged 5 commits into
stagingfrom
fix/blueprint-preview-timeout-reason
Aug 28, 2026
Merged

fix(blueprint): show why an update preview timed out#2912
rmnbrd merged 5 commits into
stagingfrom
fix/blueprint-preview-timeout-reason

Conversation

@Astach

@Astach Astach commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What:
The preview socket's timeout branch now reads the frame's message and passes it to the failure panel as reason, exactly as the error branch already does. The domain outcome gains an optional message to carry it.

Why:
The engine now bounds a preview's terraform run and reports hitting that bound as a timeout naming which step ran out of time and after how long, which q-core publishes as {"type":"timeout","message":...} instead of an error. The console discarded that message, so shipping the backend work alone would have been a net regression: the same condition arrives today as type=error, whose message the console does render, so users would have gone from a specific reason to "The preview timed out before completing." and nothing else.

Notes:
message is optional because two producers have no reason to report: the 12min client-side watchdog, and the gateway's own synthesized frames.

TimeoutFrame exists only because the pinned qovery-ws-typescript-axios (0.1.644) predates the field. The field is on the wire today, so reading it is correct before the client bump; the generated websocket schema now declares it string | null and not required, so the alias can be deleted once the client is regenerated.

Worth knowing for the next person: nothing here could have failed a build. The WS layer is an unvalidated JSON.parse, ts-pattern matches structurally, and .exhaustive() checks variants rather than fields — so a dropped field is invisible to both the type checker and the tests.

Screenshots / Recordings

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

Summary by cubic

Blueprint update previews that time out now show why, matching how failed previews already show their error. The socket's timeout branch reads the frame's message and passes it to the failure panel as reason; previously the message was discarded and users saw only "The preview timed out before completing."

message is optional because the client-side watchdog and gateway frames don't always include one. The pinned qovery-ws-typescript-axios is bumped to 0.1.646 so the field is typed. Merge before the q-core change; reversed, engine timeouts briefly lose the detail users see today.

Written for commit 735f615. Summary will update on new commits.

Review in cubic

@nx-cloud

nx-cloud Bot commented Aug 27, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 735f615

Command Status Duration Result
nx run console:build --parallel=3 --configurati... ✅ Succeeded 1m 5s View ↗
nx affected --target=test --parallel=3 --config... ✅ Succeeded 3m 14s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 2m 54s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-28 13:17:29 UTC

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.49%. Comparing base (1feda76) to head (735f615).

Additional details and impacted files
@@           Coverage Diff            @@
##           staging    #2912   +/-   ##
========================================
  Coverage    48.49%   48.49%           
========================================
  Files         1303     1303           
  Lines        28117    28117           
  Branches      8215     8215           
========================================
  Hits         13634    13634           
  Misses       12187    12187           
  Partials      2296     2296           
Flag Coverage Δ
unittests 48.49% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

Re-trigger cubic

Astach added 3 commits August 28, 2026 11:07
Why:
A blueprint update preview that times out says only that it timed out. Users cannot tell whether
their change is too slow, something is stuck, or a retry would help.

What:
A timed-out preview now shows the reason underneath — which step ran out of time and after how
long — the way a failed preview already shows its error.

Notes:
Merge before the q-core change. Reversed, engine timeouts briefly lose detail users see today.

Nothing here could have failed a build: the WS layer is an unvalidated `JSON.parse`, ts-pattern
matches structurally, and `.exhaustive()` checks variants rather than fields — so the dropped field
was invisible to both the type checker and the tests.
Why:
The comment opened by restating what the field obviously holds before reaching the part that
actually matters — why the type was declared locally at all.

What:
It says only that the pinned ws client predates the field, and that the alias goes when the client
is regenerated.
Why:
The local frame type existed only to bridge a websocket client that predates the field. Keeping it
would ship a cast that outlives its reason and cost a second PR to remove.

What:
The timeout branch reads `message` straight off the generated frame, like the error branch beside
it.

Notes:
This does not typecheck until package.json pins a client regenerated from the openapi-spec change:
`tsc` fails with one error on that line and nothing else. Jest is unaffected — the field is on the
wire today, so all 24 tests pass.
@Astach
Astach force-pushed the fix/blueprint-preview-timeout-reason branch from e07a405 to 5b2a31e Compare August 28, 2026 09:08
Astach added 2 commits August 28, 2026 15:01
Why:
The timeout branch reads a field the pinned client did not declare, so the console did not build.

What:
The console builds again, with the timeout reason typed the way the websocket schema declares it.

Notes:
The lockfile delta is that one entry; nothing else moved. `message` arrives optional and nullable,
which is why the mapping keeps its `?? undefined`.
@rmnbrd
rmnbrd enabled auto-merge (squash) August 28, 2026 13:18

@rmnbrd rmnbrd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

@rmnbrd
rmnbrd merged commit ec08033 into staging Aug 28, 2026
9 checks passed
@rmnbrd
rmnbrd deleted the fix/blueprint-preview-timeout-reason branch August 28, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants