Documentation
¶
Index ¶
- type AppRepositoryInfo
- type Author
- type AzureReposClient
- func (client *AzureReposClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
- func (client *AzureReposClient) AddPullRequestComment(ctx context.Context, _, repository, content string, pullRequestID int) error
- func (client *AzureReposClient) AddPullRequestReviewComments(ctx context.Context, _, repository string, pullRequestID int, ...) error
- func (client *AzureReposClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, ...) error
- func (client *AzureReposClient) AllowWorkflows(ctx context.Context, owner string) error
- func (client *AzureReposClient) CommitAndPushFiles(ctx context.Context, ...) error
- func (client *AzureReposClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
- func (client *AzureReposClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
- func (client *AzureReposClient) CreateOrUpdateEnvironment(ctx context.Context, owner, repo, envName string, teams []int64, ...) error
- func (client *AzureReposClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
- func (client *AzureReposClient) CreatePullRequest(ctx context.Context, ...) error
- func (client *AzureReposClient) CreatePullRequestDetailed(ctx context.Context, ...) (CreatedPullRequestInfo, error)
- func (client *AzureReposClient) CreateWebhook(ctx context.Context, owner, repository, branch, payloadURL string, ...) (string, string, error)
- func (client *AzureReposClient) DeletePullRequestComment(ctx context.Context, _, repository string, pullRequestID, commentID int) error
- func (client *AzureReposClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, ...) error
- func (client *AzureReposClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
- func (client *AzureReposClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
- func (client *AzureReposClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) (err error)
- func (client *AzureReposClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
- func (client *AzureReposClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
- func (client *AzureReposClient) GetCommits(ctx context.Context, _, repository, branch string) ([]CommitInfo, error)
- func (client *AzureReposClient) GetCommitsWithQueryOptions(ctx context.Context, _, repository string, listOptions GitCommitsQueryOptions) ([]CommitInfo, error)
- func (client *AzureReposClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
- func (client *AzureReposClient) GetLatestCommit(ctx context.Context, _, repository, branch string) (CommitInfo, error)
- func (client *AzureReposClient) GetModifiedFiles(ctx context.Context, _, repository, refBefore, refAfter string) ([]string, error)
- func (client *AzureReposClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
- func (client *AzureReposClient) GetPullRequestCommentSizeLimit() int
- func (client *AzureReposClient) GetPullRequestDetailsSizeLimit() int
- func (client *AzureReposClient) GetRepoCollaborators(ctx context.Context, owner, repo, affiliation, permission string) ([]string, error)
- func (client *AzureReposClient) GetRepoTeamsByPermissions(ctx context.Context, owner, repo string, permissions []string) ([]int64, error)
- func (client *AzureReposClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
- func (client *AzureReposClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
- func (client *AzureReposClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
- func (client *AzureReposClient) ListBranches(ctx context.Context, _, repository string) ([]string, error)
- func (client *AzureReposClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *AzureReposClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *AzureReposClient) ListPullRequestComments(ctx context.Context, _, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *AzureReposClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
- func (client *AzureReposClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *AzureReposClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
- func (client *AzureReposClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
- func (client *AzureReposClient) ListRepositories(ctx context.Context) (map[string][]string, error)
- func (client *AzureReposClient) MergePullRequest(ctx context.Context, owner, repo string, prNumber int, commitMessage string) error
- func (client *AzureReposClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, ...) error
- func (client *AzureReposClient) TestConnection(ctx context.Context) error
- func (client *AzureReposClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
- func (client *AzureReposClient) UpdatePullRequest(ctx context.Context, _, repository, title, body, targetBranchName string, ...) error
- func (client *AzureReposClient) UpdateWebhook(ctx context.Context, ...) error
- func (client *AzureReposClient) UploadCodeScanning(ctx context.Context, owner, repository, branch, scanResults string) (string, error)
- func (client *AzureReposClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
- func (client *AzureReposClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
- type BitbucketCloudClient
- func (client *BitbucketCloudClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
- func (client *BitbucketCloudClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
- func (client *BitbucketCloudClient) AddPullRequestReviewComments(_ context.Context, _, _ string, _ int, _ ...PullRequestComment) error
- func (client *BitbucketCloudClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, ...) (err error)
- func (client *BitbucketCloudClient) AllowWorkflows(ctx context.Context, owner string) error
- func (client *BitbucketCloudClient) CommitAndPushFiles(ctx context.Context, ...) error
- func (client *BitbucketCloudClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
- func (client *BitbucketCloudClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
- func (client *BitbucketCloudClient) CreateOrUpdateEnvironment(ctx context.Context, owner, repo, envName string, teams []int64, ...) error
- func (client *BitbucketCloudClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
- func (client *BitbucketCloudClient) CreatePullRequest(ctx context.Context, ...) error
- func (client *BitbucketCloudClient) CreatePullRequestDetailed(ctx context.Context, ...) (CreatedPullRequestInfo, error)
- func (client *BitbucketCloudClient) CreateWebhook(ctx context.Context, owner, repository, _, payloadURL string, ...) (string, string, error)
- func (client *BitbucketCloudClient) DeletePullRequestComment(_ context.Context, _, _ string, _, _ int) error
- func (client *BitbucketCloudClient) DeletePullRequestReviewComments(_ context.Context, _, _ string, _ int, _ ...CommentInfo) error
- func (client *BitbucketCloudClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
- func (client *BitbucketCloudClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
- func (client *BitbucketCloudClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
- func (client *BitbucketCloudClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
- func (client *BitbucketCloudClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
- func (client *BitbucketCloudClient) GetCommits(_ context.Context, _, _, _ string) ([]CommitInfo, error)
- func (client *BitbucketCloudClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, ...) ([]CommitInfo, error)
- func (client *BitbucketCloudClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
- func (client *BitbucketCloudClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
- func (client *BitbucketCloudClient) GetModifiedFiles(ctx context.Context, owner, repository, refBefore, refAfter string) ([]string, error)
- func (client *BitbucketCloudClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
- func (client *BitbucketCloudClient) GetPullRequestCommentSizeLimit() int
- func (client *BitbucketCloudClient) GetPullRequestDetailsSizeLimit() int
- func (client *BitbucketCloudClient) GetRepoCollaborators(ctx context.Context, owner, repo, affiliation, permission string) ([]string, error)
- func (client *BitbucketCloudClient) GetRepoTeamsByPermissions(ctx context.Context, owner, repo string, permissions []string) ([]int64, error)
- func (client *BitbucketCloudClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
- func (client *BitbucketCloudClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
- func (client *BitbucketCloudClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
- func (client *BitbucketCloudClient) ListBranches(ctx context.Context, owner, repository string) ([]string, error)
- func (client *BitbucketCloudClient) ListOpenPullRequests(ctx context.Context, owner, repository string) (res []PullRequestInfo, err error)
- func (client *BitbucketCloudClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) (res []PullRequestInfo, err error)
- func (client *BitbucketCloudClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) (res []CommentInfo, err error)
- func (client *BitbucketCloudClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
- func (client *BitbucketCloudClient) ListPullRequestReviewComments(_ context.Context, _, _ string, _ int) ([]CommentInfo, error)
- func (client *BitbucketCloudClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
- func (client *BitbucketCloudClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository, commitSHA string) ([]PullRequestInfo, error)
- func (client *BitbucketCloudClient) ListRepositories(ctx context.Context) (map[string][]string, error)
- func (client *BitbucketCloudClient) MergePullRequest(ctx context.Context, owner, repo string, prNumber int, commitMessage string) error
- func (client *BitbucketCloudClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, ...) error
- func (client *BitbucketCloudClient) TestConnection(ctx context.Context) error
- func (client *BitbucketCloudClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
- func (client *BitbucketCloudClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, ...) error
- func (client *BitbucketCloudClient) UpdateWebhook(ctx context.Context, owner, repository, _, payloadURL, token, webhookID string, ...) error
- func (client *BitbucketCloudClient) UploadCodeScanning(ctx context.Context, owner string, repository string, branch string, ...) (string, error)
- func (client *BitbucketCloudClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
- func (client *BitbucketCloudClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
- type BitbucketCommitInfo
- type BitbucketServerClient
- func (client *BitbucketServerClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
- func (client *BitbucketServerClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
- func (client *BitbucketServerClient) AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, ...) error
- func (client *BitbucketServerClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, ...) (err error)
- func (client *BitbucketServerClient) AllowWorkflows(ctx context.Context, owner string) error
- func (client *BitbucketServerClient) CommitAndPushFiles(ctx context.Context, ...) error
- func (client *BitbucketServerClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
- func (client *BitbucketServerClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
- func (client *BitbucketServerClient) CreateOrUpdateEnvironment(ctx context.Context, owner, repo, envName string, teams []int64, ...) error
- func (client *BitbucketServerClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
- func (client *BitbucketServerClient) CreatePullRequest(ctx context.Context, ...) error
- func (client *BitbucketServerClient) CreatePullRequestDetailed(ctx context.Context, ...) (CreatedPullRequestInfo, error)
- func (client *BitbucketServerClient) CreateWebhook(ctx context.Context, owner, repository, _, payloadURL string, ...) (string, string, error)
- func (client *BitbucketServerClient) DeletePullRequestComment(ctx context.Context, owner, repository string, pullRequestID, commentID int) error
- func (client *BitbucketServerClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, ...) error
- func (client *BitbucketServerClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
- func (client *BitbucketServerClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
- func (client *BitbucketServerClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
- func (client *BitbucketServerClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
- func (client *BitbucketServerClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
- func (client *BitbucketServerClient) GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
- func (client *BitbucketServerClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, ...) ([]CommitInfo, error)
- func (client *BitbucketServerClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
- func (client *BitbucketServerClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
- func (client *BitbucketServerClient) GetModifiedFiles(ctx context.Context, owner, repository, refBefore, refAfter string) ([]string, error)
- func (client *BitbucketServerClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
- func (client *BitbucketServerClient) GetPullRequestCommentSizeLimit() int
- func (client *BitbucketServerClient) GetPullRequestDetailsSizeLimit() int
- func (client *BitbucketServerClient) GetRepoCollaborators(ctx context.Context, owner, repo, affiliation, permission string) ([]string, error)
- func (client *BitbucketServerClient) GetRepoTeamsByPermissions(ctx context.Context, owner, repo string, permissions []string) ([]int64, error)
- func (client *BitbucketServerClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
- func (client *BitbucketServerClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
- func (client *BitbucketServerClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
- func (client *BitbucketServerClient) ListBranches(ctx context.Context, owner, repository string) ([]string, error)
- func (client *BitbucketServerClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *BitbucketServerClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *BitbucketServerClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *BitbucketServerClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
- func (client *BitbucketServerClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *BitbucketServerClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
- func (client *BitbucketServerClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
- func (client *BitbucketServerClient) ListRepositories(ctx context.Context) (map[string][]string, error)
- func (client *BitbucketServerClient) MergePullRequest(ctx context.Context, owner, repo string, prNumber int, commitMessage string) error
- func (client *BitbucketServerClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, ...) error
- func (client *BitbucketServerClient) TestConnection(ctx context.Context) error
- func (client *BitbucketServerClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
- func (client *BitbucketServerClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchRef string, ...) (err error)
- func (client *BitbucketServerClient) UpdateWebhook(ctx context.Context, owner, repository, _, payloadURL, token, webhookID string, ...) error
- func (client *BitbucketServerClient) UploadCodeScanning(ctx context.Context, owner string, repository string, branch string, ...) (string, error)
- func (client *BitbucketServerClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
- func (client *BitbucketServerClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
- type BranchInfo
- type ClientBuilder
- func (builder *ClientBuilder) ApiEndpoint(apiEndpoint string) *ClientBuilder
- func (builder *ClientBuilder) Build() (VcsClient, error)
- func (builder *ClientBuilder) Logger(logger vcsutils.Log) *ClientBuilder
- func (builder *ClientBuilder) Project(project string) *ClientBuilder
- func (builder *ClientBuilder) Token(token string) *ClientBuilder
- func (builder *ClientBuilder) Username(username string) *ClientBuilder
- type CloneInfo
- type CommentInfo
- type CommitInfo
- type CommitStatus
- type CommitStatusInfo
- type CreatedPullRequestInfo
- type DetectorInfo
- type FileInfo
- type FileToCommit
- type GitCommitsQueryOptions
- type GitHubClient
- func (client *GitHubClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
- func (client *GitHubClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
- func (client *GitHubClient) AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, ...) error
- func (client *GitHubClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, ...) error
- func (client *GitHubClient) AllowWorkflows(ctx context.Context, owner string) error
- func (client *GitHubClient) CommitAndPushFiles(ctx context.Context, ...) error
- func (client *GitHubClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
- func (client *GitHubClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
- func (client *GitHubClient) CreateOrUpdateEnvironment(ctx context.Context, owner, repo, envName string, teams []int64, ...) error
- func (client *GitHubClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
- func (client *GitHubClient) CreatePullRequest(ctx context.Context, ...) error
- func (client *GitHubClient) CreatePullRequestDetailed(ctx context.Context, ...) (CreatedPullRequestInfo, error)
- func (client *GitHubClient) CreateWebhook(ctx context.Context, owner, repository, _, payloadURL string, ...) (string, string, error)
- func (client *GitHubClient) DeletePullRequestComment(ctx context.Context, owner, repository string, _, commentID int) error
- func (client *GitHubClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, _ int, comments ...CommentInfo) error
- func (client *GitHubClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
- func (client *GitHubClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) (content []byte, statusCode int, err error)
- func (client *GitHubClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) (err error)
- func (client *GitHubClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
- func (client *GitHubClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (statusInfoList []CommitStatusInfo, err error)
- func (client *GitHubClient) GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
- func (client *GitHubClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, ...) ([]CommitInfo, error)
- func (client *GitHubClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
- func (client *GitHubClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
- func (client *GitHubClient) GetModifiedFiles(ctx context.Context, owner, repository, refBefore, refAfter string) ([]string, error)
- func (client *GitHubClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (PullRequestInfo, error)
- func (client *GitHubClient) GetPullRequestCommentSizeLimit() int
- func (client *GitHubClient) GetPullRequestDetailsSizeLimit() int
- func (client *GitHubClient) GetRepoCollaborators(ctx context.Context, owner, repo, affiliation, permission string) ([]string, error)
- func (client *GitHubClient) GetRepoTeamsByPermissions(ctx context.Context, owner, repo string, permissions []string) ([]int64, error)
- func (client *GitHubClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
- func (client *GitHubClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
- func (client *GitHubClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
- func (client *GitHubClient) ListBranches(ctx context.Context, owner, repository string) (branchList []string, err error)
- func (client *GitHubClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *GitHubClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *GitHubClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *GitHubClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
- func (client *GitHubClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *GitHubClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
- func (client *GitHubClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
- func (client *GitHubClient) ListRepositories(ctx context.Context) (results map[string][]string, err error)
- func (client *GitHubClient) MergePullRequest(ctx context.Context, owner, repo string, prNumber int, commitMessage string) error
- func (client *GitHubClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, ...) error
- func (client *GitHubClient) TestConnection(ctx context.Context) error
- func (client *GitHubClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
- func (client *GitHubClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, ...) error
- func (client *GitHubClient) UpdateWebhook(ctx context.Context, owner, repository, _, payloadURL, token, webhookID string, ...) error
- func (client *GitHubClient) UploadCodeScanning(ctx context.Context, owner, repository, branch, sarifContent string) (id string, err error)
- func (client *GitHubClient) UploadCodeScanningWithRef(ctx context.Context, owner, repository, ref, commitSHA, sarifContent string) (id string, err error)
- func (client *GitHubClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
- type GitHubRateLimitExecutionHandler
- type GitHubRateLimitRetryExecutor
- type GitLabClient
- func (client *GitLabClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
- func (client *GitLabClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
- func (client *GitLabClient) AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, ...) error
- func (client *GitLabClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, ...) error
- func (client *GitLabClient) AllowWorkflows(ctx context.Context, owner string) error
- func (client *GitLabClient) CommitAndPushFiles(ctx context.Context, ...) error
- func (client *GitLabClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
- func (client *GitLabClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
- func (client *GitLabClient) CreateOrUpdateEnvironment(ctx context.Context, owner, repo, envName string, teams []int64, ...) error
- func (client *GitLabClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
- func (client *GitLabClient) CreatePullRequest(ctx context.Context, ...) error
- func (client *GitLabClient) CreatePullRequestDetailed(ctx context.Context, ...) (CreatedPullRequestInfo, error)
- func (client *GitLabClient) CreateWebhook(ctx context.Context, owner, repository, branch, payloadURL string, ...) (string, string, error)
- func (client *GitLabClient) DeletePullRequestComment(ctx context.Context, owner, repository string, pullRequestID, commentID int) error
- func (client *GitLabClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, ...) error
- func (client *GitLabClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
- func (client *GitLabClient) DownloadFileFromRepo(_ context.Context, owner, repository, branch, path string) ([]byte, int, error)
- func (client *GitLabClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
- func (client *GitLabClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
- func (client *GitLabClient) GetCommitStatuses(ctx context.Context, _, repository, ref string) (status []CommitStatusInfo, err error)
- func (client *GitLabClient) GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
- func (client *GitLabClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, ...) ([]CommitInfo, error)
- func (client *GitLabClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
- func (client *GitLabClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
- func (client *GitLabClient) GetModifiedFiles(_ context.Context, owner, repository, refBefore, refAfter string) ([]string, error)
- func (client *GitLabClient) GetPullRequestByID(_ context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
- func (client *GitLabClient) GetPullRequestCommentSizeLimit() int
- func (client *GitLabClient) GetPullRequestDetailsSizeLimit() int
- func (client *GitLabClient) GetRepoCollaborators(ctx context.Context, owner, repo, affiliation, permission string) ([]string, error)
- func (client *GitLabClient) GetRepoTeamsByPermissions(ctx context.Context, owner, repo string, permissions []string) ([]int64, error)
- func (client *GitLabClient) GetRepositoryEnvironmentInfo(_ context.Context, _, _, _ string) (RepositoryEnvironmentInfo, error)
- func (client *GitLabClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
- func (client *GitLabClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
- func (client *GitLabClient) ListBranches(ctx context.Context, owner, repository string) ([]string, error)
- func (client *GitLabClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *GitLabClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
- func (client *GitLabClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *GitLabClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
- func (client *GitLabClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
- func (client *GitLabClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
- func (client *GitLabClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
- func (client *GitLabClient) ListRepositories(ctx context.Context) (map[string][]string, error)
- func (client *GitLabClient) MergePullRequest(ctx context.Context, owner, repo string, prNumber int, commitMessage string) error
- func (client *GitLabClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, ...) error
- func (client *GitLabClient) TestConnection(ctx context.Context) error
- func (client *GitLabClient) UnlabelPullRequest(ctx context.Context, owner, repository, label string, pullRequestID int) error
- func (client *GitLabClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, ...) error
- func (client *GitLabClient) UpdateWebhook(ctx context.Context, ...) error
- func (client *GitLabClient) UploadCodeScanning(_ context.Context, _ string, _ string, _ string, _ string) (string, error)
- func (client *GitLabClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
- func (client *GitLabClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
- type JobInfo
- type LabelInfo
- type ListOptions
- type Manifest
- type Permission
- type PullRequestComment
- type PullRequestDiff
- type PullRequestInfo
- type PullRequestReviewDetails
- type RepositoryEnvironmentInfo
- type RepositoryInfo
- type RepositoryVisibility
- type ResolvedDependency
- type SbomSnapshot
- type VcsClient
- type VcsInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppRepositoryInfo ¶ added in v1.18.0
type AppRepositoryInfo struct {
ID int64
Name string
FullName string
Owner string
Private bool
Description string
URL string
CloneURL string
SSHURL string
DefaultBranch string
}
AppRepositoryInfo contains information about an application repository ID - The unique identifier of the repository Name - The repository name FullName - The full name of the repository (including owner/namespace) Owner - The owner of the repository Private - Whether the repository is private Description - The repository description URL - The web URL of the repository CloneURL - The HTTP(S) clone URL of the repository SSHURL - The SSH clone URL of the repository DefaultBranch - The default branch of the repository
type AzureReposClient ¶ added in v1.4.0
type AzureReposClient struct {
// contains filtered or unexported fields
}
Azure Devops API version 6
func NewAzureReposClient ¶ added in v1.4.0
func NewAzureReposClient(vcsInfo VcsInfo, logger vcsutils.Log) (*AzureReposClient, error)
NewAzureReposClient create a new AzureReposClient
func (*AzureReposClient) AddOrganizationSecret ¶ added in v1.18.0
func (client *AzureReposClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
func (*AzureReposClient) AddPullRequestComment ¶ added in v1.4.0
func (client *AzureReposClient) AddPullRequestComment(ctx context.Context, _, repository, content string, pullRequestID int) error
AddPullRequestComment on Azure Repos
func (*AzureReposClient) AddPullRequestReviewComments ¶ added in v1.14.0
func (client *AzureReposClient) AddPullRequestReviewComments(ctx context.Context, _, repository string, pullRequestID int, comments ...PullRequestComment) error
AddPullRequestReviewComments on Azure Repos
func (*AzureReposClient) AddSshKeyToRepository ¶ added in v1.4.0
func (client *AzureReposClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, permission Permission) error
AddSshKeyToRepository on Azure Repos
func (*AzureReposClient) AllowWorkflows ¶ added in v1.18.0
func (client *AzureReposClient) AllowWorkflows(ctx context.Context, owner string) error
func (*AzureReposClient) CommitAndPushFiles ¶ added in v1.18.0
func (client *AzureReposClient) CommitAndPushFiles(ctx context.Context, owner, repo, sourceBranch, commitMessage, authorName, authorEmail string, files []FileToCommit) error
func (*AzureReposClient) CreateBranch ¶ added in v1.18.0
func (client *AzureReposClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
func (*AzureReposClient) CreateLabel ¶ added in v1.4.0
func (client *AzureReposClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
CreateLabel on Azure Repos
func (*AzureReposClient) CreateOrUpdateEnvironment ¶ added in v1.18.0
func (*AzureReposClient) CreateOrgVariable ¶ added in v1.19.0
func (client *AzureReposClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
func (*AzureReposClient) CreatePullRequest ¶ added in v1.4.0
func (client *AzureReposClient) CreatePullRequest(ctx context.Context, _, repository, sourceBranch, targetBranch, title, description string) error
CreatePullRequest on Azure Repos
func (*AzureReposClient) CreatePullRequestDetailed ¶ added in v1.18.0
func (client *AzureReposClient) CreatePullRequestDetailed(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) (CreatedPullRequestInfo, error)
func (*AzureReposClient) CreateWebhook ¶ added in v1.4.0
func (client *AzureReposClient) CreateWebhook(ctx context.Context, owner, repository, branch, payloadURL string, webhookEvents ...vcsutils.WebhookEvent) (string, string, error)
CreateWebhook on Azure Repos
func (*AzureReposClient) DeletePullRequestComment ¶ added in v1.12.0
func (client *AzureReposClient) DeletePullRequestComment(ctx context.Context, _, repository string, pullRequestID, commentID int) error
DeletePullRequestComment on Azure Repos
func (*AzureReposClient) DeletePullRequestReviewComments ¶ added in v1.14.0
func (client *AzureReposClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...CommentInfo) error
DeletePullRequestReviewComments on Azure Repos
func (*AzureReposClient) DeleteWebhook ¶ added in v1.4.0
func (client *AzureReposClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
DeleteWebhook on Azure Repos
func (*AzureReposClient) DownloadFileFromRepo ¶ added in v1.5.2
func (client *AzureReposClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
DownloadFileFromRepo on Azure Repos
func (*AzureReposClient) DownloadRepository ¶ added in v1.4.0
func (client *AzureReposClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) (err error)
DownloadRepository on Azure Repos
func (*AzureReposClient) GetCommitBySha ¶ added in v1.4.0
func (client *AzureReposClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
GetCommitBySha on Azure Repos
func (*AzureReposClient) GetCommitStatuses ¶ added in v1.7.0
func (client *AzureReposClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
GetCommitStatuses on Azure Repos
func (*AzureReposClient) GetCommits ¶ added in v1.13.0
func (client *AzureReposClient) GetCommits(ctx context.Context, _, repository, branch string) ([]CommitInfo, error)
GetCommits on Azure Repos
func (*AzureReposClient) GetCommitsWithQueryOptions ¶ added in v1.16.0
func (client *AzureReposClient) GetCommitsWithQueryOptions(ctx context.Context, _, repository string, listOptions GitCommitsQueryOptions) ([]CommitInfo, error)
func (*AzureReposClient) GetLabel ¶ added in v1.4.0
func (client *AzureReposClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
GetLabel on Azure Repos
func (*AzureReposClient) GetLatestCommit ¶ added in v1.4.0
func (client *AzureReposClient) GetLatestCommit(ctx context.Context, _, repository, branch string) (CommitInfo, error)
GetLatestCommit on Azure Repos
func (*AzureReposClient) GetModifiedFiles ¶ added in v1.6.0
func (*AzureReposClient) GetPullRequestByID ¶ added in v1.10.0
func (client *AzureReposClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
GetPullRequestById in Azure Repos
func (*AzureReposClient) GetPullRequestCommentSizeLimit ¶ added in v1.15.0
func (client *AzureReposClient) GetPullRequestCommentSizeLimit() int
func (*AzureReposClient) GetPullRequestDetailsSizeLimit ¶ added in v1.15.0
func (client *AzureReposClient) GetPullRequestDetailsSizeLimit() int
func (*AzureReposClient) GetRepoCollaborators ¶ added in v1.18.0
func (*AzureReposClient) GetRepoTeamsByPermissions ¶ added in v1.18.0
func (*AzureReposClient) GetRepositoryEnvironmentInfo ¶ added in v1.5.5
func (client *AzureReposClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
GetRepositoryEnvironmentInfo on GitLab
func (*AzureReposClient) GetRepositoryInfo ¶ added in v1.4.0
func (client *AzureReposClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
GetRepositoryInfo on Azure Repos
func (*AzureReposClient) ListAppRepositories ¶ added in v1.18.0
func (client *AzureReposClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
ListAppRepositories returns an error since this is not supported in Azure Repos
func (*AzureReposClient) ListBranches ¶ added in v1.4.0
func (client *AzureReposClient) ListBranches(ctx context.Context, _, repository string) ([]string, error)
ListBranches on Azure Repos
func (*AzureReposClient) ListOpenPullRequests ¶ added in v1.4.0
func (client *AzureReposClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequests on Azure Repos
func (*AzureReposClient) ListOpenPullRequestsWithBody ¶ added in v1.9.0
func (client *AzureReposClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequestsWithBody on Azure Repos
func (*AzureReposClient) ListPullRequestComments ¶ added in v1.4.0
func (client *AzureReposClient) ListPullRequestComments(ctx context.Context, _, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestComments on Azure Repos
func (*AzureReposClient) ListPullRequestLabels ¶ added in v1.4.0
func (client *AzureReposClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
ListPullRequestLabels on Azure Repos
func (*AzureReposClient) ListPullRequestReviewComments ¶ added in v1.14.0
func (client *AzureReposClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestReviewComments on Azure Repos
func (*AzureReposClient) ListPullRequestReviews ¶ added in v1.17.0
func (client *AzureReposClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
func (*AzureReposClient) ListPullRequestsAssociatedWithCommit ¶ added in v1.17.0
func (client *AzureReposClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
func (*AzureReposClient) ListRepositories ¶ added in v1.4.0
ListRepositories on Azure Repos
func (*AzureReposClient) MergePullRequest ¶ added in v1.18.0
func (*AzureReposClient) SetCommitStatus ¶ added in v1.4.0
func (client *AzureReposClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, owner, repository, ref, title, description, detailsURL string) error
SetCommitStatus on Azure Repos
func (*AzureReposClient) TestConnection ¶ added in v1.4.0
func (client *AzureReposClient) TestConnection(ctx context.Context) error
TestConnection on Azure Repos
func (*AzureReposClient) UnlabelPullRequest ¶ added in v1.4.0
func (client *AzureReposClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
UnlabelPullRequest on Azure Repos
func (*AzureReposClient) UpdatePullRequest ¶ added in v1.8.0
func (client *AzureReposClient) UpdatePullRequest(ctx context.Context, _, repository, title, body, targetBranchName string, prId int, state vcsutils.PullRequestState) error
UpdatePullRequest on Azure Repos
func (*AzureReposClient) UpdateWebhook ¶ added in v1.4.0
func (client *AzureReposClient) UpdateWebhook(ctx context.Context, owner, repository, branch, payloadURL, token, webhookID string, webhookEvents ...vcsutils.WebhookEvent) error
UpdateWebhook on Azure Repos
func (*AzureReposClient) UploadCodeScanning ¶ added in v1.4.0
func (client *AzureReposClient) UploadCodeScanning(ctx context.Context, owner, repository, branch, scanResults string) (string, error)
UploadCodeScanning on Azure Repos
func (*AzureReposClient) UploadCodeScanningWithRef ¶ added in v1.21.0
func (client *AzureReposClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
UploadCodeScanningWithRef on Azure Repos
func (*AzureReposClient) UploadSnapshotToDependencyGraph ¶ added in v1.20.0
func (client *AzureReposClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
type BitbucketCloudClient ¶
type BitbucketCloudClient struct {
// contains filtered or unexported fields
}
BitbucketCloudClient API version 2.0
func NewBitbucketCloudClient ¶
func NewBitbucketCloudClient(vcsInfo VcsInfo, logger vcsutils.Log) (*BitbucketCloudClient, error)
NewBitbucketCloudClient create a new BitbucketCloudClient
func (*BitbucketCloudClient) AddOrganizationSecret ¶ added in v1.18.0
func (client *BitbucketCloudClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
func (*BitbucketCloudClient) AddPullRequestComment ¶ added in v1.1.0
func (client *BitbucketCloudClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
AddPullRequestComment on Bitbucket cloud
func (*BitbucketCloudClient) AddPullRequestReviewComments ¶ added in v1.14.0
func (client *BitbucketCloudClient) AddPullRequestReviewComments(_ context.Context, _, _ string, _ int, _ ...PullRequestComment) error
AddPullRequestReviewComments on Bitbucket cloud
func (*BitbucketCloudClient) AddSshKeyToRepository ¶ added in v1.1.0
func (client *BitbucketCloudClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, _ Permission) (err error)
AddSshKeyToRepository on Bitbucket cloud, the deploy-key is always read-only.
func (*BitbucketCloudClient) AllowWorkflows ¶ added in v1.18.0
func (client *BitbucketCloudClient) AllowWorkflows(ctx context.Context, owner string) error
func (*BitbucketCloudClient) CommitAndPushFiles ¶ added in v1.18.0
func (client *BitbucketCloudClient) CommitAndPushFiles(ctx context.Context, owner, repo, sourceBranch, commitMessage, authorName, authorEmail string, files []FileToCommit) error
func (*BitbucketCloudClient) CreateBranch ¶ added in v1.18.0
func (client *BitbucketCloudClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
func (*BitbucketCloudClient) CreateLabel ¶ added in v1.1.0
func (client *BitbucketCloudClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
CreateLabel on Bitbucket cloud
func (*BitbucketCloudClient) CreateOrUpdateEnvironment ¶ added in v1.18.0
func (*BitbucketCloudClient) CreateOrgVariable ¶ added in v1.19.0
func (client *BitbucketCloudClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
func (*BitbucketCloudClient) CreatePullRequest ¶
func (client *BitbucketCloudClient) CreatePullRequest(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) error
CreatePullRequest on Bitbucket cloud
func (*BitbucketCloudClient) CreatePullRequestDetailed ¶ added in v1.18.0
func (client *BitbucketCloudClient) CreatePullRequestDetailed(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) (CreatedPullRequestInfo, error)
func (*BitbucketCloudClient) CreateWebhook ¶
func (client *BitbucketCloudClient) CreateWebhook(ctx context.Context, owner, repository, _, payloadURL string, webhookEvents ...vcsutils.WebhookEvent) (string, string, error)
CreateWebhook on Bitbucket cloud
func (*BitbucketCloudClient) DeletePullRequestComment ¶ added in v1.12.0
func (client *BitbucketCloudClient) DeletePullRequestComment(_ context.Context, _, _ string, _, _ int) error
DeletePullRequestComment on Bitbucket cloud
func (*BitbucketCloudClient) DeletePullRequestReviewComments ¶ added in v1.14.0
func (client *BitbucketCloudClient) DeletePullRequestReviewComments(_ context.Context, _, _ string, _ int, _ ...CommentInfo) error
DeletePullRequestReviewComments on Bitbucket cloud
func (*BitbucketCloudClient) DeleteWebhook ¶
func (client *BitbucketCloudClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
DeleteWebhook on Bitbucket cloud
func (*BitbucketCloudClient) DownloadFileFromRepo ¶ added in v1.5.2
func (client *BitbucketCloudClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
DownloadFileFromRepo on Bitbucket cloud
func (*BitbucketCloudClient) DownloadRepository ¶
func (client *BitbucketCloudClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
DownloadRepository on Bitbucket cloud
func (*BitbucketCloudClient) GetCommitBySha ¶ added in v1.1.0
func (client *BitbucketCloudClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
GetCommitBySha on Bitbucket cloud
func (*BitbucketCloudClient) GetCommitStatuses ¶ added in v1.7.0
func (client *BitbucketCloudClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
GetCommitStatuses on Bitbucket cloud
func (*BitbucketCloudClient) GetCommits ¶ added in v1.13.0
func (client *BitbucketCloudClient) GetCommits(_ context.Context, _, _, _ string) ([]CommitInfo, error)
GetCommits on Bitbucket Cloud
func (*BitbucketCloudClient) GetCommitsWithQueryOptions ¶ added in v1.16.0
func (client *BitbucketCloudClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, listOptions GitCommitsQueryOptions) ([]CommitInfo, error)
func (*BitbucketCloudClient) GetLabel ¶ added in v1.1.0
func (client *BitbucketCloudClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
GetLabel on Bitbucket cloud
func (*BitbucketCloudClient) GetLatestCommit ¶ added in v1.1.0
func (client *BitbucketCloudClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
GetLatestCommit on Bitbucket cloud
func (*BitbucketCloudClient) GetModifiedFiles ¶ added in v1.6.0
func (*BitbucketCloudClient) GetPullRequestByID ¶ added in v1.10.0
func (client *BitbucketCloudClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
func (*BitbucketCloudClient) GetPullRequestCommentSizeLimit ¶ added in v1.15.0
func (client *BitbucketCloudClient) GetPullRequestCommentSizeLimit() int
func (*BitbucketCloudClient) GetPullRequestDetailsSizeLimit ¶ added in v1.15.0
func (client *BitbucketCloudClient) GetPullRequestDetailsSizeLimit() int
func (*BitbucketCloudClient) GetRepoCollaborators ¶ added in v1.18.0
func (*BitbucketCloudClient) GetRepoTeamsByPermissions ¶ added in v1.18.0
func (*BitbucketCloudClient) GetRepositoryEnvironmentInfo ¶ added in v1.5.5
func (client *BitbucketCloudClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
GetRepositoryEnvironmentInfo on Bitbucket cloud
func (*BitbucketCloudClient) GetRepositoryInfo ¶ added in v1.1.0
func (client *BitbucketCloudClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
GetRepositoryInfo on Bitbucket cloud
func (*BitbucketCloudClient) ListAppRepositories ¶ added in v1.18.0
func (client *BitbucketCloudClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
func (*BitbucketCloudClient) ListBranches ¶
func (client *BitbucketCloudClient) ListBranches(ctx context.Context, owner, repository string) ([]string, error)
ListBranches on Bitbucket cloud
func (*BitbucketCloudClient) ListOpenPullRequests ¶ added in v1.2.0
func (client *BitbucketCloudClient) ListOpenPullRequests(ctx context.Context, owner, repository string) (res []PullRequestInfo, err error)
ListOpenPullRequests on Bitbucket cloud
func (*BitbucketCloudClient) ListOpenPullRequestsWithBody ¶ added in v1.9.0
func (client *BitbucketCloudClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) (res []PullRequestInfo, err error)
ListOpenPullRequestsWithBody on Bitbucket cloud
func (*BitbucketCloudClient) ListPullRequestComments ¶ added in v1.2.0
func (client *BitbucketCloudClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) (res []CommentInfo, err error)
ListPullRequestComments on Bitbucket cloud
func (*BitbucketCloudClient) ListPullRequestLabels ¶ added in v1.1.0
func (client *BitbucketCloudClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
ListPullRequestLabels on Bitbucket cloud
func (*BitbucketCloudClient) ListPullRequestReviewComments ¶ added in v1.14.0
func (client *BitbucketCloudClient) ListPullRequestReviewComments(_ context.Context, _, _ string, _ int) ([]CommentInfo, error)
ListPullRequestReviewComments on Bitbucket cloud
func (*BitbucketCloudClient) ListPullRequestReviews ¶ added in v1.17.0
func (client *BitbucketCloudClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
func (*BitbucketCloudClient) ListPullRequestsAssociatedWithCommit ¶ added in v1.17.0
func (client *BitbucketCloudClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository, commitSHA string) ([]PullRequestInfo, error)
func (*BitbucketCloudClient) ListRepositories ¶
func (client *BitbucketCloudClient) ListRepositories(ctx context.Context) (map[string][]string, error)
ListRepositories on Bitbucket cloud
func (*BitbucketCloudClient) MergePullRequest ¶ added in v1.18.0
func (*BitbucketCloudClient) SetCommitStatus ¶
func (client *BitbucketCloudClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, owner, repository, ref, title, description, detailsURL string) error
SetCommitStatus on Bitbucket cloud
func (*BitbucketCloudClient) TestConnection ¶
func (client *BitbucketCloudClient) TestConnection(ctx context.Context) error
TestConnection on Bitbucket cloud
func (*BitbucketCloudClient) UnlabelPullRequest ¶ added in v1.1.0
func (client *BitbucketCloudClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
UnlabelPullRequest on Bitbucket cloud
func (*BitbucketCloudClient) UpdatePullRequest ¶ added in v1.8.0
func (client *BitbucketCloudClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, prId int, state vcsutils.PullRequestState) error
UpdatePullRequest on Bitbucket cloud
func (*BitbucketCloudClient) UpdateWebhook ¶
func (client *BitbucketCloudClient) UpdateWebhook(ctx context.Context, owner, repository, _, payloadURL, token, webhookID string, webhookEvents ...vcsutils.WebhookEvent) error
UpdateWebhook on Bitbucket cloud
func (*BitbucketCloudClient) UploadCodeScanning ¶ added in v1.3.0
func (client *BitbucketCloudClient) UploadCodeScanning(ctx context.Context, owner string, repository string, branch string, scanResults string) (string, error)
UploadCodeScanning on Bitbucket cloud
func (*BitbucketCloudClient) UploadCodeScanningWithRef ¶ added in v1.21.0
func (client *BitbucketCloudClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
UploadCodeScanningWithRef on Bitbucket Cloud
func (*BitbucketCloudClient) UploadSnapshotToDependencyGraph ¶ added in v1.20.0
func (client *BitbucketCloudClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
type BitbucketCommitInfo ¶ added in v1.7.1
type BitbucketCommitInfo struct {
Title string `mapstructure:"key"`
Url string `mapstructure:"url"`
State string `mapstructure:"state"`
Creator string `mapstructure:"name"`
Description string `mapstructure:"description"`
CreatedOn string `mapstructure:"created_on"`
UpdatedOn string `mapstructure:"updated_on"`
DateAdded float64 `mapstructure:"DateAdded"`
}
type BitbucketServerClient ¶
type BitbucketServerClient struct {
// contains filtered or unexported fields
}
BitbucketServerClient API version 1.0
func NewBitbucketServerClient ¶
func NewBitbucketServerClient(vcsInfo VcsInfo, logger vcsutils.Log) (*BitbucketServerClient, error)
NewBitbucketServerClient create a new BitbucketServerClient
func (*BitbucketServerClient) AddOrganizationSecret ¶ added in v1.18.0
func (client *BitbucketServerClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
func (*BitbucketServerClient) AddPullRequestComment ¶ added in v1.1.0
func (client *BitbucketServerClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
AddPullRequestComment on Bitbucket server
func (*BitbucketServerClient) AddPullRequestReviewComments ¶ added in v1.14.0
func (client *BitbucketServerClient) AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...PullRequestComment) error
AddPullRequestReviewComments on Bitbucket server
func (*BitbucketServerClient) AddSshKeyToRepository ¶ added in v1.1.0
func (client *BitbucketServerClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, permission Permission) (err error)
AddSshKeyToRepository on Bitbucket server
func (*BitbucketServerClient) AllowWorkflows ¶ added in v1.18.0
func (client *BitbucketServerClient) AllowWorkflows(ctx context.Context, owner string) error
func (*BitbucketServerClient) CommitAndPushFiles ¶ added in v1.18.0
func (client *BitbucketServerClient) CommitAndPushFiles(ctx context.Context, owner, repo, sourceBranch, commitMessage, authorName, authorEmail string, files []FileToCommit) error
func (*BitbucketServerClient) CreateBranch ¶ added in v1.18.0
func (client *BitbucketServerClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
func (*BitbucketServerClient) CreateLabel ¶ added in v1.1.0
func (client *BitbucketServerClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
CreateLabel on Bitbucket server
func (*BitbucketServerClient) CreateOrUpdateEnvironment ¶ added in v1.18.0
func (*BitbucketServerClient) CreateOrgVariable ¶ added in v1.19.0
func (client *BitbucketServerClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
func (*BitbucketServerClient) CreatePullRequest ¶
func (client *BitbucketServerClient) CreatePullRequest(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) error
CreatePullRequest on Bitbucket server
func (*BitbucketServerClient) CreatePullRequestDetailed ¶ added in v1.18.0
func (client *BitbucketServerClient) CreatePullRequestDetailed(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) (CreatedPullRequestInfo, error)
func (*BitbucketServerClient) CreateWebhook ¶
func (client *BitbucketServerClient) CreateWebhook(ctx context.Context, owner, repository, _, payloadURL string, webhookEvents ...vcsutils.WebhookEvent) (string, string, error)
CreateWebhook on Bitbucket server
func (*BitbucketServerClient) DeletePullRequestComment ¶ added in v1.12.0
func (client *BitbucketServerClient) DeletePullRequestComment(ctx context.Context, owner, repository string, pullRequestID, commentID int) error
DeletePullRequestComment on Bitbucket Server
func (*BitbucketServerClient) DeletePullRequestReviewComments ¶ added in v1.14.0
func (client *BitbucketServerClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...CommentInfo) error
DeletePullRequestReviewComments on Bitbucket server
func (*BitbucketServerClient) DeleteWebhook ¶
func (client *BitbucketServerClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
DeleteWebhook on Bitbucket server
func (*BitbucketServerClient) DownloadFileFromRepo ¶ added in v1.5.2
func (client *BitbucketServerClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
DownloadFileFromRepo on Bitbucket server
func (*BitbucketServerClient) DownloadRepository ¶
func (client *BitbucketServerClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
DownloadRepository on Bitbucket server
func (*BitbucketServerClient) GetCommitBySha ¶ added in v1.1.0
func (client *BitbucketServerClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
GetCommitBySha on Bitbucket server
func (*BitbucketServerClient) GetCommitStatuses ¶ added in v1.7.0
func (client *BitbucketServerClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
GetCommitStatuses on Bitbucket server
func (*BitbucketServerClient) GetCommits ¶ added in v1.13.0
func (client *BitbucketServerClient) GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
GetCommits on Bitbucket server
func (*BitbucketServerClient) GetCommitsWithQueryOptions ¶ added in v1.16.0
func (client *BitbucketServerClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, listOptions GitCommitsQueryOptions) ([]CommitInfo, error)
func (*BitbucketServerClient) GetLabel ¶ added in v1.1.0
func (client *BitbucketServerClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
GetLabel on Bitbucket server
func (*BitbucketServerClient) GetLatestCommit ¶ added in v1.1.0
func (client *BitbucketServerClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
GetLatestCommit on Bitbucket server
func (*BitbucketServerClient) GetModifiedFiles ¶ added in v1.6.0
func (*BitbucketServerClient) GetPullRequestByID ¶ added in v1.10.0
func (client *BitbucketServerClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
GetPullRequestInfoById on bitbucket server
func (*BitbucketServerClient) GetPullRequestCommentSizeLimit ¶ added in v1.15.0
func (client *BitbucketServerClient) GetPullRequestCommentSizeLimit() int
func (*BitbucketServerClient) GetPullRequestDetailsSizeLimit ¶ added in v1.15.0
func (client *BitbucketServerClient) GetPullRequestDetailsSizeLimit() int
func (*BitbucketServerClient) GetRepoCollaborators ¶ added in v1.18.0
func (*BitbucketServerClient) GetRepoTeamsByPermissions ¶ added in v1.18.0
func (*BitbucketServerClient) GetRepositoryEnvironmentInfo ¶ added in v1.5.5
func (client *BitbucketServerClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
GetRepositoryEnvironmentInfo on Bitbucket server
func (*BitbucketServerClient) GetRepositoryInfo ¶ added in v1.1.0
func (client *BitbucketServerClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
GetRepositoryInfo on Bitbucket server
func (*BitbucketServerClient) ListAppRepositories ¶ added in v1.18.0
func (client *BitbucketServerClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
ListAppRepositories returns an error since this is not supported in Bitbucket Server
func (*BitbucketServerClient) ListBranches ¶
func (client *BitbucketServerClient) ListBranches(ctx context.Context, owner, repository string) ([]string, error)
ListBranches on Bitbucket server
func (*BitbucketServerClient) ListOpenPullRequests ¶ added in v1.2.0
func (client *BitbucketServerClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequests on Bitbucket server
func (*BitbucketServerClient) ListOpenPullRequestsWithBody ¶ added in v1.9.0
func (client *BitbucketServerClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequestsWithBody on Bitbucket server
func (*BitbucketServerClient) ListPullRequestComments ¶ added in v1.2.0
func (client *BitbucketServerClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestComments on Bitbucket server
func (*BitbucketServerClient) ListPullRequestLabels ¶ added in v1.1.0
func (client *BitbucketServerClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
ListPullRequestLabels on Bitbucket server
func (*BitbucketServerClient) ListPullRequestReviewComments ¶ added in v1.14.0
func (client *BitbucketServerClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestReviewComments on Bitbucket server
func (*BitbucketServerClient) ListPullRequestReviews ¶ added in v1.17.0
func (client *BitbucketServerClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
func (*BitbucketServerClient) ListPullRequestsAssociatedWithCommit ¶ added in v1.17.0
func (client *BitbucketServerClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
func (*BitbucketServerClient) ListRepositories ¶
func (client *BitbucketServerClient) ListRepositories(ctx context.Context) (map[string][]string, error)
ListRepositories on Bitbucket server
func (*BitbucketServerClient) MergePullRequest ¶ added in v1.18.0
func (*BitbucketServerClient) SetCommitStatus ¶
func (client *BitbucketServerClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, _, _, ref, title, description, detailsURL string) error
SetCommitStatus on Bitbucket server
func (*BitbucketServerClient) TestConnection ¶
func (client *BitbucketServerClient) TestConnection(ctx context.Context) error
TestConnection on Bitbucket server
func (*BitbucketServerClient) UnlabelPullRequest ¶ added in v1.1.0
func (client *BitbucketServerClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
UnlabelPullRequest on Bitbucket server
func (*BitbucketServerClient) UpdatePullRequest ¶ added in v1.8.0
func (client *BitbucketServerClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchRef string, prId int, state vcsutils.PullRequestState) (err error)
UpdatePullRequest on bitbucket server Changing targetBranchRef currently not supported.
func (*BitbucketServerClient) UpdateWebhook ¶
func (client *BitbucketServerClient) UpdateWebhook(ctx context.Context, owner, repository, _, payloadURL, token, webhookID string, webhookEvents ...vcsutils.WebhookEvent) error
UpdateWebhook on Bitbucket server
func (*BitbucketServerClient) UploadCodeScanning ¶ added in v1.3.0
func (*BitbucketServerClient) UploadCodeScanningWithRef ¶ added in v1.21.0
func (client *BitbucketServerClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
UploadCodeScanningWithRef on Bitbucket Server
func (*BitbucketServerClient) UploadSnapshotToDependencyGraph ¶ added in v1.20.0
func (client *BitbucketServerClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
type BranchInfo ¶ added in v1.2.0
type ClientBuilder ¶
type ClientBuilder struct {
// contains filtered or unexported fields
}
ClientBuilder builds VcsClient
func NewClientBuilder ¶
func NewClientBuilder(vcsProvider vcsutils.VcsProvider) *ClientBuilder
NewClientBuilder creates new ClientBuilder
func (*ClientBuilder) ApiEndpoint ¶
func (builder *ClientBuilder) ApiEndpoint(apiEndpoint string) *ClientBuilder
ApiEndpoint sets the API endpoint
func (*ClientBuilder) Build ¶
func (builder *ClientBuilder) Build() (VcsClient, error)
Build builds the VcsClient
func (*ClientBuilder) Logger ¶
func (builder *ClientBuilder) Logger(logger vcsutils.Log) *ClientBuilder
Logger sets the logger
func (*ClientBuilder) Project ¶ added in v1.4.0
func (builder *ClientBuilder) Project(project string) *ClientBuilder
Project sets the project
func (*ClientBuilder) Token ¶
func (builder *ClientBuilder) Token(token string) *ClientBuilder
Token sets the access token
func (*ClientBuilder) Username ¶
func (builder *ClientBuilder) Username(username string) *ClientBuilder
Username sets the username
type CloneInfo ¶ added in v1.1.0
type CloneInfo struct {
// HTTP is a URL string to clone repository using HTTP(S)) protocol.
HTTP string
// SSH is a URL string to clone repository using SSH protocol.
SSH string
}
CloneInfo contains URLs that can be used to clone the repository.
type CommentInfo ¶ added in v1.2.0
type CommitInfo ¶ added in v1.1.0
type CommitInfo struct {
// The SHA-1 hash of the commit
Hash string
// The author's name
AuthorName string
// The committer's name
CommitterName string
// The commit URL
Url string
// Seconds from epoch
Timestamp int64
// The commit message
Message string
// The SHA-1 hashes of the parent commits
ParentHashes []string
// The email of the commit author
AuthorEmail string
}
CommitInfo contains the details of a commit
type CommitStatus ¶
type CommitStatus int
CommitStatus the status of the commit in the VCS
const ( // Pass means that the commit passed the tests Pass CommitStatus = iota // Fail means that the commit failed the tests Fail // Error means that an unexpected error occurred Error // InProgress means than the status check is in progress InProgress )
type CommitStatusInfo ¶ added in v1.7.0
type CommitStatusInfo struct {
State CommitStatus
Description string
DetailsUrl string
Creator string
CreatedAt time.Time
LastUpdatedAt time.Time
}
CommitStatusInfo status which is then reflected in pull requests involving those commits State - One of success, pending, failure, or error Description - Description of the commit status DetailsUrl - The URL for component status link Creator - The creator of the status CreatedAt - Date of status creation LastUpdatedAt - Date of status last update time.
type CreatedPullRequestInfo ¶ added in v1.18.0
CreatedPullRequestInfo contains the data returned from a pull request creation Number - The number of the pull request URL - The URL of the pull request StatusesUrl - The URL to the commit statuses of the pull request
type DetectorInfo ¶ added in v1.20.0
type DetectorInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Url string `json:"url"`
}
DetectorInfo contains information about the detector that created the snapshot
type FileInfo ¶ added in v1.20.0
type FileInfo struct {
SourceLocation string `json:"source_location"`
}
FileInfo contains information about the manifest file
type FileToCommit ¶ added in v1.18.0
type GitCommitsQueryOptions ¶ added in v1.16.0
type GitCommitsQueryOptions struct {
// Since when should Commits be included in the response.
Since time.Time
ListOptions
}
GitCommitsQueryOptions specifies the optional parameters fot the commit list.
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
GitHubClient API version 3
func NewGitHubClient ¶
func NewGitHubClient(vcsInfo VcsInfo, logger vcsutils.Log) (*GitHubClient, error)
NewGitHubClient create a new GitHubClient
func (*GitHubClient) AddOrganizationSecret ¶ added in v1.18.0
func (client *GitHubClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
func (*GitHubClient) AddPullRequestComment ¶ added in v1.1.0
func (client *GitHubClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
AddPullRequestComment on GitHub
func (*GitHubClient) AddPullRequestReviewComments ¶ added in v1.14.0
func (client *GitHubClient) AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...PullRequestComment) error
AddPullRequestReviewComments on GitHub
func (*GitHubClient) AddSshKeyToRepository ¶ added in v1.1.0
func (client *GitHubClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, permission Permission) error
AddSshKeyToRepository on GitHub
func (*GitHubClient) AllowWorkflows ¶ added in v1.18.0
func (client *GitHubClient) AllowWorkflows(ctx context.Context, owner string) error
func (*GitHubClient) CommitAndPushFiles ¶ added in v1.18.0
func (client *GitHubClient) CommitAndPushFiles( ctx context.Context, owner, repo, sourceBranch, commitMessage, authorName, authorEmail string, files []FileToCommit, ) error
func (*GitHubClient) CreateBranch ¶ added in v1.18.0
func (client *GitHubClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
func (*GitHubClient) CreateLabel ¶ added in v1.1.0
func (client *GitHubClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
CreateLabel on GitHub
func (*GitHubClient) CreateOrUpdateEnvironment ¶ added in v1.18.0
func (*GitHubClient) CreateOrgVariable ¶ added in v1.19.0
func (client *GitHubClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
func (*GitHubClient) CreatePullRequest ¶
func (client *GitHubClient) CreatePullRequest(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) error
CreatePullRequest on GitHub
func (*GitHubClient) CreatePullRequestDetailed ¶ added in v1.18.0
func (client *GitHubClient) CreatePullRequestDetailed(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) (CreatedPullRequestInfo, error)
func (*GitHubClient) CreateWebhook ¶
func (client *GitHubClient) CreateWebhook(ctx context.Context, owner, repository, _, payloadURL string, webhookEvents ...vcsutils.WebhookEvent) (string, string, error)
CreateWebhook on GitHub
func (*GitHubClient) DeletePullRequestComment ¶ added in v1.12.0
func (client *GitHubClient) DeletePullRequestComment(ctx context.Context, owner, repository string, _, commentID int) error
DeletePullRequestComment on GitHub
func (*GitHubClient) DeletePullRequestReviewComments ¶ added in v1.14.0
func (client *GitHubClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, _ int, comments ...CommentInfo) error
DeletePullRequestReviewComments on GitHub
func (*GitHubClient) DeleteWebhook ¶
func (client *GitHubClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
DeleteWebhook on GitHub
func (*GitHubClient) DownloadFileFromRepo ¶ added in v1.5.2
func (client *GitHubClient) DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) (content []byte, statusCode int, err error)
DownloadFileFromRepo on GitHub
func (*GitHubClient) DownloadRepository ¶
func (client *GitHubClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) (err error)
DownloadRepository on GitHub
func (*GitHubClient) GetCommitBySha ¶ added in v1.1.0
func (client *GitHubClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
GetCommitBySha on GitHub
func (*GitHubClient) GetCommitStatuses ¶ added in v1.7.0
func (client *GitHubClient) GetCommitStatuses(ctx context.Context, owner, repository, ref string) (statusInfoList []CommitStatusInfo, err error)
GetCommitStatuses on GitHub
func (*GitHubClient) GetCommits ¶ added in v1.13.0
func (client *GitHubClient) GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
GetCommits on GitHub
func (*GitHubClient) GetCommitsWithQueryOptions ¶ added in v1.16.0
func (client *GitHubClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, listOptions GitCommitsQueryOptions) ([]CommitInfo, error)
GetCommitsWithQueryOptions on GitHub
func (*GitHubClient) GetLabel ¶ added in v1.1.0
func (client *GitHubClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
GetLabel on GitHub
func (*GitHubClient) GetLatestCommit ¶ added in v1.1.0
func (client *GitHubClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
GetLatestCommit on GitHub
func (*GitHubClient) GetModifiedFiles ¶ added in v1.6.0
func (*GitHubClient) GetPullRequestByID ¶ added in v1.10.0
func (client *GitHubClient) GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (PullRequestInfo, error)
func (*GitHubClient) GetPullRequestCommentSizeLimit ¶ added in v1.15.0
func (client *GitHubClient) GetPullRequestCommentSizeLimit() int
func (*GitHubClient) GetPullRequestDetailsSizeLimit ¶ added in v1.15.0
func (client *GitHubClient) GetPullRequestDetailsSizeLimit() int
func (*GitHubClient) GetRepoCollaborators ¶ added in v1.18.0
func (*GitHubClient) GetRepoTeamsByPermissions ¶ added in v1.18.0
func (*GitHubClient) GetRepositoryEnvironmentInfo ¶ added in v1.5.5
func (client *GitHubClient) GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
GetRepositoryEnvironmentInfo on GitHub
func (*GitHubClient) GetRepositoryInfo ¶ added in v1.1.0
func (client *GitHubClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
GetRepositoryInfo on GitHub
func (*GitHubClient) ListAppRepositories ¶ added in v1.18.0
func (client *GitHubClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
func (*GitHubClient) ListBranches ¶
func (client *GitHubClient) ListBranches(ctx context.Context, owner, repository string) (branchList []string, err error)
ListBranches on GitHub
func (*GitHubClient) ListOpenPullRequests ¶ added in v1.2.0
func (client *GitHubClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequests on GitHub
func (*GitHubClient) ListOpenPullRequestsWithBody ¶ added in v1.9.0
func (client *GitHubClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequestsWithBody on GitHub
func (*GitHubClient) ListPullRequestComments ¶ added in v1.2.0
func (client *GitHubClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestComments on GitHub
func (*GitHubClient) ListPullRequestLabels ¶ added in v1.1.0
func (client *GitHubClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
ListPullRequestLabels on GitHub
func (*GitHubClient) ListPullRequestReviewComments ¶ added in v1.14.0
func (client *GitHubClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestReviewComments on GitHub
func (*GitHubClient) ListPullRequestReviews ¶ added in v1.17.0
func (client *GitHubClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
ListPullRequestReviews on GitHub
func (*GitHubClient) ListPullRequestsAssociatedWithCommit ¶ added in v1.17.0
func (client *GitHubClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
func (*GitHubClient) ListRepositories ¶
func (client *GitHubClient) ListRepositories(ctx context.Context) (results map[string][]string, err error)
ListRepositories on GitHub
func (*GitHubClient) MergePullRequest ¶ added in v1.18.0
func (*GitHubClient) SetCommitStatus ¶
func (client *GitHubClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, owner, repository, ref, title, description, detailsURL string) error
SetCommitStatus on GitHub
func (*GitHubClient) TestConnection ¶
func (client *GitHubClient) TestConnection(ctx context.Context) error
TestConnection on GitHub
func (*GitHubClient) UnlabelPullRequest ¶ added in v1.1.0
func (client *GitHubClient) UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
UnlabelPullRequest on GitHub
func (*GitHubClient) UpdatePullRequest ¶ added in v1.8.0
func (client *GitHubClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, id int, state vcsutils.PullRequestState) error
UpdatePullRequest on GitHub
func (*GitHubClient) UpdateWebhook ¶
func (client *GitHubClient) UpdateWebhook(ctx context.Context, owner, repository, _, payloadURL, token, webhookID string, webhookEvents ...vcsutils.WebhookEvent) error
UpdateWebhook on GitHub
func (*GitHubClient) UploadCodeScanning ¶ added in v1.3.0
func (client *GitHubClient) UploadCodeScanning(ctx context.Context, owner, repository, branch, sarifContent string) (id string, err error)
UploadCodeScanning to GitHub Security tab
func (*GitHubClient) UploadCodeScanningWithRef ¶ added in v1.21.0
func (*GitHubClient) UploadSnapshotToDependencyGraph ¶ added in v1.20.0
func (client *GitHubClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
type GitHubRateLimitExecutionHandler ¶ added in v1.14.3
type GitHubRateLimitRetryExecutor ¶ added in v1.14.3
type GitHubRateLimitRetryExecutor struct {
vcsutils.RetryExecutor
GitHubRateLimitExecutionHandler
}
func (*GitHubRateLimitRetryExecutor) Execute ¶ added in v1.14.3
func (ghe *GitHubRateLimitRetryExecutor) Execute() error
type GitLabClient ¶
type GitLabClient struct {
// contains filtered or unexported fields
}
GitLabClient API version 4
func NewGitLabClient ¶
func NewGitLabClient(vcsInfo VcsInfo, logger vcsutils.Log) (*GitLabClient, error)
NewGitLabClient create a new GitLabClient
func (*GitLabClient) AddOrganizationSecret ¶ added in v1.18.0
func (client *GitLabClient) AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
func (*GitLabClient) AddPullRequestComment ¶ added in v1.1.0
func (client *GitLabClient) AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
AddPullRequestComment on GitLab
func (*GitLabClient) AddPullRequestReviewComments ¶ added in v1.14.0
func (client *GitLabClient) AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...PullRequestComment) error
AddPullRequestReviewComments adds comments to a pull request on GitLab.
func (*GitLabClient) AddSshKeyToRepository ¶ added in v1.1.0
func (client *GitLabClient) AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, permission Permission) error
AddSshKeyToRepository on GitLab
func (*GitLabClient) AllowWorkflows ¶ added in v1.18.0
func (client *GitLabClient) AllowWorkflows(ctx context.Context, owner string) error
func (*GitLabClient) CommitAndPushFiles ¶ added in v1.18.0
func (client *GitLabClient) CommitAndPushFiles(ctx context.Context, owner, repo, sourceBranch, commitMessage, authorName, authorEmail string, files []FileToCommit) error
func (*GitLabClient) CreateBranch ¶ added in v1.18.0
func (client *GitLabClient) CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
func (*GitLabClient) CreateLabel ¶ added in v1.1.0
func (client *GitLabClient) CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
CreateLabel on GitLab
func (*GitLabClient) CreateOrUpdateEnvironment ¶ added in v1.18.0
func (*GitLabClient) CreateOrgVariable ¶ added in v1.19.0
func (client *GitLabClient) CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
func (*GitLabClient) CreatePullRequest ¶
func (client *GitLabClient) CreatePullRequest(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) error
CreatePullRequest on GitLab
func (*GitLabClient) CreatePullRequestDetailed ¶ added in v1.18.0
func (client *GitLabClient) CreatePullRequestDetailed(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) (CreatedPullRequestInfo, error)
func (*GitLabClient) CreateWebhook ¶
func (client *GitLabClient) CreateWebhook(ctx context.Context, owner, repository, branch, payloadURL string, webhookEvents ...vcsutils.WebhookEvent) (string, string, error)
CreateWebhook on GitLab
func (*GitLabClient) DeletePullRequestComment ¶ added in v1.12.0
func (client *GitLabClient) DeletePullRequestComment(ctx context.Context, owner, repository string, pullRequestID, commentID int) error
DeletePullRequestComment on GitLab
func (*GitLabClient) DeletePullRequestReviewComments ¶ added in v1.14.0
func (client *GitLabClient) DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...CommentInfo) error
DeletePullRequestReviewComment on GitLab
func (*GitLabClient) DeleteWebhook ¶
func (client *GitLabClient) DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
DeleteWebhook on GitLab
func (*GitLabClient) DownloadFileFromRepo ¶ added in v1.5.2
func (client *GitLabClient) DownloadFileFromRepo(_ context.Context, owner, repository, branch, path string) ([]byte, int, error)
DownloadFileFromRepo on GitLab
func (*GitLabClient) DownloadRepository ¶
func (client *GitLabClient) DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
DownloadRepository on GitLab
func (*GitLabClient) GetCommitBySha ¶ added in v1.1.0
func (client *GitLabClient) GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
GetCommitBySha on GitLab
func (*GitLabClient) GetCommitStatuses ¶ added in v1.7.0
func (client *GitLabClient) GetCommitStatuses(ctx context.Context, _, repository, ref string) (status []CommitStatusInfo, err error)
GetCommitStatuses on GitLab
func (*GitLabClient) GetCommits ¶ added in v1.13.0
func (client *GitLabClient) GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
GetCommits on GitLab
func (*GitLabClient) GetCommitsWithQueryOptions ¶ added in v1.16.0
func (client *GitLabClient) GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, listOptions GitCommitsQueryOptions) ([]CommitInfo, error)
func (*GitLabClient) GetLabel ¶ added in v1.1.0
func (client *GitLabClient) GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
GetLabel on GitLub
func (*GitLabClient) GetLatestCommit ¶ added in v1.1.0
func (client *GitLabClient) GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
GetLatestCommit on GitLab
func (*GitLabClient) GetModifiedFiles ¶ added in v1.6.0
func (*GitLabClient) GetPullRequestByID ¶ added in v1.10.0
func (client *GitLabClient) GetPullRequestByID(_ context.Context, owner, repository string, pullRequestId int) (pullRequestInfo PullRequestInfo, err error)
GetPullRequestInfoById on GitLab
func (*GitLabClient) GetPullRequestCommentSizeLimit ¶ added in v1.15.0
func (client *GitLabClient) GetPullRequestCommentSizeLimit() int
func (*GitLabClient) GetPullRequestDetailsSizeLimit ¶ added in v1.15.0
func (client *GitLabClient) GetPullRequestDetailsSizeLimit() int
func (*GitLabClient) GetRepoCollaborators ¶ added in v1.18.0
func (*GitLabClient) GetRepoTeamsByPermissions ¶ added in v1.18.0
func (*GitLabClient) GetRepositoryEnvironmentInfo ¶ added in v1.5.5
func (client *GitLabClient) GetRepositoryEnvironmentInfo(_ context.Context, _, _, _ string) (RepositoryEnvironmentInfo, error)
GetRepositoryEnvironmentInfo on GitLab
func (*GitLabClient) GetRepositoryInfo ¶ added in v1.1.0
func (client *GitLabClient) GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
GetRepositoryInfo on GitLab
func (*GitLabClient) ListAppRepositories ¶ added in v1.18.0
func (client *GitLabClient) ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
ListAppRepositories returns an error since this is not supported in GitLab
func (*GitLabClient) ListBranches ¶
func (client *GitLabClient) ListBranches(ctx context.Context, owner, repository string) ([]string, error)
ListBranches on GitLab
func (*GitLabClient) ListOpenPullRequests ¶ added in v1.2.0
func (client *GitLabClient) ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequests on GitLab
func (*GitLabClient) ListOpenPullRequestsWithBody ¶ added in v1.9.0
func (client *GitLabClient) ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
ListOpenPullRequestsWithBody on GitLab
func (*GitLabClient) ListPullRequestComments ¶ added in v1.2.0
func (client *GitLabClient) ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestComments on GitLab
func (*GitLabClient) ListPullRequestLabels ¶ added in v1.1.0
func (client *GitLabClient) ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
ListPullRequestLabels on GitLab
func (*GitLabClient) ListPullRequestReviewComments ¶ added in v1.14.0
func (client *GitLabClient) ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
ListPullRequestReviewComments on GitLab
func (*GitLabClient) ListPullRequestReviews ¶ added in v1.17.0
func (client *GitLabClient) ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
func (*GitLabClient) ListPullRequestsAssociatedWithCommit ¶ added in v1.17.0
func (client *GitLabClient) ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
func (*GitLabClient) ListRepositories ¶
ListRepositories on GitLab
func (*GitLabClient) MergePullRequest ¶ added in v1.18.0
func (*GitLabClient) SetCommitStatus ¶
func (client *GitLabClient) SetCommitStatus(ctx context.Context, commitStatus CommitStatus, owner, repository, ref, title, description, detailsURL string) error
SetCommitStatus on GitLab
func (*GitLabClient) TestConnection ¶
func (client *GitLabClient) TestConnection(ctx context.Context) error
TestConnection on GitLab
func (*GitLabClient) UnlabelPullRequest ¶ added in v1.1.0
func (client *GitLabClient) UnlabelPullRequest(ctx context.Context, owner, repository, label string, pullRequestID int) error
UnlabelPullRequest on GitLab
func (*GitLabClient) UpdatePullRequest ¶ added in v1.8.0
func (client *GitLabClient) UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, prId int, state vcsutils.PullRequestState) error
UpdatePullRequest on GitLab
func (*GitLabClient) UpdateWebhook ¶
func (client *GitLabClient) UpdateWebhook(ctx context.Context, owner, repository, branch, payloadURL, token, webhookID string, webhookEvents ...vcsutils.WebhookEvent) error
UpdateWebhook on GitLab
func (*GitLabClient) UploadCodeScanning ¶ added in v1.3.0
func (client *GitLabClient) UploadCodeScanning(_ context.Context, _ string, _ string, _ string, _ string) (string, error)
UploadCodeScanning on GitLab
func (*GitLabClient) UploadCodeScanningWithRef ¶ added in v1.21.0
func (client *GitLabClient) UploadCodeScanningWithRef(_ context.Context, _ string, _ string, _ string, _ string, _ string) (string, error)
UploadCodeScanningWithRef on GitLab
func (*GitLabClient) UploadSnapshotToDependencyGraph ¶ added in v1.20.0
func (client *GitLabClient) UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
type JobInfo ¶ added in v1.20.0
JobInfo contains information about the job that created the snapshot
type LabelInfo ¶ added in v1.1.0
type LabelInfo struct {
Name string
Description string
// Label color is a hexadecimal color code, for example: 4AB548
Color string
}
LabelInfo contains a label information
type ListOptions ¶ added in v1.16.0
type ListOptions struct {
// For paginated result sets, page of results to retrieve.
Page int
// For paginated result sets, the number of results to include per page.
PerPage int
}
ListOptions specifies the optional parameters to various List methods that support offset pagination.
type Manifest ¶ added in v1.20.0
type Manifest struct {
Name string `json:"name"`
File *FileInfo `json:"file"`
Resolved map[string]*ResolvedDependency `json:"resolved"`
}
Manifest represents a manifest file with its dependencies
type Permission ¶ added in v1.1.0
type Permission int
Permission the ssh key permission on the VCS repository
const ( // Read permission Read Permission = iota // ReadWrite is either read and write permission ReadWrite )
type PullRequestComment ¶ added in v1.14.0
type PullRequestComment struct {
CommentInfo
PullRequestDiff
}
PullRequestInfo contains the details of a pull request comment content - the content of the pull request comment PullRequestDiff - the content of the pull request diff
type PullRequestDiff ¶ added in v1.14.0
type PullRequestDiff struct {
OriginalFilePath string
OriginalStartLine int
OriginalEndLine int
OriginalStartColumn int
OriginalEndColumn int
NewFilePath string
NewStartLine int
NewEndLine int
NewStartColumn int
NewEndColumn int
}
PullRequestDiff contains the details of the pull request diff OriginalFilePath - the original file path OriginalStartLine - the original start line number OriginalEndLine - the original end line number originalStartColum - the original start column number OriginalEndColumn - the original end column number NewFilePath - the new file path NewStartLine - the new start line number NewEndLine - the new end line number NewStartColumn - the new start column number NewEndColumn - the new end column number
type PullRequestInfo ¶ added in v1.2.0
type PullRequestInfo struct {
ID int64
Title string
Body string
URL string
Author string
Source BranchInfo
Target BranchInfo
Status string
}
type PullRequestReviewDetails ¶ added in v1.17.0
type RepositoryEnvironmentInfo ¶ added in v1.5.5
RepositoryEnvironmentInfo is the environment details configured for a repository
type RepositoryInfo ¶ added in v1.1.0
type RepositoryInfo struct {
CloneInfo CloneInfo
RepositoryVisibility RepositoryVisibility
}
RepositoryInfo contains general information about the repository.
type RepositoryVisibility ¶ added in v1.5.5
type RepositoryVisibility int
RepositoryVisibility the visibility level of the repository
const ( // Open to public Public RepositoryVisibility = iota // Open to organization Internal // Open to user Private )
type ResolvedDependency ¶ added in v1.20.0
type ResolvedDependency struct {
PackageURL string `json:"package_url"`
Relationship string `json:"relationship"`
Dependencies []string `json:"dependencies,omitempty"`
}
ResolvedDependency represents a resolved dependency with its package URL and dependencies
type SbomSnapshot ¶ added in v1.20.0
type SbomSnapshot struct {
Version int `json:"version"`
Sha string `json:"sha"`
Ref string `json:"ref"`
Job *JobInfo `json:"job"`
Detector *DetectorInfo `json:"detector"`
Scanned time.Time `json:"scanned"`
Manifests map[string]*Manifest `json:"manifests"`
}
SbomSnapshot represents a snapshot for GitHub dependency submission API
type VcsClient ¶
type VcsClient interface {
// TestConnection Returns nil if connection and authorization established successfully
TestConnection(ctx context.Context) error
// ListRepositories Returns a map between all accessible owners to their list of repositories
ListRepositories(ctx context.Context) (map[string][]string, error)
// ListAppRepositories ListRepositories Returns a map between all accessible App to their list of repositories
ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error)
// ListBranches Lists all branches under the input repository
// owner - User or organization
// repository - VCS repository name
ListBranches(ctx context.Context, owner, repository string) ([]string, error)
// CreateWebhook Creates a webhook
// owner - User or organization
// repository - VCS repository name
// branch - VCS branch name
// payloadURL - URL to send the payload when a webhook event occurs
// webhookEvents - The event type
// Return the webhook ID, token and an error, if occurred
CreateWebhook(ctx context.Context, owner, repository, branch, payloadURL string, webhookEvents ...vcsutils.WebhookEvent) (string, string, error)
// UpdateWebhook Updates a webhook
// owner - User or organization
// repository - VCS repository name
// branch - VCS branch name
// payloadURL - URL to send the payload when a webhook event occurs
// token - A token used to validate identity of the incoming webhook
// webhookID - The webhook ID returned from a previous CreateWebhook command
// webhookEvents - The event type
UpdateWebhook(ctx context.Context, owner, repository, branch, payloadURL, token, webhookID string, webhookEvents ...vcsutils.WebhookEvent) error
// DeleteWebhook Deletes a webhook
// owner - User or organization
// repository - VCS repository name
// webhookID - The webhook ID returned from a previous CreateWebhook command
DeleteWebhook(ctx context.Context, owner, repository, webhookID string) error
// SetCommitStatus Sets commit status
// commitStatus - One of Pass, Fail, Error, or InProgress
// owner - User or organization
// repository - VCS repository name
// ref - SHA, a branch name, or a tag name.
// title - Title of the commit status
// description - Description of the commit status
// detailsUrl - The URL for component status link
SetCommitStatus(ctx context.Context, commitStatus CommitStatus, owner, repository, ref, title, description, detailsURL string) error
// GetCommitStatuses Gets all statuses for a specific commit
// owner - User or organization
// repository - VCS repository name
// ref - SHA, a branch name, or a tag name.
GetCommitStatuses(ctx context.Context, owner, repository, ref string) (status []CommitStatusInfo, err error)
// DownloadRepository Downloads and extracts a VCS repository
// owner - User or organization
// repository - VCS repository name
// branch - VCS branch name
// localPath - Local file system path
DownloadRepository(ctx context.Context, owner, repository, branch, localPath string) error
// CreatePullRequest Creates a pull request between 2 different branches in the same repository
// owner - User or organization
// repository - VCS repository name
// sourceBranch - Source branch
// targetBranch - Target branch
// title - Pull request title
// description - Pull request description
CreatePullRequest(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) error
// CreatePullRequestDetailed Creates a pull request between 2 different branches in the same repository
// owner - User or organization
// repository - VCS repository name
// sourceBranch - Source branch
// targetBranch - Target branch
// title - Pull request title
// description - Pull request description
CreatePullRequestDetailed(ctx context.Context, owner, repository, sourceBranch, targetBranch, title, description string) (CreatedPullRequestInfo, error)
// UpdatePullRequest Updates pull requests metadata
// owner - User or organization
// repository - VCS repository name
// title - Pull request title
// body - Pull request body or description
// targetBranchName - Name of the pull request target branch name,For non-change, pass an empty string.
// prId - Pull request ID
// state - Pull request state
UpdatePullRequest(ctx context.Context, owner, repository, title, body, targetBranchName string, prId int, state vcsutils.PullRequestState) error
// AddPullRequestComment Adds a new comment on the requested pull request
// owner - User or organization
// repository - VCS repository name
// content - The new comment content
// pullRequestID - Pull request ID
AddPullRequestComment(ctx context.Context, owner, repository, content string, pullRequestID int) error
// AddPullRequestReviewComments Adds a new review comment on the requested pull request
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
// comment - The new comment details defined in PullRequestComment
AddPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...PullRequestComment) error
// ListPullRequestReviews List all reviews assigned to a pull request.
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
// comment - The new comment details defined in PullRequestComment
ListPullRequestReviews(ctx context.Context, owner, repository string, pullRequestID int) ([]PullRequestReviewDetails, error)
// ListPullRequestReviewComments Gets all pull request review comments
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
ListPullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
// DeletePullRequestReviewComments Gets all comments assigned to a pull request.
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
// commentID - The ID of the comment
DeletePullRequestReviewComments(ctx context.Context, owner, repository string, pullRequestID int, comments ...CommentInfo) error
// ListPullRequestComments Gets all comments assigned to a pull request.
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
ListPullRequestComments(ctx context.Context, owner, repository string, pullRequestID int) ([]CommentInfo, error)
// DeletePullRequestComment deleted a specific comment in a pull request.
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
// commentID - The ID of the comment
DeletePullRequestComment(ctx context.Context, owner, repository string, pullRequestID, commentID int) error
// ListOpenPullRequestsWithBody Gets all open pull requests ids and the pull request body.
// owner - User or organization
// repository - VCS repository name
ListOpenPullRequestsWithBody(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
// ListOpenPullRequests Gets all open pull requests ids.
// owner - User or organization
// repository - VCS repository name
ListOpenPullRequests(ctx context.Context, owner, repository string) ([]PullRequestInfo, error)
// GetPullRequestByID Gets pull request info by ID.
// owner - User or organization
// repository - VCS repository name
// pullRequestId - ID of the pull request
GetPullRequestByID(ctx context.Context, owner, repository string, pullRequestId int) (PullRequestInfo, error)
// GetLatestCommit Gets the most recent commit of a branch
// owner - User or organization
// repository - VCS repository name
// branch - The name of the branch
GetLatestCommit(ctx context.Context, owner, repository, branch string) (CommitInfo, error)
// GetCommits Gets the most recent commit of a branch
// owner - User or organization
// repository - VCS repository name
// branch - The name of the branch
GetCommits(ctx context.Context, owner, repository, branch string) ([]CommitInfo, error)
// GetCommitsWithQueryOptions Gets repository commits considering GitCommitsQueryOptions provided by the user.
// owner - User or organization
// repository - VCS repository name
// listOptions - Optional parameters for the 'ListCommits' method
GetCommitsWithQueryOptions(ctx context.Context, owner, repository string, options GitCommitsQueryOptions) ([]CommitInfo, error)
// ListPullRequestsAssociatedWithCommit Lists pull requests associated with the commit.
// owner - User or organization
// repository - VCS repository name
// commitSHA - commit sha
ListPullRequestsAssociatedWithCommit(ctx context.Context, owner, repository string, commitSHA string) ([]PullRequestInfo, error)
// AddSshKeyToRepository Adds a public ssh key to a repository
// owner - User or organization
// repository - VCS repository name
// keyName - Name of the key
// publicKey - SSH public key
// permission - Access permission of the key: read or readWrite
AddSshKeyToRepository(ctx context.Context, owner, repository, keyName, publicKey string, permission Permission) error
// GetRepositoryInfo Returns information about repository.
// owner - User or organization
// repository - VCS repository name
GetRepositoryInfo(ctx context.Context, owner, repository string) (RepositoryInfo, error)
// GetCommitBySha Gets the commit by its SHA
// owner - User or organization
// repository - VCS repository name
// sha - The commit hash
GetCommitBySha(ctx context.Context, owner, repository, sha string) (CommitInfo, error)
// CreateLabel Creates a label in repository
// owner - User or organization
// repository - VCS repository name
// labelInfo - The label info
CreateLabel(ctx context.Context, owner, repository string, labelInfo LabelInfo) error
// GetLabel Gets a label related to a repository. Returns (nil, nil) if label doesn't exist.
// owner - User or organization
// repository - VCS repository name
// name - Label name
GetLabel(ctx context.Context, owner, repository, name string) (*LabelInfo, error)
// ListPullRequestLabels Gets all labels assigned to a pull request.
// owner - User or organization
// repository - VCS repository name
// pullRequestID - Pull request ID
ListPullRequestLabels(ctx context.Context, owner, repository string, pullRequestID int) ([]string, error)
// UnlabelPullRequest Removes a label from a pull request
// owner - User or organization
// repository - VCS repository name
// name - Label name
// pullRequestID - Pull request ID
UnlabelPullRequest(ctx context.Context, owner, repository, name string, pullRequestID int) error
// UploadCodeScanning Upload Scanning Analysis uploads a scanning analysis file to the relevant git provider
// owner - User or organization
// repository - VCS repository name
// branch - The name of the branch
// scan - Code scanning analysis
UploadCodeScanning(ctx context.Context, owner, repository, branch, scanResults string) (string, error)
// UploadCodeScanningWithRef Upload Scanning Analysis with a specific ref and commit SHA
// owner - User or organization
// repository - VCS repository name
// ref - The ref (e.g., refs/pull/123/head) for which the code scanning is relevant
// commitSHA - The commit SHA
// scanResults - Code scanning analysis
UploadCodeScanningWithRef(ctx context.Context, owner, repository, ref, commitSHA, scanResults string) (string, error)
// DownloadFileFromRepo Downloads a file from path in a repository
// owner - User or organization
// repository - VCS repository name
// branch - The name of the branch
// path - The path to the requested file
DownloadFileFromRepo(ctx context.Context, owner, repository, branch, path string) ([]byte, int, error)
// GetRepositoryEnvironmentInfo Gets the environment info configured for a repository
// owner - User or organization
// repository - VCS repository name
// name - The environment name
GetRepositoryEnvironmentInfo(ctx context.Context, owner, repository, name string) (RepositoryEnvironmentInfo, error)
// GetModifiedFiles returns list of file names modified between two VCS references
// owner - User or organization
// repository - VCS repository name
// refBefore - A VCS reference: commit SHA, branch name, tag name
// refAfter - A VCS reference: commit SHA, branch name, tag name
GetModifiedFiles(ctx context.Context, owner, repository, refBefore, refAfter string) ([]string, error)
// GetPullRequestCommentSizeLimit returns the maximum size of a pull request comment
GetPullRequestCommentSizeLimit() int
// GetPullRequestDetailsSizeLimit returns the maximum size of a pull request details
GetPullRequestDetailsSizeLimit() int
// CreateBranch creates a new branch in the specified repository using the provided source branch as a base.
CreateBranch(ctx context.Context, owner, repository, sourceBranch, newBranch string) error
// AllowWorkflows allows the user to enable or disable workflows for an organization
AllowWorkflows(ctx context.Context, owner string) error
// AddOrganizationSecret adds a secret to the organization
AddOrganizationSecret(ctx context.Context, owner, secretName, secretValue string) error
// CreateOrgVariable creates a variable in the organization
CreateOrgVariable(ctx context.Context, owner, variableName, variableValue string) error
// CommitAndPushFiles commits and pushes files to the specified branch in the repository
CommitAndPushFiles(ctx context.Context, owner, repo, sourceBranch, commitMessage, authorName, authorEmail string, files []FileToCommit) error
// GetRepoCollaborators returns a list of collaborators for the specified repository
GetRepoCollaborators(ctx context.Context, owner, repo, affiliation, permission string) ([]string, error)
// GetRepoTeamsByPermissions returns a list of teams with the proper permissions
GetRepoTeamsByPermissions(ctx context.Context, owner, repo string, permissions []string) ([]int64, error)
// CreateOrUpdateEnvironment creates or updates an environment in the specified repository
CreateOrUpdateEnvironment(ctx context.Context, owner, repo, envName string, teams []int64, users []string) error
// MergePullRequest merges a pull request into the target branch
MergePullRequest(ctx context.Context, owner, repo string, prNumber int, commitMessage string) error
// UploadSnapshotToDependencyGraph uploads a snapshot to the GitHub dependency graph tab
UploadSnapshotToDependencyGraph(ctx context.Context, owner, repo string, snapshot *SbomSnapshot) error
}
VcsClient is a base class of all Vcs clients - GitHub, GitLab, Bitbucket server and cloud clients