Documentation
¶
Index ¶
- func CommitsSinceHash(gitDir, hash string, inclusive bool) ([]string, error)
- func DeepClone(repo, dir string) error
- func FormatChanges(changes []*ChangeInfo, onlyGapicChanges bool) string
- func HasChanges(dir string) (bool, error)
- func UpdateFilesSinceHash(gitDir, hash string) ([]string, error)
- type ChangeInfo
- type GithubClient
- func (gc *GithubClient) CreateGenprotoPR(ctx context.Context, genprotoDir string, hasCorrespondingPR bool, ...) (prNumber int, _ error)
- func (gc *GithubClient) GetPRWithTitle(ctx context.Context, repo, status, title string) (*PullRequest, error)
- func (gc *GithubClient) GetRegenPR(ctx context.Context, repo, status string) (*PullRequest, error)
- type PullRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitsSinceHash ¶
CommitsSinceHash gathers all of the commits since the provided hash for the given gitDir. The inclusive parameter tells if the provided hash should also be returned in the slice.
func FormatChanges ¶
func FormatChanges(changes []*ChangeInfo, onlyGapicChanges bool) string
FormatChanges turns a slice of changes into formatted string that will match the conventional commit footer pattern. This will allow these changes to be parsed into the changelog.
func HasChanges ¶
HasChanges reports whether the given directory has uncommitted git changes.
func UpdateFilesSinceHash ¶
UpdateFilesSinceHash returns a listed of files updated since the provided hash for the given gitDir.
Types ¶
type ChangeInfo ¶
ChangeInfo represents a change and its associated metadata.
func ParseChangeInfo ¶
func ParseChangeInfo(googleapisDir string, hashes []string) ([]*ChangeInfo, error)
ParseChangeInfo gets the ChangeInfo for a given googleapis hash.
type GithubClient ¶
type GithubClient struct { // Username is the GitHub username. Read-only. Username string // contains filtered or unexported fields }
GithubClient is a convenience wrapper around Github clients.
func NewGithubClient ¶
func NewGithubClient(ctx context.Context, username, name, email, accessToken string) (*GithubClient, error)
NewGithubClient creates a new GithubClient.
func (*GithubClient) CreateGenprotoPR ¶
func (gc *GithubClient) CreateGenprotoPR(ctx context.Context, genprotoDir string, hasCorrespondingPR bool, changes []*ChangeInfo) (prNumber int, _ error)
CreateGenprotoPR creates a PR for a given genproto change.
hasCorrespondingPR indicates that there is a corresponding google-cloud-go PR.
func (*GithubClient) GetPRWithTitle ¶
func (gc *GithubClient) GetPRWithTitle(ctx context.Context, repo, status, title string) (*PullRequest, error)
GetPRWithTitle finds the first pull request with the given status and title. Accepted statues are: open, closed, or all.
func (*GithubClient) GetRegenPR ¶
func (gc *GithubClient) GetRegenPR(ctx context.Context, repo, status string) (*PullRequest, error)
GetRegenPR finds the first regen pull request with the given status. Accepted statues are: open, closed, or all.