Skip to content

ENG-1461: Show a clear error when the build log streamer connection is refused#3837

Open
mitchell-as wants to merge 1 commit into
version/0-48-1-RC3from
mitchell/eng-1461
Open

ENG-1461: Show a clear error when the build log streamer connection is refused#3837
mitchell-as wants to merge 1 commit into
version/0-48-1-RC3from
mitchell/eng-1461

Conversation

@mitchell-as

@mitchell-as mitchell-as commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

https://activestatef.atlassian.net/browse/ENG-1461

When you check out or install a project that still has to build, the State Tool opens a live connection to follow the build. The build server is going to start refusing that connection for callers it can't authenticate, and today being refused fails the whole command with an unhelpful error.

This teaches the State Tool to tell "you were refused" apart from a real build failure or a network hiccup, and to respond with something useful: sign in with state auth, or, if you're already signed in, check that your account has access to the project.

Based on version/0-48-1-RC3 rather than master; it reaches master through the normal release flow.

🤖 Generated with Claude Code

Detect a refused build-log-streamer stream as a distinct StreamDeniedError
rather than an opaque build failure. Both deny shapes from the ENG-1457
gate-policy spike are handled: a hard 401/403 on the Upgrade (a Connect dial
error) and a server soft-close (Upgrade accepted, then closed with no frames).

Because the stream is the only source of artifact download URIs for an
in-progress build, a denial there can't complete the install, so the runtime
now reports a clear authentication/authorization message instead of a raw
error. Genuine build failures and network errors are still surfaced, and an
already-built checkout never opens the stream, so it is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mitchell-as mitchell-as changed the title ENG-1461: State Tool graceful degradation on build-log WebSocket denial ENG-1461: Show a clear error when the live build connection is refused Jul 13, 2026
@mitchell-as mitchell-as changed the title ENG-1461: Show a clear error when the live build connection is refused ENG-1461: Show a clear error when the build log streamer connection is refused Jul 13, 2026
@mitchell-as mitchell-as requested review from MDrakos and Copilot and removed request for MDrakos July 13, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the State Tool’s handling of build-log streaming failures by distinguishing authentication/authorization denials from genuine build failures or transient network issues, and surfacing clearer, actionable errors to the user.

Changes:

  • Introduces a typed StreamDeniedError in the build-log streamer client and helper IsStreamDenied detection.
  • Detects and reclassifies “soft-close with no frames” websocket behavior as a stream denial.
  • Adds targeted tests covering upgrade-denial statuses and the soft-close denial shape.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/runtime/setup.go Maps stream-denial errors to clearer, user-actionable localized errors (unauthenticated vs unauthorized).
pkg/runtime/internal/buildlog/buildlog.go Propagates denial errors distinctly and detects soft-close-without-frames as denial.
pkg/runtime/internal/buildlog/buildlog_denial_test.go Adds regression test for soft-close-with-no-frames denial behavior.
pkg/platform/api/buildlogstream/streamer.go Adds StreamDeniedError and returns it on 401/403 websocket upgrade denials.
pkg/platform/api/buildlogstream/streamer_test.go Adds tests for denial classification, including 401/403 and non-auth handshake failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/platform/api/buildlogstream/streamer.go
Comment thread pkg/runtime/internal/buildlog/buildlog.go
Comment thread pkg/runtime/internal/buildlog/buildlog.go
@mitchell-as

Copy link
Copy Markdown
Collaborator Author

Test failures are unrelated to this PR. I'm unsure how exactly to test this, as we don't reject unauthenticated clients at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants