integrator

package
v0.1.0-rc.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupMerged

func CleanupMerged(ctx context.Context, p platform.Platform, params CleanupParams) error

CleanupMerged handles post-merge cleanup for a batch PR that was merged externally (not by HerdOS auto-merge). It closes all milestone issues, closes the milestone, and deletes the batch branch. Non-herd PRs, non-merged PRs, and unparseable branches are silently skipped.

Types

type AdvanceParams

type AdvanceParams struct {
	RunID    int64
	RepoRoot string
}

AdvanceParams holds the parameters for advancing tiers.

type AdvanceResult

type AdvanceResult struct {
	TierComplete    bool
	AllComplete     bool
	DispatchedCount int
	BatchPRNumber   int
}

AdvanceResult holds the result of a tier advancement.

func Advance

func Advance(ctx context.Context, p platform.Platform, g *git.Git, cfg *config.Config, params AdvanceParams) (*AdvanceResult, error)

Advance checks if the current tier is complete and dispatches the next tier. If all tiers are complete, it opens the batch PR.

func AdvanceByBatch

func AdvanceByBatch(ctx context.Context, p platform.Platform, g *git.Git, cfg *config.Config, batchNumber int) (*AdvanceResult, error)

AdvanceByBatch triggers tier advancement for a batch by milestone number. Used when an issue is closed (e.g., manual tasks) rather than via workflow run.

type CheckCIParams

type CheckCIParams struct {
	RunID       int64
	BatchNumber int // Alternative to RunID — used by check_suite trigger
	RepoRoot    string
}

CheckCIParams holds parameters for CI failure handling.

type CheckCIResult

type CheckCIResult struct {
	Status       string // "success", "failure", "pending"
	FixIssues    []int
	FixCycle     int
	MaxCyclesHit bool
	Skipped      bool // true if require_ci is false or no batch branch found
}

CheckCIResult holds the result of CI checking.

func CheckCI

func CheckCI(ctx context.Context, p platform.Platform, cfg *config.Config, params CheckCIParams) (*CheckCIResult, error)

CheckCI checks CI status on the batch branch after consolidation. If CI fails, it re-runs once (transient failure filter), then dispatches fix workers up to ci_max_fix_cycles. If ci_max_fix_cycles is 0, it only notifies.

type CleanupParams

type CleanupParams struct {
	PRNumber int
}

CleanupParams holds parameters for post-merge cleanup of externally merged PRs.

type ConsolidateParams

type ConsolidateParams struct {
	RunID    int64
	RepoRoot string
}

ConsolidateParams holds the parameters for consolidating a worker branch.

type ConsolidateResult

type ConsolidateResult struct {
	IssueNumber      int
	WorkerBranch     string
	Merged           bool
	NoOp             bool
	ConflictDetected bool
	ConflictIssue    int
}

ConsolidateResult holds the result of a consolidation.

func Consolidate

func Consolidate(ctx context.Context, p platform.Platform, g *git.Git, cfg *config.Config, params ConsolidateParams) (*ConsolidateResult, error)

Consolidate merges a completed worker branch into the batch branch. It resolves the worker branch from the workflow run, merges it, and cleans up.

type MergeApprovedParams

type MergeApprovedParams struct {
	PRNumber int
}

MergeApprovedParams holds parameters for merging an approved batch PR.

type MergeApprovedResult

type MergeApprovedResult struct {
	Merged  bool
	Skipped bool
	Reason  string
}

MergeApprovedResult holds the result of a merge attempt.

func MergeApproved

MergeApproved merges a batch PR that has been approved by a human reviewer. It verifies the PR is a herd batch PR (title starts with "[herd]"), then merges using the configured strategy and runs post-merge cleanup. Non-herd PRs and already-closed PRs are silently skipped.

type ReviewParams

type ReviewParams struct {
	RunID       int64
	PRNumber    int // Alternative to RunID — used by pull_request_review trigger
	BatchNumber int // Alternative to RunID — used by advance-on-close
	RepoRoot    string
}

ReviewParams holds the parameters for reviewing a batch PR.

type ReviewResult

type ReviewResult struct {
	Approved      bool
	FixIssues     []int
	FixCycle      int
	MaxCyclesHit  bool
	BatchPRNumber int
}

ReviewResult holds the result of a batch PR review.

func Review

func Review(ctx context.Context, p platform.Platform, ag agent.Agent, g *git.Git, cfg *config.Config, params ReviewParams) (*ReviewResult, error)

Review runs an agent review on the batch PR. If approved, it optionally auto-merges. If changes are requested, it creates fix issues and dispatches fix workers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL