Skip to content

ENG-1940: Finish an in-progress build when the live build connection is refused - #3844

Merged
mitchell-as merged 2 commits into
version/0-48-1-RC3from
mitchell/eng-1940
Jul 17, 2026
Merged

ENG-1940: Finish an in-progress build when the live build connection is refused#3844
mitchell-as merged 2 commits into
version/0-48-1-RC3from
mitchell/eng-1940

Conversation

@mitchell-as

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

Copy link
Copy Markdown
Collaborator

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

When you check out or install a project that still has to build, the State Tool follows the build over a live connection. If that connection is refused, it used to give up. This makes it finish the job another way: it waits for the build to complete by polling, then downloads and installs the results just as it normally would — you just don't see the live build log.

This is the counterpart to the earlier change that made a refused connection show a clear message instead of failing; together they mean a refused connection no longer stops a checkout or install from completing.

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

🤖 Generated with Claude Code

…available

When the build-log-streamer WebSocket is denied for an in-progress build,
complete the build without it: poll the build to completion, read the resolved
artifact download URLs from a re-fetched commit, and drive the existing
download/install path off them. A build that fails during polling is surfaced
as a failure.

The runtime gains a WithBuildPlanPoller option -- a caller-supplied closure, so
pkg/runtime takes no buildplanner dependency -- which the runbits layer wires
for in-progress builds. Together with the graceful-degradation change this sits
on, a denied stream no longer stops state checkout / install from completing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

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 adds a fallback path to complete a runtime setup when the build-log WebSocket stream is refused/denied, by polling the build to completion and then proceeding with the normal download/unpack/install flow using resolved artifact URLs.

Changes:

  • Add a configurable build-plan poller (Opts.PollBuildPlan) and option helper (WithBuildPlanPoller) for non-stream completion.
  • In setup.update(), treat build-log stream denial as non-fatal and complete the build via polling + normal obtain/install.
  • Add unit tests covering URL resolution behavior and poller error propagation.

Reviewed changes

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

File Description
pkg/runtime/setup.go Adds denial fallback logic plus completeWithoutStream/resolveDownloads helpers.
pkg/runtime/setup_denial_test.go Adds tests for URL resolution and poller failure behavior.
pkg/runtime/options.go Adds WithBuildPlanPoller option wiring into Opts.
internal/runbits/runtime/runtime.go Wires the build-plan poller for in-progress builds using the buildplanner model.

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

Comment thread pkg/runtime/setup.go
Comment thread pkg/runtime/setup.go
Comment thread pkg/runtime/setup.go
@mitchell-as

Copy link
Copy Markdown
Collaborator Author

Failing tests are known and unrelated to this PR.

@mitchell-as
mitchell-as requested a review from MDrakos July 16, 2026 17:49
@mitchell-as

Copy link
Copy Markdown
Collaborator Author

As discussed on Zoom, I'm comfortable putting this in because we won't hit it until we start restricting access on the Platform side. We can test properly in another release cycle.

Comment thread pkg/runtime/setup.go
Comment on lines +310 to +312
if !buildlogstream.IsStreamDenied(err) {
return errs.Wrap(err, "errors occurred during buildlog streaming")
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

At this time, the Platform is not denying build log streams, so the code below won't get hit yet.

…l/eng-1940

# Conflicts:
#	pkg/runtime/options.go
#	pkg/runtime/setup.go
@mitchell-as
mitchell-as merged commit 8eaa944 into version/0-48-1-RC3 Jul 17, 2026
8 of 13 checks passed
@mitchell-as
mitchell-as deleted the mitchell/eng-1940 branch July 17, 2026 17:05
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.

3 participants