onboard

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 Manager

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

Manager manages onboarding process

func NewManager

func NewManager(client *api.RESTClient) (*Manager, error)

NewManager creates a new onboarding manager

func (*Manager) GenerateContent

func (m *Manager) GenerateContent(issues []OnboardIssue, repoName string, opts Options) (string, error)

GenerateContent generates the complete content using the template

func (*Manager) SearchOnboardIssues

func (m *Manager) SearchOnboardIssues(_ context.Context, repoName string, opts Options) ([]OnboardIssue, error)

SearchOnboardIssues generates onboarding issues for new contributors

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, repoName string, opts Options) error

Update updates or creates an onboarding issue

type OnboardIssue

type OnboardIssue struct {
	Difficulty string `json:"difficulty"` // Easy, Medium, Hard
	Status     string `json:"status"`     // open, closed
	Assignee   string `json:"assignee,omitempty"`
	Number     int    `json:"number"` // Issue number for sorting
	Category   string `json:"category"`
}

OnboardIssue represents an issue suitable for new contributors

type Options

type Options struct {
	// Issue labels configuration
	OnboardLabels    []string // Labels for identifying suitable issues for community contributions
	DifficultyLabels []string // Labels indicating the difficulty of issues
	CategoryLabels   []string // Labels for classifying issues by type

	// Target issue configuration
	TargetLabel string // Label used to locate the issue where onboarding content will be updated
	TargetTitle string // Title of the target issue where onboarding content will be updated

	// Command behavior
	DryRun      bool // If true, only show preview without making changes
	AutoConfirm bool // If true, skip confirmation prompt
}

Options represents the options for onboarding

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the default options

type Stats

type Stats struct {
	TotalIssues      int      `json:"total_issues"`
	CompletedIssues  int      `json:"completed_issues"`
	InProgressIssues int      `json:"in_progress_issues"`
	UnassignedIssues int      `json:"unassigned_issues"`
	Contributors     []string `json:"contributors"`
}

Stats represents statistics about the issues

type TemplateData

type TemplateData struct {
	RepoName         string                               `json:"repo_name"`
	IssuesByCategory map[string]map[string][]OnboardIssue `json:"issues_by_category"`
	DifficultyLabels []string                             `json:"difficulty_labels"`
	CategoryLabels   []string                             `json:"category_labels"`
	Stats            Stats                                `json:"stats"`
	OnboardLabels    []string                             `json:"onboard_labels"`
}

TemplateData represents the data passed to the template

Jump to

Keyboard shortcuts

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