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
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 = "go_default_library",
srcs = ["request.go"],
srcs = [
"queue.go",
"request.go",
],
importpath = "github.com/uber/submitqueue/stovepipe/entity",
visibility = ["//visibility:public"],
)
Expand Down
44 changes: 44 additions & 0 deletions stovepipe/entity/queue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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

// Queue holds per-queue pipeline coordination state for a named repo+ref (e.g. "monorepo/main").
type Queue struct {
// ****************
// Immutable fields, fixed at queue entity creation
// ****************

// Name is the stable logical id for the queue. It should be unique within the system.
Name string `json:"name"`

// ****************
// Following fields could be changed throughout the lifecycle of the queue
// ****************

// LastGreenURI is the queue's last-known-good commit: the most recent head at which
// whole-repo validation recorded green (health degree 0). Empty until the first such outcome.
LastGreenURI string `json:"last_green_uri"`
Comment thread
mnoah1 marked this conversation as resolved.

// InFlightCount is the number of trunk validations admitted by process but not yet terminal.
InFlightCount int32 `json:"in_flight_count"`

// LatestRequestSeq is the highest request sequence accepted for this queue. Used to coalesce
// backlog so intermediate heads are skipped without superseding the newest head.
LatestRequestSeq int64 `json:"latest_request_seq"`

// Version is the version of the object. It is used for optimistic locking.
// Versioning starts at 1 and is incremented for each change to the object.
Version int32 `json:"version"`
}
Loading