Documentation
¶
Index ¶
- func EqualForConflictCheck(a, b Issue) bool
- func EqualIgnoringSyncedAt(a, b Issue) bool
- func FileName(number IssueNumber, title string) string
- func PathFor(dir string, number IssueNumber, title string) string
- func Render(issue Issue) (string, error)
- func Slugify(title string) string
- func WriteFile(path string, issue Issue) error
- type FieldSet
- type FrontMatter
- type InfoSection
- type Issue
- type IssueNumber
- type IssueRef
- type MergeResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualForConflictCheck ¶
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 FileName ¶
func FileName(number IssueNumber, title string) string
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
ComputeChanges returns which fields differ between base and changed.
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
}
type IssueNumber ¶
type IssueNumber string
func (IssueNumber) IsLocal ¶
func (n IssueNumber) IsLocal() bool
func (IssueNumber) String ¶
func (n IssueNumber) String() string
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.