planning

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	Title    string  `json:"title"`
	Number   int     `json:"number"`
	State    string  `json:"state"`
	Labels   []Label `json:"labels"`
	Assignee *User   `json:"assignee"`
	HTMLURL  string  `json:"html_url"`
}

Issue represents a GitHub issue

type Label

type Label struct {
	Name string `json:"name"`
}

Label represents a GitHub label

type Manager

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

Manager handles GitHub planning

func NewManager

func NewManager(client *api.RESTClient) *Manager

NewManager creates a new plan manager

func (*Manager) ListOpenMilestones

func (m *Manager) ListOpenMilestones(ctx context.Context, owner, repo string) ([]Milestone, error)

ListOpenMilestones returns a list of open milestones for the repository

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, owner, repo string, milestoneNumber int, opts Options) error

Update updates or creates a planning issue for a milestone

type Milestone

type Milestone struct {
	Title       string     `json:"title"`
	DueOn       *time.Time `json:"due_on"`
	Description string     `json:"description"`
	Number      int        `json:"number"`
	State       string     `json:"state"`
	HTMLURL     string     `json:"html_url"`
}

Milestone represents a GitHub milestone

type MilestoneStats

type MilestoneStats struct {
	TotalIssues     int
	CompletedIssues int
	Progress        float64
	Contributors    []string
}

MilestoneStats represents milestone statistics

type Options

type Options struct {
	PlanningLabel string   // Label used to locate the issue where planning content will be updated
	TargetTitle   string   // Title template of the target issue where planning content will be updated
	Categories    []string // Labels used to classify issues by type
	Priorities    []string // Labels used to indicate issue priority, ordered from high to low
	ExcludePR     bool     // If true, exclude pull requests from planning content
	DryRun        bool     // If true, only show preview without making changes
	AutoConfirm   bool     // If true, skip confirmation prompt
}

Options represents planning options

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns default planning options

type TemplateData

type TemplateData struct {
	Milestone           Milestone
	Stats               MilestoneStats
	Categories          []string
	Issues              map[string][]Issue
	UncategorizedIssues []Issue
	HighPriorityIssues  []Issue
	ProgressBar         string
	Priorities          []string
	RepoOwner           string
	RepoName            string
}

TemplateData represents the data passed to the template

type User

type User struct {
	Login string `json:"login"`
}

User represents a GitHub user

Jump to

Keyboard shortcuts

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