Documentation ¶
Index ¶
- Constants
- Variables
- func CreateIssue(ctx context.Context, client *github.Client, owner, repo string, ...) (*github.Issue, error)
- func CreateStatus(ctx context.Context, client *github.Client, ...) (*github.RepoStatus, error)
- func DownloadFile(url string, w io.Writer) error
- func DownloadRepoArchive(ctx context.Context, client *github.Client, w io.Writer, ...) error
- func FilterReleases(releases []*github.RepositoryRelease, constraint *semver.Constraints) []*github.RepositoryRelease
- func FilterRepositoryReleases(releases []*github.RepositoryRelease, predicate RepositoryReleasePredicate) []*github.RepositoryRelease
- func FindLatestReleaseBySemver(ctx context.Context, client *github.Client, owner, repo string) (string, error)
- func FindLatestReleaseTag(ctx context.Context, client *github.Client, owner, repo string) (string, error)
- func FindLatestReleaseTagIncudingPrerelease(ctx context.Context, client *github.Client, owner, repo string) (string, error)
- func FindStatus(ctx context.Context, client *github.Client, ...) (*github.RepoStatus, error)
- func GetAllIssues(ctx context.Context, client *github.Client, owner, repo string, ...) ([]*github.Issue, error)
- func GetAllRepoIssuesWithMax(ctx context.Context, client *github.Client, owner, repo string, maxIssues int, ...) ([]*github.Issue, error)
- func GetAllRepoReleases(ctx context.Context, client *github.Client, owner, repo string) ([]*github.RepositoryRelease, error)
- func GetAllRepoReleasesWithMax(ctx context.Context, client *github.Client, owner, repo string, ...) ([]*github.RepositoryRelease, error)
- func GetClient(ctx context.Context) (*github.Client, error)
- func GetClientOrExit(ctx context.Context) *github.Client
- func GetClientWithOrWithoutToken(ctx context.Context) *github.Client
- func GetFilesForChangelogVersion(ctx context.Context, client *github.Client, owner, repo, ref, version string) ([]*github.RepositoryContent, error)
- func GetFilesFromGit(ctx context.Context, client *github.Client, owner, repo, ref, path string) ([]*github.RepositoryContent, error)
- func GetGithubToken() (string, error)
- func GetRawGitFile(ctx context.Context, client *github.Client, content *github.RepositoryContent, ...) ([]byte, error)
- func GetReleaseOrExit(ctx context.Context, client *github.Client, version *versionutils.Version, ...) *github.RepositoryRelease
- func GetRepoReleasesWithPredicateAndMax(ctx context.Context, client *github.Client, owner, repo string, ...) ([]*github.RepositoryRelease, error)
- func MarkError(ctx context.Context, client *github.Client, ...) (*github.RepoStatus, error)
- func MarkFailure(ctx context.Context, client *github.Client, ...) (*github.RepoStatus, error)
- func MarkInitialPending(ctx context.Context, client *github.Client, ...) (*github.RepoStatus, error)
- func MarkSuccess(ctx context.Context, client *github.Client, ...) (*github.RepoStatus, error)
- func SortReleasesBySemver(releases []*github.RepositoryRelease)
- func UpdateIssue(ctx context.Context, client *github.Client, owner, repo string, ...) error
- func UploadReleaseAssetCli(spec *UploadReleaseAssetSpec)
- type AllReleasesPredicate
- type NoReleasesPredicate
- type PRSpec
- type ReleaseAssetSpec
- type RepoClient
- type RepositoryReleasePredicate
- type UploadReleaseAssetSpec
Constants ¶
View Source
const ( GITHUB_TOKEN = "GITHUB_TOKEN" STATUS_SUCCESS = "success" STATUS_FAILURE = "failure" STATUS_ERROR = "error" STATUS_PENDING = "pending" COMMIT_FILE_STATUS_ADDED = "added" COMMIT_FILE_STATUS_MODIFIED = "modified" COMMIT_FILE_STATUS_DELETED = "deleted" CONTENT_TYPE_FILE = "file" CONTENT_TYPE_DIRECTORY = "dir" // https://docs.github.com/en/rest/guides/traversing-with-pagination#changing-the-number-of-items-received MAX_GITHUB_RESULTS_PER_PAGE = 100 MIN_GITHUB_PAGE_NUM = 1 )
Variables ¶
View Source
var NoReleaseBeforeShaFound = eris.Errorf("no release found before sha")
Functions ¶
func CreateIssue ¶ added in v0.21.11
func CreateStatus ¶
func DownloadRepoArchive ¶
func DownloadRepoArchive(ctx context.Context, client *github.Client, w io.Writer, owner, repo, sha string) error
This function writes directly to a writer, so the user is required to close the writer manually
func FilterReleases ¶ added in v0.21.10
func FilterReleases(releases []*github.RepositoryRelease, constraint *semver.Constraints) []*github.RepositoryRelease
Filters slice of github releases by providing a constraint on the release semver does not modify input slice, returns the filtered list. If we are unable to parse a release version, we do not include it in the filtered list Deprecated: use FilterRepositoryReleases
func FilterRepositoryReleases ¶ added in v0.21.16
func FilterRepositoryReleases(releases []*github.RepositoryRelease, predicate RepositoryReleasePredicate) []*github.RepositoryRelease
func FindLatestReleaseBySemver ¶ added in v0.21.1
func FindLatestReleaseTag ¶
func FindStatus ¶
func GetAllIssues ¶ added in v0.21.11
func GetAllIssues(ctx context.Context, client *github.Client, owner, repo string, listOpts *github.IssueListByRepoOptions) ([]*github.Issue, error)
Gets all issues from a repo in order from newest to oldest
func GetAllRepoIssuesWithMax ¶ added in v0.21.11
func GetAllRepoIssuesWithMax(ctx context.Context, client *github.Client, owner, repo string, maxIssues int, listOpts *github.IssueListByRepoOptions) ([]*github.Issue, error)
Gets all issues from a repo in order from newest to oldest, up to a maxIssues number of issues
func GetAllRepoReleases ¶ added in v0.21.7
func GetAllRepoReleasesWithMax ¶ added in v0.21.7
func GetFilesFromGit ¶
func GetGithubToken ¶
func GetRawGitFile ¶
func GetReleaseOrExit ¶
func GetReleaseOrExit(ctx context.Context, client *github.Client, version *versionutils.Version, spec *UploadReleaseAssetSpec) *github.RepositoryRelease
func GetRepoReleasesWithPredicateAndMax ¶ added in v0.21.16
func GetRepoReleasesWithPredicateAndMax(ctx context.Context, client *github.Client, owner, repo string, predicate RepositoryReleasePredicate, maxReleases int) ([]*github.RepositoryRelease, error)
func MarkFailure ¶
func MarkInitialPending ¶
func MarkSuccess ¶
func SortReleasesBySemver ¶ added in v0.21.1
func SortReleasesBySemver(releases []*github.RepositoryRelease)
Sorts github release array in place by semver, from most recent release to least (v2.8.0, v1.7.0, v1.6.0...)
func UpdateIssue ¶ added in v0.21.11
func UploadReleaseAssetCli ¶
func UploadReleaseAssetCli(spec *UploadReleaseAssetSpec)
Types ¶
type AllReleasesPredicate ¶ added in v0.21.16
type AllReleasesPredicate struct { }
func (*AllReleasesPredicate) Apply ¶ added in v0.21.16
func (a *AllReleasesPredicate) Apply(_ *github.RepositoryRelease) bool
type NoReleasesPredicate ¶ added in v0.21.27
type NoReleasesPredicate struct { }
func (*NoReleasesPredicate) Apply ¶ added in v0.21.27
func (a *NoReleasesPredicate) Apply(_ *github.RepositoryRelease) bool
type ReleaseAssetSpec ¶
type RepoClient ¶
type RepoClient interface { FindLatestReleaseTagIncudingPrerelease(ctx context.Context) (string, error) CompareCommits(ctx context.Context, base, sha string) (*github.CommitsComparison, error) DirectoryExists(ctx context.Context, sha, directory string) (bool, error) FileExists(ctx context.Context, sha, path string) (bool, error) CreateBranch(ctx context.Context, branchName string) (*github.Reference, error) CreatePR(ctx context.Context, branchName string, spec PRSpec) error GetShaForTag(ctx context.Context, tag string) (string, error) GetPR(ctx context.Context, num int) (*github.PullRequest, error) UpdateRelease(ctx context.Context, release *github.RepositoryRelease) (*github.RepositoryRelease, error) GetCommit(ctx context.Context, sha string) (*github.RepositoryCommit, error) FindStatus(ctx context.Context, statusLabel, sha string) (*github.RepoStatus, error) CreateStatus(ctx context.Context, sha string, status *github.RepoStatus) (*github.RepoStatus, error) CreateComment(ctx context.Context, pr int, comment *github.IssueComment) (*github.IssueComment, error) DeleteComment(ctx context.Context, commentId int64) error FindLatestTagIncludingPrereleaseBeforeSha(ctx context.Context, sha string) (string, error) }
func NewRepoClient ¶
func NewRepoClient(client *github.Client, owner, repo string) RepoClient
type RepositoryReleasePredicate ¶ added in v0.21.16
type RepositoryReleasePredicate interface {
Apply(release *github.RepositoryRelease) bool
}
type UploadReleaseAssetSpec ¶
type UploadReleaseAssetSpec struct { Owner string Repo string Assets []ReleaseAssetSpec SkipAlreadyExists bool }
Click to show internal directories.
Click to hide internal directories.