|
| 1 | +// Copyright (c) 2025 Uber Technologies, Inc. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package entity |
| 16 | + |
| 17 | +// Queue holds per-queue pipeline coordination state for a named repo+ref (e.g. "monorepo/main"). |
| 18 | +type Queue struct { |
| 19 | + // **************** |
| 20 | + // Immutable fields, fixed at queue entity creation |
| 21 | + // **************** |
| 22 | + |
| 23 | + // Name is the stable logical id for the queue. It should be unique within the system. |
| 24 | + Name string `json:"name"` |
| 25 | + |
| 26 | + // **************** |
| 27 | + // Following fields could be changed throughout the lifecycle of the queue |
| 28 | + // **************** |
| 29 | + |
| 30 | + // LastGreenURI is the most recent whole-repo-green commit. Empty until the first green. |
| 31 | + LastGreenURI string `json:"last_green_uri"` |
| 32 | + |
| 33 | + // InFlightCount is the number of Phase 1 validations admitted but not yet in a terminal state. |
| 34 | + InFlightCount int32 `json:"in_flight_count"` |
| 35 | + |
| 36 | + // LatestRequestSeq is the highest request sequence accepted for this queue. Used to coalesce |
| 37 | + // backlog so intermediate heads are skipped without superseding the newest head. |
| 38 | + LatestRequestSeq int64 `json:"latest_request_seq"` |
| 39 | + |
| 40 | + // Version is the version of the object. It is used for optimistic locking. |
| 41 | + // Versioning starts at 1 and is incremented for each change to the object. |
| 42 | + Version int32 `json:"version"` |
| 43 | +} |
0 commit comments