services

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangelogWarning added in v1.7.0

type ChangelogWarning struct {
	Type    string
	Message string
}

ChangelogWarning represents a validation warning

type CommitService

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

func NewCommitService

func NewCommitService(gitSvc commitGitService, aiSvc ai.CommitSummarizer, opts ...Option) *CommitService

func (*CommitService) GenerateSuggestions

func (s *CommitService) GenerateSuggestions(ctx context.Context, count int, issueNumber int, files []string, progress func(models.ProgressEvent)) ([]models.CommitSuggestion, error)

type IssueGeneratorOption

type IssueGeneratorOption func(*IssueGeneratorService)

func WithIssueConfig

func WithIssueConfig(cfg *config.Config) IssueGeneratorOption

func WithIssueTemplateService

func WithIssueTemplateService(ts issueTemplateService) IssueGeneratorOption

func WithIssueVCSClient

func WithIssueVCSClient(vcs vcs.VCSClient) IssueGeneratorOption

type IssueGeneratorService

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

func NewIssueGeneratorService

func NewIssueGeneratorService(
	gitSvc issueGitService,
	ai ai.IssueContentGenerator,
	opts ...IssueGeneratorOption,
) *IssueGeneratorService

func (*IssueGeneratorService) CreateIssue

func (s *IssueGeneratorService) CreateIssue(ctx context.Context, result *models.IssueGenerationResult, assignees []string) (*models.Issue, error)

func (*IssueGeneratorService) FindSimilarOpenIssues added in v1.8.0

func (s *IssueGeneratorService) FindSimilarOpenIssues(ctx context.Context, title string) ([]models.Issue, error)

CreateIssue creates a new issue in the repository using the configured VCS client. It returns the created issue with its assigned number and URL. FindSimilarOpenIssues does a lightweight, local keyword-overlap match of the generated title against currently open issues, so the CLI can warn about likely duplicates before creating a new one. No AI call involved — this only needs to be fast and cheap, not exhaustive.

func (*IssueGeneratorService) GenerateFromDescription

func (s *IssueGeneratorService) GenerateFromDescription(ctx context.Context, description string, skipLabels bool, autoTemplate bool, explicitTemplate *models.IssueTemplate) (*models.IssueGenerationResult, error)

GenerateFromDescription generates issue content based on a manual description. Useful when the user wants to create an issue without having local changes.

func (*IssueGeneratorService) GenerateFromDiff

func (s *IssueGeneratorService) GenerateFromDiff(ctx context.Context, hint string, skipLabels bool, autoTemplate bool, explicitTemplate *models.IssueTemplate) (*models.IssueGenerationResult, error)

GenerateFromDiff generates issue content based on the current git diff. It analyzes local changes (staged and unstaged) to create an appropriate title, description, and labels.

func (*IssueGeneratorService) GenerateFromPR

func (s *IssueGeneratorService) GenerateFromPR(ctx context.Context, prNumber int, hint string, skipLabels bool, autoTemplate bool, explicitTemplate *models.IssueTemplate) (*models.IssueGenerationResult, error)

func (*IssueGeneratorService) GenerateWithTemplate

func (s *IssueGeneratorService) GenerateWithTemplate(ctx context.Context, templateName string, hint string, fromDiff bool, description string, skipLabels bool) (*models.IssueGenerationResult, error)

func (*IssueGeneratorService) GetAuthenticatedUser

func (s *IssueGeneratorService) GetAuthenticatedUser(ctx context.Context) (string, error)

GetAuthenticatedUser gets the username of the current authenticated user.

func (*IssueGeneratorService) InferBranchName

func (s *IssueGeneratorService) InferBranchName(issueNumber int, labels []string) string

func (*IssueGeneratorService) LinkIssueToPR

func (s *IssueGeneratorService) LinkIssueToPR(ctx context.Context, prNumber int, issueNumber int) error

LinkIssueToPR links an issue to a Pull Request by adding "Closes #issueNumber" to the PR description.

func (*IssueGeneratorService) SelectTemplateWithAI

func (s *IssueGeneratorService) SelectTemplateWithAI(ctx context.Context, title, description string, changedFiles, labels []string) (*models.IssueTemplate, error)

SelectTemplateWithAI uses AI to analyze the context (diff/description) and select the best template

type IssueOption

type IssueOption func(*IssueTemplateService)

func WithTemplateConfig

func WithTemplateConfig(cfg *config.Config) IssueOption

type IssueTemplateService

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

func NewIssueTemplateService

func NewIssueTemplateService(opts ...IssueOption) *IssueTemplateService

func (*IssueTemplateService) GetPRTemplate

func (s *IssueTemplateService) GetPRTemplate(ctx context.Context, name string) (*models.IssueTemplate, error)

GetPRTemplate loads a specific PR template by name

func (*IssueTemplateService) GetPRTemplatesDir

func (s *IssueTemplateService) GetPRTemplatesDir(ctx context.Context) (string, error)

GetPRTemplatesDir returns the directory where PR templates are stored

func (*IssueTemplateService) GetTemplateByName

func (s *IssueTemplateService) GetTemplateByName(ctx context.Context, name string) (*models.IssueTemplate, error)

func (*IssueTemplateService) GetTemplatesDir

func (s *IssueTemplateService) GetTemplatesDir(ctx context.Context) (string, error)

func (*IssueTemplateService) InitializeTemplates

func (s *IssueTemplateService) InitializeTemplates(ctx context.Context, force bool) error

func (*IssueTemplateService) ListPRTemplates

func (s *IssueTemplateService) ListPRTemplates(ctx context.Context) ([]models.TemplateMetadata, error)

func (*IssueTemplateService) ListTemplates

func (s *IssueTemplateService) ListTemplates(ctx context.Context) ([]models.TemplateMetadata, error)

func (*IssueTemplateService) LoadMarkdownTemplate

func (s *IssueTemplateService) LoadMarkdownTemplate(ctx context.Context, filePath string) (*models.IssueTemplate, error)

LoadMarkdownTemplate loads a Markdown template file

func (*IssueTemplateService) LoadTemplate

func (s *IssueTemplateService) LoadTemplate(ctx context.Context, filePath string) (*models.IssueTemplate, error)

func (*IssueTemplateService) MergeWithGeneratedContent

func (s *IssueTemplateService) MergeWithGeneratedContent(template *models.IssueTemplate, generated *models.IssueGenerationResult) *models.IssueGenerationResult

type Option

type Option func(*CommitService)

func WithConfig

func WithConfig(cfg *config.Config) Option

func WithTicketManager

func WithTicketManager(tm tickets.TicketManager) Option

func WithVCSClient

func WithVCSClient(vcsClient vcs.VCSClient) Option

type PROption

type PROption func(*PRService)

func WithPRAIProvider

func WithPRAIProvider(ai prAIProvider) PROption

func WithPRConfig

func WithPRConfig(cfg *config.Config) PROption

func WithPRTemplateService

func WithPRTemplateService(ts prTemplateService) PROption

func WithPRVCSClient

func WithPRVCSClient(vcs prVCSClient) PROption

type PRService

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

func NewPRService

func NewPRService(opts ...PROption) *PRService

func (*PRService) SummarizePR

func (s *PRService) SummarizePR(ctx context.Context, prNumber int, hint string, progress func(models.ProgressEvent)) (models.PRSummary, error)

type ReleaseOption

type ReleaseOption func(*ReleaseService)

func WithReleaseConfig

func WithReleaseConfig(cfg *config.Config) ReleaseOption

func WithReleaseNotesGenerator

func WithReleaseNotesGenerator(rng ai.ReleaseNotesGenerator) ReleaseOption

func WithReleaseVCSClient

func WithReleaseVCSClient(vcs vcs.VCSClient) ReleaseOption

type ReleaseService

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

func NewReleaseService

func NewReleaseService(
	gitSvc releaseGitService,
	opts ...ReleaseOption,
) *ReleaseService

func (*ReleaseService) AnalyzeNextRelease

func (s *ReleaseService) AnalyzeNextRelease(ctx context.Context) (*models.Release, error)

func (*ReleaseService) BuildChangelogPreview added in v1.7.0

func (s *ReleaseService) BuildChangelogPreview(ctx context.Context, release *models.Release, notes *models.ReleaseNotes) string

BuildChangelogPreview generates a preview of how the CHANGELOG entry will look

func (*ReleaseService) CommitChangelog

func (s *ReleaseService) CommitChangelog(ctx context.Context, version string) error

func (*ReleaseService) CreateTag

func (s *ReleaseService) CreateTag(ctx context.Context, version, message string) error

func (*ReleaseService) EnrichReleaseContext

func (s *ReleaseService) EnrichReleaseContext(ctx context.Context, release *models.Release) error

func (*ReleaseService) EnsureUnreleasedSection added in v1.7.0

func (s *ReleaseService) EnsureUnreleasedSection(filename string) error

EnsureUnreleasedSection ensures an Unreleased section exists in the CHANGELOG

func (*ReleaseService) FindVersionFile

func (s *ReleaseService) FindVersionFile(ctx context.Context) (string, string, error)

func (*ReleaseService) GenerateReleaseNotes

func (s *ReleaseService) GenerateReleaseNotes(ctx context.Context, release *models.Release) (*models.ReleaseNotes, error)

func (*ReleaseService) GetRelease

func (s *ReleaseService) GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)

func (*ReleaseService) MoveUnreleasedToVersion added in v1.7.0

func (s *ReleaseService) MoveUnreleasedToVersion(filename string, release *models.Release, notes *models.ReleaseNotes) error

MoveUnreleasedToVersion moves Unreleased section content to a new version

func (*ReleaseService) PublishRelease

func (s *ReleaseService) PublishRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, draft bool, buildBinaries bool, progressCh chan<- models.BuildProgress) error

func (*ReleaseService) PushChanges

func (s *ReleaseService) PushChanges(ctx context.Context) error

PushChanges pushes committed changes to the remote repository

func (*ReleaseService) PushTag

func (s *ReleaseService) PushTag(ctx context.Context, version string) error

func (*ReleaseService) TagExists added in v1.8.0

func (s *ReleaseService) TagExists(ctx context.Context, version string) bool

func (*ReleaseService) UpdateAppVersion

func (s *ReleaseService) UpdateAppVersion(ctx context.Context, version string) error

func (*ReleaseService) UpdateLocalChangelog

func (s *ReleaseService) UpdateLocalChangelog(ctx context.Context, release *models.Release, notes *models.ReleaseNotes) error

func (*ReleaseService) UpdateRelease

func (s *ReleaseService) UpdateRelease(ctx context.Context, version, body string) error

func (*ReleaseService) ValidateChangelog added in v1.7.0

func (s *ReleaseService) ValidateChangelog(filename string) ([]ChangelogWarning, error)

ValidateChangelog validates the entire CHANGELOG file

func (*ReleaseService) ValidateMainBranch

func (s *ReleaseService) ValidateMainBranch(ctx context.Context) error

type UpdateCache

type UpdateCache struct {
	LastCheck   time.Time `json:"last_check"`
	LatestKnown string    `json:"latest_known"`
}

type UpdateInfo added in v1.6.0

type UpdateInfo struct {
	CurrentVersion string
	LatestVersion  string
	IsAvailable    bool
}

UpdateInfo contains information about an available update

type VersionOption

type VersionOption func(*VersionUpdater)

func WithCurrentVersion

func WithCurrentVersion(version string) VersionOption

type VersionUpdater

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

func NewVersionUpdater

func NewVersionUpdater(opts ...VersionOption) *VersionUpdater

func (*VersionUpdater) CheckForUpdates

func (v *VersionUpdater) CheckForUpdates(ctx context.Context) (string, bool)

func (*VersionUpdater) GetUpdateInfo added in v1.6.0

func (v *VersionUpdater) GetUpdateInfo() (*UpdateInfo, error)

GetUpdateInfo returns information about available updates without displaying anything Returns nil if no update is available or if update checks are disabled

func (*VersionUpdater) UpdateCLI

func (v *VersionUpdater) UpdateCLI(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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