utils

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSCMProvider added in v0.4.0

func CreateSCMProvider(repoInfo *SharedRepoInfo) (services.SCMProvider, error)

CreateSCMProvider creates the appropriate SCM provider for the repository

func ExtractIssueInfo added in v0.6.1

func ExtractIssueInfo(branchName string) (string, int, error)

ExtractIssueInfo extracts the project name (optional) and issue number from a branch name. Branch names can be in the format:

  • 123-branch-name (same repo)
  • project-123-branch-name (cross-repo)

Returns: (projectName, issueNumber, error) If projectName is empty, the issue is in the same repo as the branch.

func GenerateMilestone

func GenerateMilestone(t time.Time) string

GenerateMilestone creates a milestone string in the format YYYY.QN based on the provided time For example: 2025.Q1 for January-March, 2025.Q2 for April-June, etc.

func GetReadyLabel added in v0.4.0

func GetReadyLabel(cfg *config.Settings, repo *config.Repository, overrideLabel string) string

GetReadyLabel returns the appropriate ready label for the repository: the override, else the per-repo label, else the global label, else "".

func GetReadyStatus added in v0.4.1

func GetReadyStatus(cfg *config.Settings, repo *config.Repository, overrideStatus string) string

GetReadyStatus returns the appropriate ready status for the repository. An empty result means no status is configured and the update is skipped.

func GetUnreadyLabel added in v0.4.1

func GetUnreadyLabel(cfg *config.Settings, repo *config.Repository, overrideLabel string) string

GetUnreadyLabel returns the appropriate unready label for the repository. An empty result means only the ready label is removed.

func GetUnreadyStatus added in v0.4.1

func GetUnreadyStatus(cfg *config.Settings, repo *config.Repository, overrideStatus string) string

GetUnreadyStatus returns the appropriate unready status for the repository. An empty result means no status is configured and the update is skipped.

func HandleLabelAndStatusOperation added in v0.4.1

func HandleLabelAndStatusOperation(operation LabelOperation, overrideLabel string, overrideStatus string) error

HandleLabelAndStatusOperation handles adding or removing labels from an issue and updating status

func HandleLabelAndStatusOperationWithUnready added in v0.4.1

func HandleLabelAndStatusOperationWithUnready(operation LabelOperation, overrideLabel string, overrideStatus string, overrideUnreadyLabel string) error

HandleLabelAndStatusOperationWithUnready handles adding or removing labels from an issue and updating status, with unready label support

func TruncateAndDashCase

func TruncateAndDashCase(s string, maxLen int) string

TruncateAndDashCase converts a string to dash-case and truncates it to the specified length Keeps consecutive uppercase letters together (e.g., "IRSA" stays as "irsa", not "i-r-s-a")

Types

type LabelOperation added in v0.4.0

type LabelOperation int

LabelOperation represents the type of label operation

const (
	AddLabel LabelOperation = iota
	RemoveLabel
)

type SharedRepoInfo added in v0.4.0

type SharedRepoInfo struct {
	Repo        *config.Repository
	Name        string
	IsGitLab    bool
	CurrentDir  string
	IssueNumber int
	Branch      string
}

SharedRepoInfo holds information about a selected repository and related data

func SelectSharedRepository added in v0.4.0

func SelectSharedRepository() (*SharedRepoInfo, error)

SelectSharedRepository determines which repository to work with using shared logic

Jump to

Keyboard shortcuts

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