Merge main, keeping main's manager.go and our FailureType tests

This commit is contained in:
Steve Yegge
2025-12-19 16:26:38 -08:00
82 changed files with 13666 additions and 1172 deletions
+39
View File
@@ -38,6 +38,10 @@ type Refinery struct {
// CurrentMR is the merge request currently being processed.
CurrentMR *MergeRequest `json:"current_mr,omitempty"`
// PendingMRs tracks merge requests that have been submitted.
// Key is the MR ID.
PendingMRs map[string]*MergeRequest `json:"pending_mrs,omitempty"`
// LastMergeAt is when the last successful merge happened.
LastMergeAt *time.Time `json:"last_merge_at,omitempty"`
@@ -111,6 +115,41 @@ const (
)
// MergeConfig contains configuration for the merge process.
type MergeConfig struct {
// RunTests controls whether tests are run after merge.
// Default: true
RunTests bool `json:"run_tests"`
// TestCommand is the command to run for testing.
// Default: "go test ./..."
TestCommand string `json:"test_command"`
// DeleteMergedBranches controls whether merged branches are deleted.
// Default: true
DeleteMergedBranches bool `json:"delete_merged_branches"`
// PushRetryCount is the number of times to retry a failed push.
// Default: 3
PushRetryCount int `json:"push_retry_count"`
// PushRetryDelayMs is the base delay between push retries in milliseconds.
// Each retry doubles the delay (exponential backoff).
// Default: 1000
PushRetryDelayMs int `json:"push_retry_delay_ms"`
}
// DefaultMergeConfig returns the default merge configuration.
func DefaultMergeConfig() MergeConfig {
return MergeConfig{
RunTests: true,
TestCommand: "go test ./...",
DeleteMergedBranches: true,
PushRetryCount: 3,
PushRetryDelayMs: 1000,
}
}
// RefineryStats contains cumulative refinery statistics.
type RefineryStats struct {
// TotalMerged is the total number of successful merges.