Documentation
¶
Index ¶
- Constants
- func BotBranch(branch string) bool
- func Closable(change Change, in CloseChangeRequest, actor string) bool
- func DeliveryRulesHash(v any) string
- func LogTail(body []byte) string
- func MissingChecks(target, head []Check, ignore func(string) bool) ([]string, bool)
- func PipelineMatches(in PipelineRequest, out DeploymentStatus) bool
- func ValidArtifactDigest(value string) bool
- func ValidEnvironment(value string) bool
- func ValidPipelineRequest(in PipelineRequest) bool
- func VerifyPipelineConfiguration(ctx context.Context, provider ForgeInventory, in PipelineRequest) error
- type Advisory
- type AdvisoryReader
- type Approval
- type Capabilities
- type Change
- type Check
- type CheckLogReader
- type CheckRule
- type CloseChangeRequest
- type CommentChangeRequest
- type CommitProof
- type Config
- type CreateChangeRequest
- type DeliveryGuard
- type DeploymentGates
- type DeploymentStatus
- type Event
- type ExecutionCheck
- type ExecutionCheckRequest
- type File
- type FileEdit
- type ForgeBranchRefresher
- type ForgeChangeCloser
- type ForgeChangeCommenter
- type ForgeChanges
- type ForgeCommits
- type ForgeDelivery
- type ForgeEvents
- type ForgeExecutionChecks
- type ForgeFreshness
- type ForgeInventory
- type ForgeMerge
- type ForgePipelineControl
- type ForgeProtection
- type ForgeQueueControl
- type ForgeQueuePrerequisites
- type ForgeSource
- type ForgeTrainGate
- type HTTPClient
- type InventoryRequest
- type Issue
- type IssueReader
- type MergeEvidence
- type MergeRequest
- type MergeResult
- type NativeEligibility
- type PermissionLinker
- type PipelineRequest
- type Provider
- type QueueCancelRequest
- type QueueState
- type RefreshBranchRequest
- type RepoRef
- type Repository
- type Rules
- type SourceEntry
- type SourceManifest
- type TrainGate
- type TrainGateRequest
- type UpdateBranchRequest
- type Workflow
Constants ¶
View Source
const MaxLogBytes = 24 << 10
View Source
const QueueExecutionCheckName = "reforge/merge-policy"
Variables ¶
This section is empty.
Functions ¶
func DeliveryRulesHash ¶
func MissingChecks ¶
func PipelineMatches ¶
func PipelineMatches(in PipelineRequest, out DeploymentStatus) bool
func ValidArtifactDigest ¶
func ValidEnvironment ¶
func ValidPipelineRequest ¶
func ValidPipelineRequest(in PipelineRequest) bool
func VerifyPipelineConfiguration ¶
func VerifyPipelineConfiguration(ctx context.Context, provider ForgeInventory, in PipelineRequest) error
Types ¶
type Advisory ¶
type Advisory struct {
ID string `json:"id"`
Package string `json:"package"`
Ecosystem string `json:"ecosystem"`
Manifest string `json:"manifest"`
Severity string `json:"severity"`
Summary string `json:"summary"`
Vulnerable string `json:"vulnerable"`
Patched string `json:"patched"`
URL string `json:"url"`
}
type AdvisoryReader ¶
type Capabilities ¶
type Capabilities struct {
Provider string `json:"provider"`
ServerVersion string `json:"server_version"`
Features map[string]domain.Capability `json:"features"`
}
type Change ¶
type Change struct {
ID string `json:"id"`
Repository RepoRef `json:"repository"`
HeadRepository RepoRef `json:"head_repository"`
TargetRepository RepoRef `json:"target_repository"`
Title string `json:"title"`
Body string `json:"body"`
URL string `json:"url"`
HeadSHA string `json:"head_sha"`
TargetSHA string `json:"target_sha"`
HeadBranch string `json:"head_branch"`
TargetBranch string `json:"target_branch"`
AuthorID string `json:"author_id"`
AuthorLogin string `json:"author_login"`
AuthorType string `json:"author_type"`
State string `json:"state"`
Draft bool `json:"draft"`
MergeSHA string `json:"merge_sha"`
MergeStatus string `json:"merge_status"`
OperationID string `json:"operation_id"`
}
type CheckLogReader ¶
type CloseChangeRequest ¶
type CloseChangeRequest struct {
Repository RepoRef `json:"repository"`
ChangeID string `json:"change_id"`
HeadBranch string `json:"head_branch"`
Comment string `json:"comment"`
}
func (CloseChangeRequest) Valid ¶
func (r CloseChangeRequest) Valid() bool
type CommentChangeRequest ¶
type CommentChangeRequest struct {
Repository RepoRef `json:"repository"`
ChangeID string `json:"change_id"`
HeadSHA string `json:"head_sha"`
Comment string `json:"comment"`
}
func (CommentChangeRequest) Valid ¶
func (r CommentChangeRequest) Valid() bool
type CommitProof ¶
type Config ¶
type CreateChangeRequest ¶
type DeliveryGuard ¶
type DeliveryGuard func(context.Context, PipelineRequest, DeploymentGates) error
type DeploymentGates ¶
type DeploymentGates struct {
State string `json:"state"`
NativeEnforced domain.CapabilityState `json:"native_enforced"`
Blockers []string `json:"blockers"`
ApprovalURL string `json:"approval_url"`
Environment string `json:"environment"`
RulesHash string `json:"rules_hash"`
}
func InspectPipeline ¶
func InspectPipeline(ctx context.Context, provider Provider, in PipelineRequest) (DeploymentGates, error)
type DeploymentStatus ¶
type DeploymentStatus struct {
WorkflowSHA string `json:"workflow_sha"`
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
State string `json:"state"`
SourceSHA string `json:"source_sha"`
ArtifactDigest string `json:"artifact_digest"`
Environment string `json:"environment"`
CorrelationID string `json:"correlation_id"`
WorkflowID string `json:"workflow_id"`
WorkflowPath string `json:"workflow_path"`
Ref string `json:"ref"`
Event string `json:"event"`
RunAttempt int64 `json:"run_attempt"`
URL string `json:"url"`
Health string `json:"health"`
ObservedAt time.Time `json:"observed_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type ExecutionCheck ¶
type ExecutionCheckRequest ¶
type ForgeBranchRefresher ¶
type ForgeBranchRefresher interface {
RefreshAppBranch(context.Context, RefreshBranchRequest) error
}
type ForgeChangeCloser ¶
type ForgeChangeCloser interface {
CloseChange(context.Context, CloseChangeRequest) (Change, error)
}
type ForgeChangeCommenter ¶
type ForgeChangeCommenter interface {
CommentChange(context.Context, CommentChangeRequest) (Change, error)
}
type ForgeChanges ¶
type ForgeChanges interface {
CreateChange(context.Context, CreateChangeRequest) (Change, error)
FindChangeByOperation(ctx context.Context, repository RepoRef, operationID, headBranch, targetBranch string) (*Change, error)
UpdateAppBranch(context.Context, UpdateBranchRequest) (string, error)
ReadChange(context.Context, RepoRef, string) (Change, error)
RequestReview(context.Context, RepoRef, string, []string) error
}
type ForgeCommits ¶
type ForgeDelivery ¶
type ForgeDelivery interface {
ListAllowedWorkflows(context.Context, RepoRef) ([]Workflow, error)
TriggerOrObservePipeline(context.Context, PipelineRequest) (DeploymentStatus, error)
ReadDeploymentGates(context.Context, RepoRef, string) (DeploymentGates, error)
ReadDeploymentStatus(context.Context, RepoRef, string) (DeploymentStatus, error)
RequestAllowedRecovery(context.Context, PipelineRequest) (DeploymentStatus, error)
}
type ForgeEvents ¶
type ForgeEvents interface {
VerifyWebhook(http.Header, []byte) error
DecodeEvent(http.Header, []byte) (Event, error)
ReconcileChanges(context.Context, RepoRef, string) (domain.Page[Change], error)
ListChecks(context.Context, RepoRef, string) ([]Check, error)
ListBotWork(context.Context, RepoRef) ([]Change, error)
}
type ForgeExecutionChecks ¶
type ForgeExecutionChecks interface {
WriteExecutionCheck(context.Context, ExecutionCheckRequest) (ExecutionCheck, error)
ReadExecutionCheck(context.Context, RepoRef, string) (ExecutionCheck, error)
}
type ForgeFreshness ¶
type ForgeInventory ¶
type ForgeInventory interface {
ProbeCapabilities(context.Context) (Capabilities, error)
ListRepositories(context.Context, InventoryRequest) (domain.Page[Repository], error)
GetRepository(context.Context, RepoRef) (Repository, error)
ReadFileAtRef(context.Context, RepoRef, string, string) (File, error)
ResolveRef(context.Context, RepoRef, string) (string, error)
}
type ForgeMerge ¶
type ForgeMerge interface {
RequestNativeMergeOrQueue(context.Context, MergeRequest) (MergeResult, error)
ReadMergeResult(context.Context, RepoRef, string) (MergeResult, error)
}
type ForgePipelineControl ¶
type ForgePipelineControl interface {
CancelPipeline(context.Context, PipelineRequest) (DeploymentStatus, error)
}
type ForgeProtection ¶
type ForgeProtection interface {
ReadEffectiveRules(context.Context, RepoRef, string) (Rules, error)
EvaluateNativeEligibility(context.Context, RepoRef, string) (NativeEligibility, error)
ReadApprovals(context.Context, RepoRef, string) ([]Approval, error)
ReadQueueState(context.Context, RepoRef, string) (QueueState, error)
}
type ForgeQueueControl ¶
type ForgeQueueControl interface {
CancelNativeQueue(context.Context, QueueCancelRequest) (QueueState, error)
}
type ForgeQueuePrerequisites ¶
type ForgeSource ¶
type ForgeTrainGate ¶
type InventoryRequest ¶
type IssueReader ¶
type MergeEvidence ¶
type MergeEvidence struct {
TrainGate *TrainGate `json:"train_gate,omitempty"`
ExecutionCheck CheckRule `json:"execution_check"`
Change Change `json:"change"`
Rules Rules `json:"rules"`
Checks []Check `json:"checks"`
Approvals []Approval `json:"approvals"`
Native NativeEligibility `json:"native"`
Queue QueueState `json:"queue"`
Capabilities Capabilities `json:"capabilities"`
ObservedAt time.Time `json:"observed_at"`
TargetChecks []Check `json:"target_checks,omitempty"`
UpToDate bool `json:"up_to_date,omitempty"`
}
type MergeRequest ¶
type MergeResult ¶
type NativeEligibility ¶
type NativeEligibility struct {
State string `json:"state"`
Blockers []string `json:"blockers"`
Protection []string `json:"protection,omitempty"`
HeadSHA string `json:"head_sha"`
TargetSHA string `json:"target_sha"`
}
func (NativeEligibility) OnlyProtection ¶
func (e NativeEligibility) OnlyProtection() bool
type PermissionLinker ¶
type PipelineRequest ¶
type PipelineRequest struct {
WorkflowSHA string `json:"workflow_sha"`
RulesHash string `json:"rules_hash"`
Repository RepoRef `json:"repository"`
WorkflowID string `json:"workflow_id"`
WorkflowPath string `json:"workflow_path"`
ConfigSHA256 string `json:"config_sha256"`
Ref string `json:"ref"`
SourceSHA string `json:"source_sha"`
ArtifactDigest string `json:"artifact_digest"`
Environment string `json:"environment"`
CorrelationID string `json:"correlation_id"`
Inputs map[string]string `json:"inputs"`
ObserveOnly bool `json:"observe_only"`
RunID string `json:"run_id"`
RequestedAt time.Time `json:"requested_at"`
}
type Provider ¶
type Provider interface {
ForgeInventory
ForgeEvents
ForgeChanges
ForgeProtection
ForgeMerge
ForgeDelivery
}
type QueueCancelRequest ¶
type QueueState ¶
type RefreshBranchRequest ¶
type RefreshBranchRequest struct {
Repository RepoRef
ChangeID string
HeadBranch string
TargetBranch string
ExpectedHeadSHA string
ExpectedTargetSHA string
OperationID string
}
func (RefreshBranchRequest) Valid ¶
func (r RefreshBranchRequest) Valid() bool
type Repository ¶
type Rules ¶
type Rules struct {
State domain.CapabilityState `json:"state"`
Reason string `json:"reason"`
Hash string `json:"hash"`
ObservedAt time.Time `json:"observed_at"`
RequiredChecks []CheckRule `json:"required_checks"`
RequiredApprovals int `json:"required_approvals"`
DismissStaleReviews bool `json:"dismiss_stale_reviews"`
RequireCodeOwners bool `json:"require_code_owners"`
CodeOwnersEnforced domain.CapabilityState `json:"code_owners_enforced"`
RequireStrictTarget bool `json:"require_strict_target"`
StrictTargetEnforced domain.CapabilityState `json:"strict_target_enforced"`
RequireQueue bool `json:"require_queue"`
AllowedMergeMethods []string `json:"allowed_merge_methods"`
ActorCanBypass bool `json:"actor_can_bypass"`
Unprotected bool `json:"unprotected,omitempty"`
}
type SourceEntry ¶
type SourceManifest ¶
type TrainGate ¶
type TrainGate struct {
QueueID string `json:"queue_id"`
PipelineID string `json:"pipeline_id"`
JobID string `json:"job_id"`
HeadSHA string `json:"head_sha"`
TargetSHA string `json:"target_sha"`
SHA string `json:"sha"`
CIConfigSHA256 string `json:"ci_config_sha256"`
Name string `json:"name"`
PublisherID string `json:"publisher_id"`
State string `json:"state"`
ChecksReady bool `json:"checks_ready"`
}
type TrainGateRequest ¶
type UpdateBranchRequest ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.