models

package
v0.0.0-...-78730a9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	SHA string
}

Commit represents a git commit

type CommitFile

type CommitFile struct {
	Filename    string
	Status      string
	Patch       string
	ContentsURL string
}

CommitFile represents a file changed in a commit

type GitPlatform

type GitPlatform interface {
	// GetPullRequest gets a pull request by number
	GetPullRequest(ctx context.Context, owner, repo string, number int) (*PullRequest, error)

	// GetPullRequestLabels gets the labels of a pull request
	GetPullRequestLabels(ctx context.Context, owner, repo string, number int) ([]string, error)

	// CompareCommits compares two commits and returns the files that changed
	CompareCommits(ctx context.Context, owner, repo, base, head string) ([]*CommitFile, []*Commit, error)

	// CreateReview creates a review on a pull request
	CreateReview(ctx context.Context, owner, repo string, number int, commitID string, comments []*ReviewComment, body string) error

	// CreatePRComment creates a comment on a pull request
	CreatePRComment(ctx context.Context, owner, repo string, number int, body string) error

	// GetRepoVariable gets a repository variable
	GetRepoVariable(ctx context.Context, owner, repo, name string) (string, error)
}

GitPlatform defines the interface for git hosting platforms

type PullRequest

type PullRequest struct {
	Number      int
	Title       string
	Description string
	State       string
	Locked      bool
	Labels      []string
	Base        Commit
	Head        Commit
	HTMLURL     string
}

PullRequest represents a pull request or merge request

type ReviewComment

type ReviewComment struct {
	Path     string
	Body     string
	Position int
}

ReviewComment represents a comment on a pull request

Jump to

Keyboard shortcuts

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