Documentation
¶
Index ¶
- type Adapter
- func (a *Adapter) CheckAccess(ctx context.Context, target config.Target) (string, error)
- func (a *Adapter) Confirm(ctx context.Context, target config.Target, ...) (map[string]provider.RemoteRef, error)
- func (a *Adapter) Execute(ctx context.Context, target config.Target, operation provider.Operation, ...) (provider.RemoteRef, error)
- func (a *Adapter) ID() string
- func (a *Adapter) Plan(_ context.Context, input provider.PlanInput, target config.Target) ([]provider.Operation, []string, error)
- func (a *Adapter) Preflight(ctx context.Context, target config.Target, creates []provider.Operation) error
- func (a *Adapter) Resolve(ctx context.Context, target config.Target, plan *provider.Plan, ...) (map[string]provider.RemoteRef, error)
- func (a *Adapter) Sync(ctx context.Context, target config.Target, request provider.SyncRequest) ([]provider.Operation, []string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewWithClient ¶
func (*Adapter) CheckAccess ¶ added in v0.24.0
CheckAccess confirms the credentials can read the target repository and that it takes issues.
func (*Adapter) Confirm ¶ added in v0.24.0
func (a *Adapter) Confirm(ctx context.Context, target config.Target, candidates map[string]provider.RemoteRef) (map[string]provider.RemoteRef, error)
Confirm reads each candidate issue by number, a few at once, which sees an issue the moment GitHub creates it and finds one whose discovery label was removed. An issue counts only while it is an issue, not a pull request, in the target repository, and its body still carries the candidate's marker. A confirmed issue missing the discovery label gets it back, so the next label-scoped lookup finds it; after the first refusal, such as from a token that cannot label, Confirm stops trying.
func (*Adapter) Preflight ¶ added in v0.24.0
func (a *Adapter) Preflight(ctx context.Context, target config.Target, creates []provider.Operation) error
Preflight stops apply before it creates issues the token cannot label. GitHub silently drops the labels of an issue created without write access, and a lookup that trusts the discovery label would miss the issue and create it again. A GitHub App token gets no permissions back, so only a reported lack of write access stops apply.
func (*Adapter) Resolve ¶ added in v0.16.4
func (a *Adapter) Resolve( ctx context.Context, target config.Target, plan *provider.Plan, pending []provider.Operation, ) (map[string]provider.RemoteRef, error)
Resolve finds the pending operations' issues among the discovery's. It lists only the discovery's label once that label records it labels every issue. Until then it scans the repository, labels each of the discovery's issues it finds, and then marks the label complete, so a backfill cut short resumes on the next apply. Resolve runs only during apply, so it may write.