repository

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitPrompt

func CommitPrompt(changes string) string

func IssuePrompt

func IssuePrompt(issue string) string

func PRCommentPrompt

func PRCommentPrompt(issue, diffs, comment, diffHunk string) string

func PRPrompt

func PRPrompt(changes string) string

Types

type BranchChanges

type BranchChanges struct {
	Files   []string
	Commits []*object.Commit
	Summary string
}

type Changes

type Changes struct {
	Files   []string
	Commits []string
	Summary string
}

type Comment

type Comment struct {
	ID           int64           `json:"id"`
	Body         string          `json:"body"`
	DiffHunk     string          `json:"diff_hunk,omitempty"`
	HTMLURL      string          `json:"html_url"`
	URL          string          `json:"url"`
	UserID       int64           `json:"user_id"`
	Acknowledged bool            `json:"acknowledged"`
	Reactions    types.Reactions `json:"reactions"`
}

type Issue

type Issue struct {
	ID           int            `json:"id"`
	Number       int            `json:"number"`
	Title        string         `json:"title"`
	Body         string         `json:"body"`
	State        string         `json:"state"`
	HTMLURL      string         `json:"html_url"`
	SourceURL    string         `json:"source_url"`
	CreatedAt    string         `json:"created_at"`
	UpdatedAt    string         `json:"updated_at"`
	Comments     []*Comment     `json:"comments"`
	PullRequests []*PullRequest `json:"pull_requests"`
	Labels       []string       `json:"labels"`
}

func (*Issue) Completed

func (i *Issue) Completed() bool

func (*Issue) PRHasUnresolvedComments

func (i *Issue) PRHasUnresolvedComments() (*PullRequest, bool)

func (*Issue) PrExists

func (i *Issue) PrExists() bool

func (*Issue) ToString

func (i *Issue) ToString() string

type PullRequest

type PullRequest struct {
	Number          int        `json:"number"`
	Title           string     `json:"title"`
	Body            string     `json:"body"`
	CreatedAt       string     `json:"created_at"`
	UpdatedAt       string     `json:"updated_at"`
	Labels          []string   `json:"labels"`
	IssueUrl        string     `json:"issue_url"`
	LinkedIssueUrls []string   `json:"linked_issue_urls"`
	Diff            string     `json:"diff"`
	Comments        []*Comment `json:"comments"`
}

func (*PullRequest) FirstUnresolvedComment

func (p *PullRequest) FirstUnresolvedComment() *Comment

func (*PullRequest) HasUnresolvedComments

func (p *PullRequest) HasUnresolvedComments() bool

type Repository

type Repository struct {
	Path           string                  `json:"path"`
	RemoteProvider remote.ProviderSettings `json:"remoteProvider"`
	Schedule       string                  `json:"schedule"`
	LastSync       time.Time               `json:"lastSync"`
	State          *Status                 `json:"status,omitempty"`
	RemotePath     string                  `json:"remotePath,omitempty"`
	Issues         map[int]*Issue          `json:"-"`
	PullRequests   map[int]*PullRequest    `json:"-"`
	Mu             sync.RWMutex            `json:"-"`
	Locked         bool                    `json:"locked"`
	Logger         logr.Logger             `json:"-"`
	Remote         remote.Provider         `json:"-"`
}

func NewRepository

func NewRepository(path string) *Repository

func NewRepositoryWithRemote

func NewRepositoryWithRemote(path string, remote remote.Provider) *Repository

func (*Repository) ChangeSummary

func (r *Repository) ChangeSummary() (string, error)

func (*Repository) CheckoutBranch

func (r *Repository) CheckoutBranch(branchName string) error

func (*Repository) Clone

func (r *Repository) Clone(repoURL string) error

func (*Repository) Commit

func (r *Repository) Commit(message string) error

func (*Repository) CreateBranch

func (r *Repository) CreateBranch(branchName string) error

func (*Repository) Fetch

func (r *Repository) Fetch() error

func (*Repository) GetIssues

func (r *Repository) GetIssues() ([]*Issue, error)

func (*Repository) GetPullRequests

func (r *Repository) GetPullRequests() []*PullRequest

func (*Repository) Push

func (r *Repository) Push() error

func (*Repository) Reset

func (r *Repository) Reset() error

func (*Repository) Status

func (r *Repository) Status() (*Status, error)

func (*Repository) Sync

func (r *Repository) Sync(agents map[int]*agent.Agent) error

func (*Repository) UpdateIssues

func (r *Repository) UpdateIssues() error

func (*Repository) UpdatePullRequests

func (r *Repository) UpdatePullRequests() error

func (*Repository) UpdateStatus

func (r *Repository) UpdateStatus() error

func (*Repository) Upsert

func (r *Repository) Upsert(repoURL string) error

type Status

type Status struct {
	HasChanges    bool     `json:"hasChanges"`
	ChangedFiles  []string `json:"changedFiles"`
	CurrentBranch string   `json:"currentBranch"`
	IsClean       bool     `json:"isClean"`
}

Jump to

Keyboard shortcuts

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