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 @@ -629,6 +629,7 @@ GO_GENERATE_PACKAGES := \
./stovepipe/core/requestlog/... \
./stovepipe/extension/buildissue/... \
./stovepipe/extension/buildrunner/... \
./stovepipe/extension/fixer/... \
./stovepipe/extension/projectstatus/... \
./stovepipe/extension/queueconfig/... \
./stovepipe/extension/sourcecontrol/... \
Expand Down
9 changes: 9 additions & 0 deletions stovepipe/extension/fixer/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 = ["fixer.go"],
importpath = "github.com/uber/submitqueue/stovepipe/extension/fixer",
visibility = ["//visibility:public"],
deps = ["//stovepipe/entity:go_default_library"],
)
9 changes: 9 additions & 0 deletions stovepipe/extension/fixer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Repair execution

[`RepairExecutor`](fixer.go) submits repair work for one [`OpenIssue`](../../entity/open_issue.go). The executor can invoke an in-process implementation or wrap an external provider.

`Submit` returns promptly with a nonempty opaque provider attempt ID on acceptance, or an error. Acceptance does not establish recovery.

An error, including a timeout or cancellation, can occur after the provider accepted the work, so it must not cause an automatic resubmission. Implementations return plain dependency errors and must support concurrent calls.

`Factory.For` resolves an executor bound to `Config.QueueName`. Generated mocks are available in [`mock`](mock/fixer_mock.go).
45 changes: 45 additions & 0 deletions stovepipe/extension/fixer/fixer.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 fixer defines repair submission for an open issue.
package fixer

//go:generate mockgen -source=fixer.go -destination=mock/fixer_mock.go -package=mock

import (
"context"

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

// RepairExecutor submits repair work for one open issue within a configured queue.
// Implementations must be concurrency-safe and return promptly after submission.
type RepairExecutor interface {
// Submit returns a nonempty opaque provider attempt ID on acceptance.
// Acceptance does not establish recovery.
// Repeated calls may start additional attempts. A plain error can follow acceptance,
// including on context cancellation; callers must not automatically repeat Submit.
Submit(context.Context, entity.OpenIssue) (string, error)
}

// Config identifies the queue whose repair executor is requested.
type Config struct {
// QueueName identifies the validation queue.
QueueName string
}

// Factory resolves queue-bound executors; routing belongs to service wiring.
type Factory interface {
For(Config) (RepairExecutor, error)
}
13 changes: 13 additions & 0 deletions stovepipe/extension/fixer/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 = ["fixer_mock.go"],
importpath = "github.com/uber/submitqueue/stovepipe/extension/fixer/mock",
visibility = ["//visibility:public"],
deps = [
"//stovepipe/entity:go_default_library",
"//stovepipe/extension/fixer:go_default_library",
"@org_uber_go_mock//gomock:go_default_library",
],
)
97 changes: 97 additions & 0 deletions stovepipe/extension/fixer/mock/fixer_mock.go

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

Loading