|
| 1 | +package entity |
| 2 | + |
| 3 | +// QueueConfig holds the configuration for a single submit queue. |
| 4 | +// Each queue maps a VCS repository + target to a processing pipeline. |
| 5 | +// A repository can have multiple queues, but each queue has exactly one target. |
| 6 | +// Immutable after creation. |
| 7 | +type QueueConfig struct { |
| 8 | + // Name uniquely identifies this queue within the system. |
| 9 | + // Referenced by Request.Queue. |
| 10 | + Name string |
| 11 | + |
| 12 | + // VCSType identifies the version control system (e.g., "git", "svn", "perforce"). |
| 13 | + // A queue operates on exactly one VCS. |
| 14 | + VCSType string |
| 15 | + |
| 16 | + // VCSAddress identifies the repository in the version control system. |
| 17 | + // The format is VCS-specific: |
| 18 | + // - Git: remote URL (e.g., "git@github.com:uber/submitqueue.git") |
| 19 | + // - Perforce: depot path (e.g., "//depot/project") |
| 20 | + // - SVN: repository URL (e.g., "https://svn.example.com/repos/project") |
| 21 | + VCSAddress string |
| 22 | + |
| 23 | + // Target is the landing target where changes are merged. |
| 24 | + // The format is VCS-specific: |
| 25 | + // - Git: branch ref (e.g., "main", "release/v2") |
| 26 | + // - Perforce: stream or depot path (e.g., "//depot/main/...") |
| 27 | + // - SVN: repository path (e.g., "trunk/") |
| 28 | + Target string |
| 29 | +} |
| 30 | + |
| 31 | +// NewQueueConfig creates a new QueueConfig with the given parameters. |
| 32 | +func NewQueueConfig( |
| 33 | + name string, |
| 34 | + vcsType string, |
| 35 | + vcsAddress string, |
| 36 | + target string, |
| 37 | +) QueueConfig { |
| 38 | + return QueueConfig{ |
| 39 | + Name: name, |
| 40 | + VCSType: vcsType, |
| 41 | + VCSAddress: vcsAddress, |
| 42 | + Target: target, |
| 43 | + } |
| 44 | +} |
0 commit comments