issue

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualForConflictCheck

func EqualForConflictCheck(a, b Issue) bool

EqualForConflictCheck compares issues ignoring SyncedAt and StateReason. StateReason is ignored because GitHub can set it automatically when closing issues, which would cause false conflicts.

func EqualIgnoringSyncedAt

func EqualIgnoringSyncedAt(a, b Issue) bool

func FileName

func FileName(number IssueNumber, title string) string

func PathFor

func PathFor(dir string, number IssueNumber, title string) string

func Render

func Render(issue Issue) (string, error)

func Slugify

func Slugify(title string) string

func WriteFile

func WriteFile(path string, issue Issue) error

Types

type FieldSet added in v0.3.0

type FieldSet struct {
	Title     bool
	Labels    bool
	Assignees bool
	Milestone bool
	IssueType bool
	Projects  bool
	State     bool
	Parent    bool
	BlockedBy bool
	Blocks    bool
	Body      bool
}

FieldSet tracks which fields have been modified.

func ComputeChanges added in v0.3.0

func ComputeChanges(base, changed Issue) FieldSet

ComputeChanges returns which fields differ between base and changed.

func (FieldSet) Fields added in v0.3.0

func (f FieldSet) Fields() []string

Fields returns a list of field names that are set.

func (FieldSet) IsEmpty added in v0.3.0

func (f FieldSet) IsEmpty() bool

IsEmpty returns true if no fields are set.

func (FieldSet) Overlaps added in v0.3.0

func (f FieldSet) Overlaps(other FieldSet) FieldSet

Overlaps returns a FieldSet containing fields that are set in both.

type FrontMatter

type FrontMatter struct {
	Title       string       `yaml:"title"`
	Labels      []string     `yaml:"labels,omitempty"`
	Assignees   []string     `yaml:"assignees,omitempty"`
	Milestone   string       `yaml:"milestone,omitempty"`
	IssueType   string       `yaml:"type,omitempty"`
	Projects    []string     `yaml:"projects,omitempty"`
	State       string       `yaml:"state,omitempty"`
	StateReason *string      `yaml:"state_reason"`
	Parent      *IssueRef    `yaml:"parent,omitempty"`
	BlockedBy   []IssueRef   `yaml:"blocked_by,omitempty"`
	Blocks      []IssueRef   `yaml:"blocks,omitempty"`
	SyncedAt    *time.Time   `yaml:"synced_at,omitempty"`
	Info        *InfoSection `yaml:"info,omitempty"`
}

type InfoSection

type InfoSection struct {
	Author    string     `yaml:"author,omitempty"`
	CreatedAt *time.Time `yaml:"created_at,omitempty"`
	UpdatedAt *time.Time `yaml:"updated_at,omitempty"`
}

InfoSection contains read-only informational fields that are synced from GitHub but never written back. These are for display/filtering only.

type Issue

type Issue struct {
	Number      IssueNumber
	Title       string
	Labels      []string
	Assignees   []string
	Milestone   string
	IssueType   string
	Projects    []string
	State       string
	StateReason *string
	Parent      *IssueRef
	BlockedBy   []IssueRef
	Blocks      []IssueRef
	SyncedAt    *time.Time
	Body        string

	// Informational fields (read-only, not synced back to GitHub)
	Author    string
	CreatedAt *time.Time
	UpdatedAt *time.Time
}

func Normalize

func Normalize(issue Issue) Issue

func Parse

func Parse(data []byte) (Issue, error)

func ParseFile

func ParseFile(path string) (Issue, error)

type IssueNumber

type IssueNumber string

func (IssueNumber) IsLocal

func (n IssueNumber) IsLocal() bool

func (IssueNumber) String

func (n IssueNumber) String() string

type IssueRef

type IssueRef string

func (IssueRef) IsLocal

func (r IssueRef) IsLocal() bool

func (IssueRef) MarshalYAML

func (r IssueRef) MarshalYAML() (interface{}, error)

func (IssueRef) String

func (r IssueRef) String() string

func (*IssueRef) UnmarshalYAML

func (r *IssueRef) UnmarshalYAML(value *yaml.Node) error

type MergeResult added in v0.3.0

type MergeResult struct {
	// Merged contains the merged issue (only valid if OK is true).
	Merged Issue
	// OK is true if the merge succeeded without conflicts.
	OK bool
	// ConflictingFields lists the fields that conflict (only if OK is false).
	ConflictingFields FieldSet
	// LocalChanges lists fields changed locally.
	LocalChanges FieldSet
	// RemoteChanges lists fields changed remotely.
	RemoteChanges FieldSet
}

MergeResult represents the outcome of a three-way merge.

func ThreeWayMerge added in v0.3.0

func ThreeWayMerge(base, local, remote Issue) MergeResult

ThreeWayMerge attempts to merge local and remote changes against a common base. If changes don't overlap, it returns a merged issue. Otherwise, it returns information about which fields conflict.

Jump to

Keyboard shortcuts

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