Documentation ¶
Index ¶
- func AESDecrypt(key []byte, encodedCiphertext string) (string, error)
- func AESEncrypt(key []byte, plaintext string) (string, error)
- func CloneGitRepoAndDoAction(repoUrl string, branch string, commitHash string, token string, action action) error
- func CollapsedGraph(impactedParent *string, currentNode string, ...) error
- func ConvertJobsToDiggerJobs(jobType scheduler.DiggerCommand, vcsType models.DiggerVCSType, ...) (*uuid.UUID, map[string]*models.DiggerJob, error)
- func ExtractCleanRepoName(gitlabURL string) (string, error)
- func GenerateTerraformCode(appCode string, generationEndpoint string, webhookSecret string) (string, error)
- func GetDiggerConfigForBranch(gh GitlabProvider, projectId int, repoFullName string, repoOwner string, ...) (string, *dg_configuration.DiggerConfig, ...)
- func GetGithubClient(gh GithubClientProvider, installationId int64, repoFullName string) (*github.Client, *string, error)
- func GetGithubClientFromAppId(gh GithubClientProvider, installationId int64, githubAppId int64, ...) (*github.Client, *string, error)
- func GetGithubHostname() string
- func GetGithubService(gh GithubClientProvider, installationId int64, repoFullName string, ...) (*github2.GithubService, *string, error)
- func GetGitlabService(gh GitlabProvider, projectId int, repoName string, repoFullName string, ...) (*orchestrator_gitlab.GitLabService, error)
- func GetWorkflowIdAndUrlFromDiggerJobId(client *github.Client, repoOwner string, repoName string, diggerJobID string) (int64, string, error)
- func ImpactedProjectsOnlyGraph(projectsGraph graph.Graph[string, configuration.Project], ...) (graph.Graph[string, configuration.Project], error)
- func IsInRepoAllowList(repoUrl string) bool
- func ReportInitialJobsStatus(cr *CommentReporter, jobs []scheduler.Job) error
- func ReportNoProjectsImpacted(cr *CommentReporter, jobs []scheduler.Job) error
- func SetPRStatusForJobs(prService ci.PullRequestService, prNumber int, jobs []scheduler.Job) error
- func TraverseGraphVisitAllParentsFirst(g graph.Graph[string, configuration.Project], visit func(value string) bool) error
- func UpdateCRComment(cr *CommentReporter, comment string) error
- type CommentReporter
- type CommentReporterManager
- type DecryptedGithubAppConnection
- type DiggerGithubClientMockProvider
- func (gh DiggerGithubClientMockProvider) FetchCredentials(githubAppId string) (string, string, string, string, error)
- func (gh DiggerGithubClientMockProvider) Get(githubAppId int64, installationId int64) (*github.Client, *string, error)
- func (gh DiggerGithubClientMockProvider) NewClient(netClient *net.Client) (*github.Client, error)
- type DiggerGithubRealClientProvider
- func (gh DiggerGithubRealClientProvider) FetchCredentials(githubAppId string) (string, string, string, string, error)
- func (gh DiggerGithubRealClientProvider) Get(githubAppId int64, installationId int64) (*github.Client, *string, error)
- func (gh DiggerGithubRealClientProvider) NewClient(netClient *net.Client) (*github.Client, error)
- type GitAuth
- type GitShell
- type GithubClientProvider
- type GitlabClientProvider
- type GitlabProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
Decrypt decrypts a base64 encoded ciphertext using AES-256-GCM
func AESEncrypt ¶
Encrypt encrypts a plaintext string using AES-256-GCM
func CloneGitRepoAndDoAction ¶
func CollapsedGraph ¶
func ConvertJobsToDiggerJobs ¶
func ConvertJobsToDiggerJobs(jobType scheduler.DiggerCommand, vcsType models.DiggerVCSType, organisationId uint, jobsMap map[string]scheduler.Job, projectMap map[string]configuration.Project, projectsGraph graph.Graph[string, configuration.Project], githubInstallationId int64, branch string, prNumber int, repoOwner string, repoName string, repoFullName string, commitSha string, commentId int64, diggerConfigStr string, gitlabProjectId int) (*uuid.UUID, map[string]*models.DiggerJob, error)
ConvertJobsToDiggerJobs jobs is map with project name as a key and a Job as a value
func ExtractCleanRepoName ¶
func GenerateTerraformCode ¶
func GetDiggerConfigForBranch ¶
func GetDiggerConfigForBranch(gh GitlabProvider, projectId int, repoFullName string, repoOwner string, repoName string, cloneUrl string, branch string, prNumber int, discussionId string) (string, *dg_configuration.DiggerConfig, graph.Graph[string, dg_configuration.Project], error)
func GetGithubClient ¶
func GetGithubHostname ¶
func GetGithubHostname() string
func GetGithubService ¶
func GetGithubService(gh GithubClientProvider, installationId int64, repoFullName string, repoOwner string, repoName string) (*github2.GithubService, *string, error)
func GetGitlabService ¶
func GetGitlabService(gh GitlabProvider, projectId int, repoName string, repoFullName string, prNumber int, discussionId string) (*orchestrator_gitlab.GitLabService, error)
func ImpactedProjectsOnlyGraph ¶
func ImpactedProjectsOnlyGraph(projectsGraph graph.Graph[string, configuration.Project], impactedProjectMap map[string]configuration.Project) (graph.Graph[string, configuration.Project], error)
func IsInRepoAllowList ¶
func ReportInitialJobsStatus ¶
func ReportInitialJobsStatus(cr *CommentReporter, jobs []scheduler.Job) error
func ReportNoProjectsImpacted ¶
func ReportNoProjectsImpacted(cr *CommentReporter, jobs []scheduler.Job) error
func SetPRStatusForJobs ¶
func UpdateCRComment ¶
func UpdateCRComment(cr *CommentReporter, comment string) error
Types ¶
type CommentReporter ¶
type CommentReporter struct { PrNumber int PrService ci.PullRequestService CommentId string }
func InitCommentReporter ¶
func InitCommentReporter(prService ci.PullRequestService, prNumber int, commentMessage string) (*CommentReporter, error)
type CommentReporterManager ¶
type CommentReporterManager struct { CommentReporter *CommentReporter // contains filtered or unexported fields }
CommentReporterManager thin wrapper around CommentReporter that makes it "Lazy" so we dont comment anything when it is initialized and we can update comment at any time (intial update creates a new comment, future updates will update that comment)
func InitCommentReporterManager ¶
func InitCommentReporterManager(prService ci.PullRequestService, prNumber int) CommentReporterManager
func (*CommentReporterManager) GetCommentReporter ¶
func (cm *CommentReporterManager) GetCommentReporter() (*CommentReporter, error)
func (*CommentReporterManager) UpdateComment ¶
func (cm *CommentReporterManager) UpdateComment(commentMessage string) (*CommentReporter, error)
type DecryptedGithubAppConnection ¶
type DecryptedGithubAppConnection struct { GithubId int64 ClientID string ClientSecret string WebhookSecret string PrivateKey string PrivateKeyBase64 string Org string Name string GithubAppUrl string OrganisationID uint }
represents a decrypted record
func DecryptConnection ¶
func DecryptConnection(g *models.GithubAppConnection, key []byte) (*DecryptedGithubAppConnection, error)
type DiggerGithubClientMockProvider ¶
func (DiggerGithubClientMockProvider) FetchCredentials ¶
type DiggerGithubRealClientProvider ¶
type DiggerGithubRealClientProvider struct { }
just a wrapper around github client to be able to use mocks
func (DiggerGithubRealClientProvider) FetchCredentials ¶
type GitShell ¶
type GitShell struct {
// contains filtered or unexported fields
}
func NewGitShell ¶
type GithubClientProvider ¶
type GitlabClientProvider ¶
type GitlabClientProvider struct{}
func (GitlabClientProvider) NewClient ¶
func (g GitlabClientProvider) NewClient(token string) (*gitlab.Client, error)
type GitlabProvider ¶
Click to show internal directories.
Click to hide internal directories.