provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package provider defines the core interface and canonical types that external roadmap/product-management data sources must implement or produce to plug into omniroadmap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	Kinds                []ItemKind
	SupportsReleases     bool
	SupportsObjectives   bool
	SupportsCustomFields bool
	SupportsWrite        bool
}

Capabilities advertises what an adapter actually supports, so callers can branch at runtime instead of relying on fields silently being empty.

type CustomField

type CustomField struct {
	Key   string
	Name  string
	Value any
	Type  string
}

CustomField is a single custom field key/value pair on an Item.

type CustomFieldDefinition

type CustomFieldDefinition struct {
	ID             string
	Key            string
	Name           string
	Type           string
	AppliesToKinds []ItemKind
	Metadata       map[string]any
}

CustomFieldDefinition describes a custom field's schema (as opposed to CustomField, which is a value on a specific Item).

type GetItemRequest

type GetItemRequest struct {
	Kind ItemKind
	ID   string // the source system's own ID or reference
}

GetItemRequest identifies a single item to fetch. Kind is required because most source APIs route lookups through type-specific endpoints — there is no single, tool-agnostic ID space.

type Item

type Item struct {
	// ID is a canonical, globally-unique identifier: "<provider>:<source id>".
	ID       string
	Provider string
	SourceID string
	// SourceRef is the source system's own human-facing reference (e.g. an
	// Aha reference number like "SE-2"), where one exists.
	SourceRef string
	// SourceURL links back to the record in the source system's own UI.
	SourceURL string
	// WorkspaceRef is the source system's human-facing workspace/project
	// reference when available (e.g. an Aha product reference prefix).
	WorkspaceRef string

	Kind        ItemKind
	Name        string
	Description string

	Status   *Status
	Progress *float64 // normalized 0-100; nil if the provider doesn't track it

	// ParentID is the canonical ID of a parent Item, if this item has one
	// (e.g. a feature's initiative, or an initiative's epic).
	ParentID string
	// ReleaseID is the canonical ID of an associated Release, if any.
	ReleaseID string

	StartDate *time.Time
	DueDate   *time.Time
	CreatedAt *time.Time
	UpdatedAt *time.Time

	Owner        *Person
	Tags         []string
	CustomFields []CustomField
	Links        []Link

	// MoSCoW is an optional prioritization level: must_have, should_have,
	// could_have, or wont_have; "" = unset. Like RICE, it isn't populated
	// by adapters (no PM tool exposes it as a first-class API field) — a
	// downstream custom-field mapping layer fills it per tenant.
	MoSCoW string
	// Kano is an optional Kano Model classification: must-be, performance,
	// attractive, indifferent, reverse, or questionable (prism-roadmap's
	// vocabulary); "" = unset. Like MoSCoW, adapters don't populate it — it
	// comes from a downstream mapping or augmentation layer.
	Kano string
	// RICE holds optional RICE prioritization inputs; nil = not provided.
	RICE *RICE

	// Metadata holds provider-specific fields with no canonical equivalent.
	// Keys should be namespaced by provider, e.g. "aha.progress_source".
	Metadata map[string]any
}

Item is the canonical, tool-agnostic representation of a roadmap unit — a feature, epic, initiative, objective, or key result. Fields common across providers are typed; anything provider-specific that doesn't warrant a first-class field lives in Metadata.

type ItemKind

type ItemKind string

ItemKind identifies the kind of roadmap item a canonical Item represents.

const (
	ItemKindFeature    ItemKind = "feature"
	ItemKindEpic       ItemKind = "epic"
	ItemKindInitiative ItemKind = "initiative"
	ItemKindObjective  ItemKind = "objective"
	ItemKindKeyResult  ItemKind = "key_result"
)

Known item kinds. Not every provider supports every kind — check Capabilities.Kinds before assuming one is available.

type Link struct {
	Type  string
	URL   string
	Title string
}

Link is an external reference (source record URL, related ticket, etc.).

type ListCustomFieldDefinitionsRequest

type ListCustomFieldDefinitionsRequest struct {
	Kind ItemKind // empty means definitions for all kinds
}

ListCustomFieldDefinitionsRequest filters a ListCustomFieldDefinitions call.

type ListCustomFieldDefinitionsResponse

type ListCustomFieldDefinitionsResponse struct {
	Definitions []CustomFieldDefinition
}

ListCustomFieldDefinitionsResponse is the result of ListCustomFieldDefinitions.

type ListItemsRequest

type ListItemsRequest struct {
	Kinds   []ItemKind // empty means all kinds the provider supports
	Page    int
	PerPage int
}

ListItemsRequest filters/paginates a ListItems call.

type ListItemsResponse

type ListItemsResponse struct {
	Items      []Item
	Page       int
	PerPage    int
	TotalCount int
}

ListItemsResponse is the paginated result of ListItems.

type ListReleasesRequest

type ListReleasesRequest struct {
	Page    int
	PerPage int
}

ListReleasesRequest filters/paginates a ListReleases call.

type ListReleasesResponse

type ListReleasesResponse struct {
	Releases   []Release
	Page       int
	PerPage    int
	TotalCount int
}

ListReleasesResponse is the paginated result of ListReleases.

type ListStatusesRequest

type ListStatusesRequest struct {
	Kind ItemKind // empty means statuses for all kinds
}

ListStatusesRequest filters a ListStatuses call.

type ListStatusesResponse

type ListStatusesResponse struct {
	Statuses []Status
}

ListStatusesResponse is the result of ListStatuses.

type Person

type Person struct {
	ID    string
	Name  string
	Email string
}

Person is a minimal identity reference (assignee, owner, etc.).

type Provider

type Provider interface {
	// Name returns a short, stable identifier for this provider (e.g. "aha",
	// "productboard"), used as the Provider field on canonical types and as
	// the registry key.
	Name() string

	// Close releases any resources held by the provider (HTTP clients,
	// connections, etc.).
	Close() error

	// Capabilities reports what this provider actually supports.
	Capabilities() Capabilities

	ListItems(ctx context.Context, req *ListItemsRequest) (*ListItemsResponse, error)
	GetItem(ctx context.Context, req *GetItemRequest) (*Item, error)
	ListReleases(ctx context.Context, req *ListReleasesRequest) (*ListReleasesResponse, error)
	ListStatuses(ctx context.Context, req *ListStatusesRequest) (*ListStatusesResponse, error)
	ListCustomFieldDefinitions(ctx context.Context, req *ListCustomFieldDefinitionsRequest) (*ListCustomFieldDefinitionsResponse, error)
}

Provider is implemented by an adapter for a specific roadmap/PM data source (Aha!, ProductBoard, etc.), translating that source's own data model into omniroadmap's canonical types.

Read-only for v0.1 — no write verbs yet.

type RICE

type RICE struct {
	Reach      *float64
	Impact     *float64
	Confidence *float64
	Effort     *float64
	// Score is a precomputed RICE score, if the source provides one.
	// Consumers typically recompute (Reach × Impact × Confidence) / Effort
	// when it's nil.
	Score *float64
}

RICE holds tool-agnostic RICE prioritization inputs as raw numbers (multiplier-style values for Impact/Confidence). A nil field means the source or mapping didn't provide it. Adapters don't populate RICE — no PM tool returns it as a first-class API field; it's filled downstream by a custom-field mapping layer (some Aha tenants store RICE components as custom fields).

type Release

type Release struct {
	ID        string
	Provider  string
	SourceID  string
	SourceRef string
	SourceURL string

	Name string

	StartDate   *time.Time
	ReleaseDate *time.Time
	Released    bool

	Status   *Status
	Progress *float64

	Metadata map[string]any
}

Release is the canonical representation of a release/milestone.

type Status

type Status struct {
	ID       string
	Name     string
	Category StatusCategory
	Complete bool
	Color    string
	Position int64
}

Status represents a workflow status, normalized to a common category while preserving the source system's own name/ordering/color for display.

type StatusCategory

type StatusCategory string

StatusCategory normalizes a provider-specific workflow status into a small, tool-agnostic bucket. The underlying Status still carries the original name/ID for display.

const (
	StatusCategoryTodo       StatusCategory = "todo"
	StatusCategoryInProgress StatusCategory = "in_progress"
	StatusCategoryDone       StatusCategory = "done"
	StatusCategoryCanceled   StatusCategory = "canceled"
)

Directories

Path Synopsis
Package providertest provides a conformance test suite for provider.Provider implementations.
Package providertest provides a conformance test suite for provider.Provider implementations.

Jump to

Keyboard shortcuts

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