github

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 New

func New(authenticated bool, target config.Target) (*Adapter, error)

func NewWithClient

func NewWithClient(client *gh.Client) *Adapter

func (*Adapter) CheckAccess added in v0.24.0

func (a *Adapter) CheckAccess(ctx context.Context, target config.Target) (string, error)

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) Execute

func (a *Adapter) Execute(
	ctx context.Context,
	target config.Target,
	operation provider.Operation,
	resolved map[domain.ItemID]provider.RemoteRef,
) (provider.RemoteRef, error)

func (*Adapter) ID

func (a *Adapter) ID() string

func (*Adapter) Plan

func (a *Adapter) Plan(
	_ context.Context,
	input provider.PlanInput,
	target config.Target,
) ([]provider.Operation, []string, error)

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.

func (*Adapter) Sync added in v0.21.6

func (a *Adapter) Sync(
	ctx context.Context,
	target config.Target,
	request provider.SyncRequest,
) ([]provider.Operation, []string, error)

Jump to

Keyboard shortcuts

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