Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions submitqueue/core/request/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestPublishBatchLogs_Success(t *testing.T) {

err := PublishBatchLogs(context.Background(), registry,
[]string{"req/1", "req/2", "req/3"},
entity.RequestStatusScored,
entity.RequestStatusBatched,
map[string]string{"batch_id": "b/1"},
)
require.NoError(t, err)
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestPublishBatchLogs_PartialFailure(t *testing.T) {

err = PublishBatchLogs(context.Background(), registry,
[]string{"req/1", "req/2", "req/3"},
entity.RequestStatusScored,
entity.RequestStatusBatched,
map[string]string{"batch_id": "b/1"},
)
require.Error(t, err)
Expand All @@ -111,7 +111,7 @@ func TestPublishBatchLogs_Empty(t *testing.T) {
ctrl := gomock.NewController(t)
registry := newTestRegistry(t, ctrl, nil)

err := PublishBatchLogs(context.Background(), registry, nil, entity.RequestStatusScored, nil)
err := PublishBatchLogs(context.Background(), registry, nil, entity.RequestStatusBatched, nil)
require.NoError(t, err)
}

Expand Down
4 changes: 0 additions & 4 deletions submitqueue/entity/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ const (
BatchStateSucceeded BatchState = "succeeded"
// BatchStateFailed is the terminal state of a batch that has failed.
BatchStateFailed BatchState = "failed"
// BatchStateScored is the state of a batch that has been scored for build success probability.
BatchStateScored BatchState = "scored"
// BatchStateCancelling is the non-terminal intent state set when a cancel has been requested but the
// batch has not yet been transitioned to BatchStateCancelled. A batch in this state may still reach
// BatchStateSucceeded or BatchStateFailed if a concurrent merge wins the race (e.g. the push had
Expand Down Expand Up @@ -75,7 +73,6 @@ func IsBatchStateHalted(s BatchState) bool {
func ActiveBatchStates() []BatchState {
return []BatchState{
BatchStateCreated,
BatchStateScored,
BatchStateSpeculating,
BatchStateMerging,
BatchStateCancelling,
Expand All @@ -95,7 +92,6 @@ func ActiveBatchStates() []BatchState {
func DependencyBatchStates() []BatchState {
return []BatchState{
BatchStateCreated,
BatchStateScored,
BatchStateSpeculating,
BatchStateMerging,
}
Expand Down
3 changes: 0 additions & 3 deletions submitqueue/entity/request_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ const (
// RequestStatusBatched indicates that the request has been included in a new batch and will be sent to speculation.
RequestStatusBatched RequestStatus = "batched"

// RequestStatusScored indicates that the batch containing the request has been scored for build success probability.
RequestStatusScored RequestStatus = "scored"

// RequestStatusSpeculating indicates that the request is currently being speculated (e.g., speculative merge/rebase, etc.).
RequestStatusSpeculating RequestStatus = "speculating"

Expand Down
4 changes: 2 additions & 2 deletions submitqueue/orchestrator/controller/speculate/speculate.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
// Per invocation, the controller advances the batch one step in the
// state machine:
//
// - Created or Scored → publish to build, transition to Speculating.
// - Created → publish to build, transition to Speculating.
// - Speculating → if all deps are Succeeded, publish to merge and
// transition to Merging; otherwise no-op (or fail-fast if a dep is
// in a non-succeeding terminal state).
Expand Down Expand Up @@ -133,7 +133,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
}

switch batch.State {
case entity.BatchStateCreated, entity.BatchStateScored:
case entity.BatchStateCreated:
return c.startSpeculation(ctx, batch)
case entity.BatchStateSpeculating:
return c.tryFinalize(ctx, batch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,13 @@ func TestNewController(t *testing.T) {
var _ consumer.Controller = controller
}

// startSpeculation: Created/Scored should publish to build and CAS to Speculating with newVersion = oldVersion+1.
// startSpeculation: Created should publish to build and CAS to Speculating with newVersion = oldVersion+1.
func TestController_Process_StartSpeculation(t *testing.T) {
tests := []struct {
name string
state entity.BatchState
}{
{name: "from_created", state: entity.BatchStateCreated},
{name: "from_scored", state: entity.BatchStateScored},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -593,7 +592,7 @@ func TestController_Process_StorageFailure(t *testing.T) {
// Publish failure must not advance the batch state.
func TestController_Process_PublishFailure(t *testing.T) {
ctrl := gomock.NewController(t)
batch := testBatch(entity.BatchStateScored)
batch := testBatch(entity.BatchStateCreated)

batchStore := storagemock.NewMockBatchStore(ctrl)
batchStore.EXPECT().Get(gomock.Any(), batch.ID).Return(batch, nil)
Expand Down
Loading