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
28 changes: 10 additions & 18 deletions entity/queue_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,30 @@ package entity
type QueueConfig struct {
// Name uniquely identifies this queue within the system.
// Referenced by Request.Queue.
Name string
Name string `json:"name" yaml:"name"`

// VCSType identifies the version control system (e.g., "git", "svn", "perforce").
// A queue operates on exactly one VCS.
VCSType string
VCSType string `json:"vcs_type" yaml:"vcs_type"`

// VCSAddress identifies the repository in the version control system.
// The format is VCS-specific:
// - Git: remote URL (e.g., "git@github.com:uber/submitqueue.git")
// - Perforce: depot path (e.g., "//depot/project")
// - SVN: repository URL (e.g., "https://svn.example.com/repos/project")
VCSAddress string
VCSAddress string `json:"vcs_address" yaml:"vcs_address"`

// Target is the landing target where changes are merged.
// The format is VCS-specific:
// - Git: branch ref (e.g., "main", "release/v2")
// - Perforce: stream or depot path (e.g., "//depot/main/...")
// - SVN: repository path (e.g., "trunk/")
Target string
}
Target string `json:"target" yaml:"target"`

// NewQueueConfig creates a new QueueConfig with the given parameters.
func NewQueueConfig(
name string,
vcsType string,
vcsAddress string,
target string,
) QueueConfig {
return QueueConfig{
Name: name,
VCSType: vcsType,
VCSAddress: vcsAddress,
Target: target,
}
// BuildRunner identifies the CI pipeline or job that runs builds for this queue.
// Opaque to the system; meaningful only to the build extension implementation.
// Examples:
// - Buildkite: "buildkite.com/uber/submitqueue-ci"
// - Jenkins: "jenkins.example.com/job/submitqueue-verify"
Comment thread
behinddwalls marked this conversation as resolved.
BuildRunner string `json:"build_runner" yaml:"build_runner"`
Comment thread
behinddwalls marked this conversation as resolved.
}
11 changes: 9 additions & 2 deletions entity/queue_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ import (
"github.com/stretchr/testify/assert"
)

func TestNewQueueConfig(t *testing.T) {
cfg := NewQueueConfig("uber/submitqueue/main", "git", "git@github.com:uber/submitqueue.git", "main")
func TestQueueConfig(t *testing.T) {
cfg := QueueConfig{
Name: "uber/submitqueue/main",
VCSType: "git",
VCSAddress: "git@github.com:uber/submitqueue.git",
Target: "main",
BuildRunner: "buildkite.com/uber/submitqueue-ci",
}

assert.Equal(t, "uber/submitqueue/main", cfg.Name)
assert.Equal(t, "git", cfg.VCSType)
assert.Equal(t, "git@github.com:uber/submitqueue.git", cfg.VCSAddress)
assert.Equal(t, "main", cfg.Target)
assert.Equal(t, "buildkite.com/uber/submitqueue-ci", cfg.BuildRunner)
}