linear

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package linear implements the Linear GraphQL adapter.

Index

Constants

This section is empty.

Variables

View Source
var ErrRateLimited = errors.New("linear: rate limited (429)")

ErrRateLimited is returned when Linear returns HTTP 429.

Functions

This section is empty.

Types

type LinearAdapter

type LinearAdapter struct {
	// contains filtered or unexported fields
}

LinearAdapter implements adapter.WorkItemAdapter against the Linear GraphQL API.

func New

New creates a LinearAdapter from the given configuration.

func (*LinearAdapter) AddComment

func (a *LinearAdapter) AddComment(ctx context.Context, externalID string, body string) error

AddComment posts a comment to the Linear issue identified by the Substrate ExternalID. The externalID ("LIN-FOO-123") is resolved to the Linear internal UUID before mutation.

func (*LinearAdapter) Capabilities

func (a *LinearAdapter) Capabilities() adapter.AdapterCapabilities

Capabilities describes what the Linear adapter supports.

func (*LinearAdapter) Fetch

func (a *LinearAdapter) Fetch(ctx context.Context, externalID string) (domain.Session, error)

Fetch retrieves a work item by its Substrate ExternalID (e.g. "LIN-FOO-123"). It reconstructs the Linear identifier and queries by identifier.

func (*LinearAdapter) ListSelectable

func (a *LinearAdapter) ListSelectable(ctx context.Context, opts adapter.ListOpts) (*adapter.ListResult, error)

ListSelectable returns items available for interactive selection, dispatched by scope.

func (*LinearAdapter) Name

func (a *LinearAdapter) Name() string

Name returns the adapter identifier.

func (*LinearAdapter) OnEvent

func (a *LinearAdapter) OnEvent(ctx context.Context, event domain.SystemEvent) error

OnEvent reacts to system events: plan.approved → set in_progress; work_item.completed → set done. Malformed payloads or missing external_id are silently ignored to avoid disrupting the workflow.

func (*LinearAdapter) Resolve

Resolve converts a user selection into a WorkItem, aggregating multiple items when needed.

func (*LinearAdapter) UpdateState

func (a *LinearAdapter) UpdateState(ctx context.Context, externalID string, state domain.TrackerState) error

UpdateState maps the Substrate TrackerState to a Linear workflow state via StateMappings and applies the update. If no mapping is configured for the state, the call is a no-op.

func (*LinearAdapter) Watch

Watch polls Linear for assigned issues and emits events when they appear or change state. It respects context cancellation and applies exponential backoff on rate limiting.

Jump to

Keyboard shortcuts

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