Documentation
¶
Overview ¶
Package tracker connects immutable local issue identities to an opt-in Jira mirror. Local commits and remote mutations are separate, visible operations.
Index ¶
- Variables
- func Enqueue(ctx context.Context, tx *sql.Tx, id int64) error
- func ResolveKey(ctx context.Context, q queryer, project, key string) (string, error)
- func ResolveKeyByProjectID(ctx context.Context, q queryer, id int64, key string) (string, error)
- type Client
- type Config
- type Link
- type Plan
- type PlanItem
- type Store
- func (s *Store) Close() error
- func (s *Store) Configuration(ctx context.Context, project string) (Config, error)
- func (s *Store) Configure(ctx context.Context, project string, c Config) error
- func (s *Store) Disable(ctx context.Context, project string) error
- func (s *Store) Enable(ctx context.Context, project string) error
- func (s *Store) Flush(ctx context.Context, project, key string) error
- func (s *Store) FlushAutomatic(ctx context.Context, project, key string) error
- func (s *Store) Guard(ctx context.Context, project, key string) error
- func (s *Store) Link(ctx context.Context, project, key string) (Link, error)
- func (s *Store) Migrate(ctx context.Context, project string) ([]Link, error)
- func (s *Store) Plan(ctx context.Context, project string) (Plan, error)
- func (s *Store) Reconcile(ctx context.Context, project, key string) (Link, error)
- func (s *Store) ReconcileWithRetryIfAbsent(ctx context.Context, project, key string, retryIfAbsent bool) (Link, error)
- func (s *Store) Refresh(ctx context.Context, project, key string) (refreshed Link, refreshError error)
- func (s *Store) SetClientFactory(factory func(context.Context, string, Config) (Client, error))
- func (s *Store) Status(ctx context.Context, project string) ([]Link, error)
Constants ¶
This section is empty.
Variables ¶
var ErrConflict = errors.New("Jira issue changed; refresh or reconcile before writing")
var ErrNotConfigured = errors.New("Jira tracker is not configured")
var ErrNotLinked = errors.New("issue has no Jira link")
var ErrPending = errors.New("Jira synchronization is pending")
Functions ¶
func ResolveKey ¶
ResolveKey preserves exact local-key precedence and rejects ambiguous remote aliases.
Types ¶
type Client ¶
type Client interface {
GetIssue(context.Context, string) (jira.Issue, error)
CreateIssue(context.Context, jira.IssueFields) (jira.Issue, error)
UpdateIssue(context.Context, string, map[string]any) error
Transitions(context.Context, string) ([]jira.Transition, error)
TransitionIssue(context.Context, string, string) error
SearchByLabel(context.Context, string, string, string) (jira.SearchPage, error)
}
Client is the remote boundary, replaceable in disposable integration tests.
type Config ¶
type Config struct {
BaseURL string `json:"baseURL"`
Email string `json:"email"`
TokenIdentifier string `json:"tokenIdentifier"`
RemoteProject string `json:"remoteProject"`
Types map[string]string `json:"types"`
Priorities map[string]string `json:"priorities"`
States map[string]map[string]string `json:"states"`
Enabled bool `json:"enabled"`
}
Config contains provider metadata only, never credential values. Maps use Jira IDs.
type Link ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Configuration ¶
func (*Store) Flush ¶
Flush explicitly attempts queued work, including while automatic routing is disabled.
func (*Store) FlushAutomatic ¶ added in v0.34.2
FlushAutomatic sends queued work only while automatic routing is enabled. Disabled routing leaves existing intents and remote identities intact for explicit Flush, Migrate, or Reconcile operations.
func (*Store) ReconcileWithRetryIfAbsent ¶ added in v0.32.0
func (*Store) Refresh ¶
func (s *Store) Refresh(ctx context.Context, project, key string) (refreshed Link, refreshError error)
Refresh imports remote-owned fields. Contract/approval validation precedes local writes.
func (*Store) SetClientFactory ¶
SetClientFactory is for embedding/tests; credentials remain managed by default.