diff --git a/entity/queue_config.go b/entity/queue_config.go index 9e042921..2d00f5fd 100644 --- a/entity/queue_config.go +++ b/entity/queue_config.go @@ -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" + BuildRunner string `json:"build_runner" yaml:"build_runner"` } diff --git a/entity/queue_config_test.go b/entity/queue_config_test.go index 3e181656..98a71f37 100644 --- a/entity/queue_config_test.go +++ b/entity/queue_config_test.go @@ -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) }