Skip to content
Draft
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
5 changes: 4 additions & 1 deletion stovepipe/entity/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "entity",
srcs = ["request.go"],
srcs = [
"queue.go",
"request.go",
],
importpath = "github.com/uber/submitqueue/stovepipe/entity",
visibility = ["//visibility:public"],
)
Expand Down
40 changes: 40 additions & 0 deletions stovepipe/entity/queue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) 2025 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package entity

// DefaultMaxConcurrent is the default concurrency cap when wiring supplies no override.
const DefaultMaxConcurrent int32 = 1

// Queue is the per-queue coordination row. One row per named repo+ref; ingest, process,
// and record advance different fields under optimistic-locking CAS.
type Queue struct {
// Name is the stable logical id (e.g. "monorepo/main").
Name string `json:"name"`

// LastGreenURI is the most recent whole-repo-green commit; empty until first green.
LastGreenURI string `json:"last_green_uri"`

// InFlightCount is active Phase 1 validations not yet terminal.
InFlightCount int32 `json:"in_flight_count"`

// MaxConcurrent caps concurrent in-flight validations.
MaxConcurrent int32 `json:"max_concurrent"`

// LatestRequestSeq is the highest ingested request sequence for backlog coalescing.
LatestRequestSeq int64 `json:"latest_request_seq"`

// Version is used for optimistic locking.
Version int32 `json:"version"`
}