Skip to content

Branch not checked out in prebuild #14017

Closed
@nVitius

Description

@nVitius

Bug description

I'm running into an issue where starting a prebuild with the "New Workspace (with this prebuild)" button is not checking out the branch. Looking at the code, this is intentional:

if (OpenPrebuildContext.is(context.originalContext)) {
// Because of incremental prebuilds, createForContext will take over the original context.
// To ensure we get the right commit when forcing a prebuild, we force the context here.
context.originalContext = buildWorkspace.context;
if (CommitContext.is(context.originalContext)) {
// We force the checkout of the revision rather than the ref/branch.
// Otherwise we'd the correct prebuild with the "wrong" Git status.
delete context.originalContext.ref;
}
}

This makes sense, except that I'm using the prebuild for the latest commit on this branch. Would it be possible to checkout the branch in this case?

Steps to reproduce

  • Push new commit to branch w/ prebuilds enabled
  • Navigate to Prebuilds tab in the project
  • Select latest prebuild and start a new workspace

Workspace affected

No response

Expected behavior

Opening a prebuild for the latest commit on a branch should checkout the branch.

Example repository

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions