stories

package
v0.0.0-...-614ca16 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultStoryRegister = &StoryRegister{}

Functions

func Configure

func Configure(storyHandlerConfigs []values.Values)

func RegisterFactory

func RegisterFactory(factory StoryRegistrationFactory)

Types

type BranchRef

type BranchRef struct {
	Repo   issues.RepoRef
	Branch git.BranchName
}

type Dependency

type Dependency struct {
	// Identifier string which the provider can understand
	ID string `yaml:"id,omitempty"`
	// URL link which can be shown to users
	URL string `yaml:"url,omitempty"`
	// Reference string which can be embedded in an issue
	Reference string `yaml:"reference,omitempty"`
	// Display name for the dependency
	Title string `yaml:"title,omitempty"`
}

type Event

type Event struct {
	Payload interface{}
	StoryID string
	Story   *Story
	URL     string
	Issue   *issues.IssueRef
}

func (Event) Validated

func (e Event) Validated() (*ValidatedEvent, error)

type EventBranchCreated

type EventBranchCreated struct {
	Branch string
}

type EventPRApproved

type EventPRApproved struct {
	FromBranch string
	ToBranch   string
}

type EventPRCreated

type EventPRCreated struct {
	FromBranch string
	ToBranch   string
}

type EventPRMerged

type EventPRMerged struct {
	FromBranch string
	ToBranch   string
}

type Story

type Story struct {
	// Identifier string which the provider can understand
	ID    string `yaml:"id,omitempty"`
	Title string `yaml:"title,omitempty"`
	// URL link which can be shown to users
	URL string `yaml:"url,omitempty"`
	// Reference string which can be embedded in an issue
	Reference string `yaml:"reference,omitempty"`

	Body          string   `yaml:"body,omitempty"`
	Assignee      string   `yaml:"assignee,omitempty"`
	Assignees     []string `yaml:"assignees,omitempty"`
	Milestone     string   `yaml:"milestone,omitempty"`
	Estimate      string   `yaml:"estimate,omitempty"`
	Epics         []string `yaml:"epics,omitempty"`
	ProgressState string   `yaml:"progressState,omitempty"`
	Labels        []string `yaml:"labels,omitempty"`
	IsClosed      bool     `yaml:"isClosed,omitempty"`
	// Metadata about the story that is provider specific
	ProviderState interface{} `yaml:"-"`
}

type StoryHandler

type StoryHandler interface {
	GetStory(id string) (*Story, error)

	HandleEvent(event *ValidatedEvent) error

	GetBranches(story *Story) ([]BranchRef, error)
}

func GetStoryHandler

func GetStoryHandler(ctx command.ExecutionContext, storyID string) (StoryHandler, error)

type StoryHandlerRegistration

type StoryHandlerRegistration struct {
	IDPattern      *regexp.Regexp
	HandlerFactory func(ctx command.ExecutionContext) (StoryHandler, error)
}

type StoryRegister

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

func (*StoryRegister) Configure

func (s *StoryRegister) Configure(storyHandlerConfigs []values.Values)

func (*StoryRegister) GetStoryClient

func (s *StoryRegister) GetStoryClient(ctx command.ExecutionContext, storyID string) (StoryHandler, error)

func (*StoryRegister) RegisterFactory

func (s *StoryRegister) RegisterFactory(factory StoryRegistrationFactory)

type StoryRegistrationFactory

type StoryRegistrationFactory struct {
	Factory func(v []values.Values) []StoryHandlerRegistration
	Help    string
}

type ValidatedEvent

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

func (ValidatedEvent) Issue

func (v ValidatedEvent) Issue() issues.IssueRef

func (ValidatedEvent) Payload

func (v ValidatedEvent) Payload() interface{}

func (*ValidatedEvent) SetStory

func (v *ValidatedEvent) SetStory(story *Story)

func (ValidatedEvent) Story

func (v ValidatedEvent) Story() *Story

func (ValidatedEvent) StoryID

func (v ValidatedEvent) StoryID() string

func (ValidatedEvent) URL

func (v ValidatedEvent) URL() string

Jump to

Keyboard shortcuts

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