pullreq

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityOrmStore

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

ActivityOrmStore implements store.PullReqActivityStore backed by a relational database.

func NewPullReqActivityOrmStore

func NewPullReqActivityOrmStore(
	db *gorm.DB,
	pCache store.PrincipalInfoCache,
) *ActivityOrmStore

NewPullReqActivityOrmStore returns a new PullReqJournalStore.

func (*ActivityOrmStore) Count

func (s *ActivityOrmStore) Count(ctx context.Context,
	prID int64,
	opts *types.PullReqActivityFilter,
) (int64, error)

Count of pull requests for a repo.

func (*ActivityOrmStore) CountUnresolved

func (s *ActivityOrmStore) CountUnresolved(ctx context.Context, prID int64) (int, error)

func (*ActivityOrmStore) Create

Create creates a new pull request.

func (*ActivityOrmStore) CreateWithPayload

func (s *ActivityOrmStore) CreateWithPayload(ctx context.Context,
	pr *types.PullReq, principalID int64, payload types.PullReqActivityPayload, metadata *types.PullReqActivityMetadata,
) (*types.PullReqActivity, error)

func (*ActivityOrmStore) Find

Find finds the pull request activity by id.

func (*ActivityOrmStore) List

List returns a list of pull request activities for a PR.

func (*ActivityOrmStore) ListAuthorIDs

func (s *ActivityOrmStore) ListAuthorIDs(ctx context.Context, prID int64, order int64) ([]int64, error)

ListAuthorIDs returns a list of pull request activity author ids in a thread for a PR.

func (*ActivityOrmStore) Update

Update updates the pull request.

func (*ActivityOrmStore) UpdateOptLock

func (s *ActivityOrmStore) UpdateOptLock(ctx context.Context,
	act *types.PullReqActivity,
	mutateFn func(act *types.PullReqActivity) error,
) (*types.PullReqActivity, error)

UpdateOptLock updates the pull request using the optimistic locking mechanism.

type CodeCommentView

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

CodeCommentView implements store.CodeCommentView backed by a relational database.

func NewCodeCommentOrmView

func NewCodeCommentOrmView(db *gorm.DB) *CodeCommentView

NewCodeCommentOrmView returns a new CodeCommentView.

func (*CodeCommentView) ListNotAtMergeBaseSHA

func (s *CodeCommentView) ListNotAtMergeBaseSHA(ctx context.Context,
	prID int64, mergeBaseSHA string,
) ([]*types.CodeComment, error)

ListNotAtMergeBaseSHA lists all code comments not already at the provided merge base SHA.

func (*CodeCommentView) ListNotAtSourceSHA

func (s *CodeCommentView) ListNotAtSourceSHA(ctx context.Context,
	prID int64, sourceSHA string,
) ([]*types.CodeComment, error)

ListNotAtSourceSHA lists all code comments not already at the provided source SHA.

func (*CodeCommentView) UpdateAll

func (s *CodeCommentView) UpdateAll(ctx context.Context, codeComments []*types.CodeComment) error

UpdateAll updates all code comments provided in the slice.

type FileViewOrmStore

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

FileViewOrmStore implements store.PullReqFileViewStore backed by a relational database.

func NewPullReqFileViewOrmStore

func NewPullReqFileViewOrmStore(
	db *gorm.DB,
) *FileViewOrmStore

NewPullReqFileViewOrmStore returns a new PullReqFileViewOrmStore.

func (*FileViewOrmStore) DeleteByFileForPrincipal

func (s *FileViewOrmStore) DeleteByFileForPrincipal(
	ctx context.Context,
	prID int64,
	principalID int64,
	filePath string,
) error

DeleteByFileForPrincipal deletes the entry for the specified PR, principal, and file.

func (*FileViewOrmStore) FindByFileForPrincipal

func (s *FileViewOrmStore) FindByFileForPrincipal(
	ctx context.Context,
	prID int64,
	principalID int64,
	filePath string,
) (*types.PullReqFileView, error)

FindByFileForPrincipal get the entry for the specified PR, principal, and file.

func (*FileViewOrmStore) List

func (s *FileViewOrmStore) List(
	ctx context.Context,
	prID int64,
	principalID int64,
) ([]*types.PullReqFileView, error)

List lists all files marked as viewed by the user for the specified PR.

func (*FileViewOrmStore) MarkObsolete

func (s *FileViewOrmStore) MarkObsolete(ctx context.Context, prID int64, filePaths []string) error

MarkObsolete updates all entries of the files as obsolete for the PR.

func (*FileViewOrmStore) Upsert

Upsert inserts or updates the latest viewed sha for a file in a PR.

type OrmStore

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

OrmStore implements store.PullReqStore backed by a relational database.

func NewPullReqOrmStore

func NewPullReqOrmStore(db *gorm.DB,
	pCache store.PrincipalInfoCache) *OrmStore

NewPullReqOrmStore returns a new PullReqStore.

func (*OrmStore) Count

func (s *OrmStore) Count(ctx context.Context, opts *types.PullReqFilter) (int64, error)

Count of pull requests for a repo.

func (*OrmStore) Create

func (s *OrmStore) Create(ctx context.Context, pr *types.PullReq) error

Create creates a new pull request.

func (*OrmStore) Delete

func (s *OrmStore) Delete(ctx context.Context, id int64) error

Delete the pull request.

func (*OrmStore) Find

func (s *OrmStore) Find(ctx context.Context, id int64) (*types.PullReq, error)

Find finds the pull request by id.

func (*OrmStore) FindByNumber

func (s *OrmStore) FindByNumber(ctx context.Context, repoID, number int64) (*types.PullReq, error)

FindByNumber finds the pull request by repo ID and pull request number.

func (*OrmStore) FindByNumberWithLock

func (s *OrmStore) FindByNumberWithLock(
	ctx context.Context,
	repoID,
	number int64,
) (*types.PullReq, error)

FindByNumberWithLock finds the pull request by repo ID and pull request number and locks the pull request for the duration of the transaction.

func (*OrmStore) GetUnmergedPullRequest

func (s *OrmStore) GetUnmergedPullRequest(ctx context.Context, sourceRepo, targetRepo int64,
	sourceBranch, targetBranch string, flow enum.PullRequestFlow) (*types.PullReq, bool, error)

func (*OrmStore) List

func (s *OrmStore) List(ctx context.Context, opts *types.PullReqFilter) ([]*types.PullReq, error)

List returns a list of pull requests for a repo.

func (*OrmStore) ListOpenByBranchName

func (s *OrmStore) ListOpenByBranchName(
	ctx context.Context,
	repoID int64,
	branchNames []string,
) (map[string][]*types.PullReq, error)

func (*OrmStore) ResetMergeCheckStatus

func (s *OrmStore) ResetMergeCheckStatus(
	ctx context.Context,
	targetRepo int64,
	targetBranch string,
) error

ResetMergeCheckStatus resets the pull request's mergeability status to unchecked for all pr which target branch points to targetBranch.

func (*OrmStore) Stream

func (s *OrmStore) Stream(ctx context.Context, opts *types.PullReqFilter) (<-chan *types.PullReq, <-chan error)

Stream returns a list of pull requests for a repo.

func (*OrmStore) SummaryCount

func (s *OrmStore) SummaryCount(ctx context.Context, opts *types.PullReqSummaryFilter) (*types.PullReqSummary, error)

func (*OrmStore) Update

func (s *OrmStore) Update(ctx context.Context, pr *types.PullReq) error

Update updates the pull request.

func (*OrmStore) UpdateActivitySeq

func (s *OrmStore) UpdateActivitySeq(ctx context.Context, pr *types.PullReq) (*types.PullReq, error)

UpdateActivitySeq updates the pull request's activity sequence.

func (*OrmStore) UpdateOptLock

func (s *OrmStore) UpdateOptLock(ctx context.Context, pr *types.PullReq,
	mutateFn func(pr *types.PullReq) error,
) (*types.PullReq, error)

UpdateOptLock the pull request details using the optimistic locking mechanism.

type ReviewOrmStore

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

ReviewOrmStore implements store.PullReqReviewStore backed by a relational database.

func NewPullReqReviewOrmStore

func NewPullReqReviewOrmStore(db *gorm.DB) *ReviewOrmStore

NewPullReqReviewOrmStore returns a new PullReqReviewOrmStore.

func (*ReviewOrmStore) Create

Create creates a new pull request.

func (*ReviewOrmStore) Find

Find finds the pull request activity by id.

type ReviewerOrmStore

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

ReviewerOrmStore implements store.PullReqReviewerStore backed by a relational database.

func NewPullReqReviewerOrmStore

func NewPullReqReviewerOrmStore(db *gorm.DB,
	pCache store.PrincipalInfoCache) *ReviewerOrmStore

NewPullReqReviewerOrmStore returns a new PullReqReviewerOrmStore.

func (*ReviewerOrmStore) Create

Create creates a new pull request reviewer.

func (*ReviewerOrmStore) Delete

func (s *ReviewerOrmStore) Delete(ctx context.Context, prID, reviewerID int64) error

Delete deletes the pull request reviewer.

func (*ReviewerOrmStore) Find

func (s *ReviewerOrmStore) Find(ctx context.Context, prID, principalID int64) (*types.PullReqReviewer, error)

Find finds the pull request reviewer by pull request id and principal id.

func (*ReviewerOrmStore) List

func (s *ReviewerOrmStore) List(ctx context.Context, prID int64) ([]*types.PullReqReviewer, error)

List returns a list of pull reviewers for a pull request.

func (*ReviewerOrmStore) Update

Update updates the pull request reviewer.

Jump to

Keyboard shortcuts

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