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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ GO_GENERATE_PACKAGES := \
./runway/extension/merger/... \
./stovepipe/controller/... \
./stovepipe/core/requestlog/... \
./stovepipe/extension/buildissue/... \
./stovepipe/extension/buildrunner/... \
./stovepipe/extension/projectstatus/... \
./stovepipe/extension/queueconfig/... \
Expand Down
1 change: 1 addition & 0 deletions stovepipe/entity/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go_library(
name = "go_default_library",
srcs = [
"build.go",
"build_issue.go",
"ingest.go",
"list.go",
"project_status.go",
Expand Down
24 changes: 24 additions & 0 deletions stovepipe/entity/build_issue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) 2026 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

// BuildIssue identifies a validation failure by task and optional unit.
type BuildIssue struct {
// TaskID identifies the logical validation task, stable across builds and retries.
TaskID string `json:"task_id"`
// UnitID identifies the failed unit within the task; empty for a task-wide issue.
// Repeated observations of the same condition use the same TaskID and UnitID.
UnitID string `json:"unit_id"`
}
9 changes: 9 additions & 0 deletions stovepipe/extension/buildissue/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = ["buildissue.go"],
importpath = "github.com/uber/submitqueue/stovepipe/extension/buildissue",
visibility = ["//visibility:public"],
deps = ["//stovepipe/entity:go_default_library"],
)
13 changes: 13 additions & 0 deletions stovepipe/extension/buildissue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Build issue detection

`Detector` discovers confirmed validation issues from a build. It returns failure observations, not a complete view of build state.

Issue values are defined in the [domain model](../../entity/build_issue.go). A validation task is a logical validation operation. A validation unit is an identifiable piece of work within a task.

Within a validation queue, TaskID and UnitID together identify the validation condition. Repeated observations of the same condition use the same pair across builds. UnitID is empty for a task-wide issue.

Each detection returns issues discoverable at that time and may repeat earlier observations. Detection does not mark issues as handled. An issue's absence from a detection result does not mean it is resolved.

Detectors must support concurrent calls. Dependency failures return plain errors; issue results returned with an error must not be used.

`Factory` resolves the detector for a validation queue.
45 changes: 45 additions & 0 deletions stovepipe/extension/buildissue/buildissue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) 2026 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 buildissue defines confirmed-issue discovery for active or
// completed builds, independently of build status polling.
package buildissue

//go:generate mockgen -source=buildissue.go -destination=mock/buildissue_mock.go -package=mock

import (
"context"

"github.com/uber/submitqueue/stovepipe/entity"
)

// Detector discovers confirmed issues without waiting for build completion.
// Implementations own confirmation and retry rules and must be concurrency-safe.
// Detection does not mark issues as handled.
// An issue's absence from a detection result does not mean it is resolved.
// Return plain dependency errors; issue results returned with an error must not be used.
type Detector interface {
Detect(ctx context.Context, buildID entity.BuildID) ([]entity.BuildIssue, error)
}

// Config identifies the queue whose issue detector is requested.
type Config struct {
// QueueName identifies the queue.
QueueName string
}

// Factory resolves a queue's detector; implementations and routing belong to host wiring.
type Factory interface {
For(cfg Config) (Detector, error)
}
13 changes: 13 additions & 0 deletions stovepipe/extension/buildissue/mock/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = ["buildissue_mock.go"],
importpath = "github.com/uber/submitqueue/stovepipe/extension/buildissue/mock",
visibility = ["//visibility:public"],
deps = [
"//stovepipe/entity:go_default_library",
"//stovepipe/extension/buildissue:go_default_library",
"@org_uber_go_mock//gomock:go_default_library",
],
)
97 changes: 97 additions & 0 deletions stovepipe/extension/buildissue/mock/buildissue_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading