Documentation
¶
Index ¶
- func QueryDeploymentsWithCommits(ctx context.Context, repo *Repo, d DeploymentsService, ...) (map[string][]*DeploymentWithCommits, error)
- type Commit
- type CommitParent
- type CommitsComparison
- type CommitsComparisonService
- type CommitsOpts
- type DeployedCommitsOptions
- type Deployment
- type DeploymentOpts
- type DeploymentService
- type DeploymentWithCommits
- type DeploymentWithCommitsOptions
- type DeploymentsOpts
- type DeploymentsService
- type HistoryService
- type PullRequest
- type PullRequestsService
- type RefComparisonService
- type Release
- type ReleaseWithPRs
- type ReleasesService
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryDeploymentsWithCommits ¶
func QueryDeploymentsWithCommits( ctx context.Context, repo *Repo, d DeploymentsService, c CommitsComparisonService, logger *slog.Logger, opts *DeploymentWithCommitsOptions, ) (map[string][]*DeploymentWithCommits, error)
QueryDeploymentsWithCommits fetches deployments across environments and determines the commits deployed between each deployment and its previous one. It uses DeploymentsService to fetch deployments and commit ranges, and CommitsComparisonService to fetch commits for the identified ranges.
Types ¶
type Commit ¶
type Commit struct {
AbbreviatedSHA string
SHA string
AuthoredDate time.Time
CommittedDate time.Time
Message string
Parents []*CommitParent
}
Unified Git Commit Model (used for both REST & GraphQL API)
type CommitParent ¶
Unified Git Commit parent model (used for both REST & GraphQL API)
type CommitsComparison ¶
Represents a Git Commit Comparison
type CommitsComparisonService ¶
type CommitsComparisonService interface {
CompareCommits(ctx context.Context, repo *Repo, base string, head string, limit int) (*CommitsComparison, error)
}
CommitsComparisonService provides commit comparison functionality.
type DeployedCommitsOptions ¶
type DeployedCommitsOptions struct {
Deployment *DeploymentOpts
Commits *CommitsOpts
}
Options for the QueryDeployedCommits function
type Deployment ¶
type Deployment struct {
Description string
CreatedAt time.Time
UpdatedAt time.Time
OriginalEnvironment string
LatestEnvironment string
Task string
State string
Ref string
Commit *Commit
}
Unified GitHub Deployment Model (used for both REST & GraphQL API)
type DeploymentOpts ¶
Options for the DeploymentsService
type DeploymentService ¶
type DeploymentService interface {
QueryDeployment(ctx context.Context, repo *Repo, env string, sha string, searchLimit int) (*Deployment, *Deployment, error)
}
DeploymentService provides access to GitHub Deployment functionality.
type DeploymentWithCommits ¶
type DeploymentWithCommits struct {
*Deployment
DeployedCommits []*Commit
}
DeploymentWithCommits represents a deployment along with its associated deployed commits.
func QueryDeployedCommits ¶
func QueryDeployedCommits( ctx context.Context, repo *Repo, d DeploymentService, c CommitsComparisonService, logger *slog.Logger, opts *DeployedCommitsOptions, ) (*DeploymentWithCommits, error)
QueryDeployedCommits retrieves a deployment and finds the commits deployed between it and the previous deployment in the same environment. It uses DeploymentService and CommitsComparisonService to fetch and compare commits.
type DeploymentWithCommitsOptions ¶
type DeploymentWithCommitsOptions struct {
Deployments *DeploymentsOpts
Commits *CommitsOpts
}
Options for the QueryDeploymentsWithCommits function
type DeploymentsOpts ¶
Options for the DeploymentsService
type DeploymentsService ¶
type DeploymentsService interface {
QueryDeployments(ctx context.Context, repo *Repo, envs *[]string, limit int) ([]Deployment, error)
}
DeploymentsService provides access to GitHub Deployment functionality.
type HistoryService ¶
type HistoryService interface {
QueryHistory(ctx context.Context, repo *Repo, head string, base string, limit int) ([]Commit, error)
}
HistoryService provides commit history functionality.
type PullRequest ¶
type PullRequest struct {
Number int
Title string
CreatedAt time.Time
UpdatedAt time.Time
ClosedAt time.Time
MergedAt time.Time
}
Unified GitHub PullRequest Model (used for both REST & GraphQL API)
type PullRequestsService ¶
type PullRequestsService interface {
QueryPullRequests(ctx context.Context, repo *Repo, limit int) ([]PullRequest, error)
}
PullRequestsService provides access to GitHub Pull Request functionality.
type RefComparisonService ¶
type RefComparisonService interface {
QueryCompareRefs(ctx context.Context, repo *Repo, base string, head string, limit int) (*CommitsComparison, error)
}
RefComparisonService provides Git reference comparison functionality.
type Release ¶
type Release struct {
Name string
TagName string
IsDraft bool
IsLatest bool
IsPrerelease bool
Description string
CreatedAt time.Time
PublishedAt time.Time
}
Unified GitHub Release Model (used for both REST & GraphQL API)
type ReleaseWithPRs ¶
ReleaseWithPRs embeds a GitHub Release object with an added slice of PR numbers, which we have parsed from its auto-generated release notes.
func NewReleaseWithPRs ¶
func NewReleaseWithPRs(r *Release) *ReleaseWithPRs
NewReleaseWithPrs creates a new ReleaseWithPRs by parsing PR numbers from auto-generated Release Descriptions.