scm

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRepo

func ParseRepo(fullName string) (owner, repo string, err error)

ParseRepo splits "owner/repo" into owner and repo name.

Types

type Driver

type Driver interface {
	CreateIssue(ctx context.Context, owner, repo, title, body string, labels ...string) (*forge.Issue, error)
	AddIssueLabels(ctx context.Context, owner, repo string, number int, labels ...string) error
	AddComment(ctx context.Context, owner, repo string, number int, body string) (*forge.IssueComment, error)
	GetIssue(ctx context.Context, owner, repo string, number int) (*forge.Issue, error)
	GetFileContent(ctx context.Context, owner, repo, path string) ([]byte, error)
	CommitFile(ctx context.Context, owner, repo, path, message string, content []byte) error
	CreateBranch(ctx context.Context, owner, repo, branch string) error
	CommitFileToBranch(ctx context.Context, owner, repo, branch, path, message string, content []byte) error
	CreateChangeProposal(ctx context.Context, owner, repo, title, body, head, base string) (*forge.ChangeProposal, error)
	SubmitPullRequestReview(ctx context.Context, owner, repo string, number int, event string) error
	CloseIssue(ctx context.Context, owner, repo string, number int) error

	// CreateFork creates a fork of owner/repo within the same
	// organization as the source repository, using the given
	// forkName. It returns the actual repo name of the created
	// fork. The call is idempotent — if a fork with the given
	// name already exists, it returns without error.
	CreateFork(ctx context.Context, owner, repo, forkName string) (forkRepo string, err error)

	// CommitFileToFork commits a file to a branch on a fork repository.
	// Analogous to CommitFileToBranch but targets the fork.
	CommitFileToFork(ctx context.Context, forkOwner, forkRepo, branch, path, message string, content []byte) error

	// CreateForkChangeProposal opens a cross-fork pull request from
	// forkOwner:headBranch into baseOwner/baseRepo's baseBranch.
	CreateForkChangeProposal(ctx context.Context, baseOwner, baseRepo, title, body, forkOwner, headBranch, baseBranch string) (*forge.ChangeProposal, error)
}

Driver abstracts SCM operations for behaviour tests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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