Documentation
¶
Index ¶
- func AssertContainsAuthHint(t *testing.T, got, hostname string)
- func AssertGolden(t *testing.T, name, got string)
- func AssertJSONArray(t *testing.T, got string, n int)
- func AssertNoOutput(t *testing.T, buf interface{ ... })
- func BackendPRFactory(opts ...BackendPROption) backend.PullRequest
- func BackendRepoFactory(opts ...BackendRepoOption) backend.Repository
- func BackendUserFactory(opts ...BackendUserOption) backend.User
- func CloudPRFactory(opts ...CloudPROption) map[string]any
- func CloudPagedResponse(values any) map[string]any
- func CloudRepoFactory(opts ...CloudRepoOption) map[string]any
- func NewTestServer(t *testing.T, stubs ...StubResponse) *httptest.Server
- func PRFactory(opts ...PROption) map[string]any
- func PagedResponse(values any) map[string]any
- func RepoFactory(opts ...RepoOption) map[string]any
- type BackendPROption
- type BackendRepoOption
- type BackendUserOption
- type BitbucketCloudServer
- func (b *BitbucketCloudServer) Build() *httptest.Server
- func (b *BitbucketCloudServer) WithCurrentUser(user map[string]any) *BitbucketCloudServer
- func (b *BitbucketCloudServer) WithError(pathSuffix string, status int, message string) *BitbucketCloudServer
- func (b *BitbucketCloudServer) WithPR(workspace, slug string, id int, pr map[string]any) *BitbucketCloudServer
- func (b *BitbucketCloudServer) WithPRList(workspace, slug string, prs []map[string]any) *BitbucketCloudServer
- func (b *BitbucketCloudServer) WithRepo(workspace, slug string, repo map[string]any) *BitbucketCloudServer
- func (b *BitbucketCloudServer) WithRepoList(workspace string, repos []map[string]any) *BitbucketCloudServer
- type BitbucketServer
- func (b *BitbucketServer) Build() *httptest.Server
- func (b *BitbucketServer) WithApplicationProperties(version string) *BitbucketServer
- func (b *BitbucketServer) WithCurrentUser(user map[string]any) *BitbucketServer
- func (b *BitbucketServer) WithError(pathSuffix string, status int, message string) *BitbucketServer
- func (b *BitbucketServer) WithPR(project, slug string, id int, pr map[string]any) *BitbucketServer
- func (b *BitbucketServer) WithPRList(project, slug string, prs []map[string]any) *BitbucketServer
- func (b *BitbucketServer) WithRepo(project, slug string, repo map[string]any) *BitbucketServer
- func (b *BitbucketServer) WithRepoList(repos []map[string]any) *BitbucketServer
- type Call
- type CloudPROption
- type CloudRepoOption
- type FakeBrowserLauncher
- type FakeClient
- func (c *FakeClient) ActivateUser(slug string) error
- func (c *FakeClient) AddAnnotations(project, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
- func (c *FakeClient) AddBranchRule(ns, slug string, input backend.BranchRuleInput) (backend.BranchRule, error)
- func (c *FakeClient) AddCommitComment(ns, slug, hash string, in backend.AddCommitCommentInput) (backend.CommitComment, error)
- func (c *FakeClient) AddDefaultReviewer(ns, slug, userSlug string) error
- func (c *FakeClient) AddDeployKey(ns, slug string, input backend.DeployKeyInput) (backend.DeployKey, error)
- func (c *FakeClient) AddGroupMember(groupName, user string) error
- func (c *FakeClient) AddIssueComment(ns, slug string, id int, body string) (backend.IssueComment, error)
- func (c *FakeClient) AddPRComment(ns, slug string, id int, in backend.AddPRCommentInput) (backend.PRComment, error)
- func (c *FakeClient) AddPipelineKnownHost(ns, slug string, in backend.PipelineKnownHostInput) (backend.PipelineKnownHost, error)
- func (c *FakeClient) AddProjectDefaultReviewer(workspace, projectKey, accountID string) error
- func (c *FakeClient) AddSSHKey(input backend.SSHKeyInput) (backend.SSHKey, error)
- func (c *FakeClient) AddSnippetComment(workspace, snippetID, body string) (backend.SnippetComment, error)
- func (c *FakeClient) ApprovePR(ns, slug string, id int) error
- func (c *FakeClient) AssignIssue(ns, slug string, id int, assignee string) error
- func (c *FakeClient) CherryPickCommit(ns, slug string, in backend.CherryPickInput) (backend.Commit, error)
- func (c *FakeClient) ClearBanner() error
- func (c *FakeClient) CompareRefs(ns, slug, base, head string, limit int) (backend.RefComparison, error)
- func (c *FakeClient) CreateBranch(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
- func (c *FakeClient) CreateBranchProtection(ns, slug string, in backend.CreateBranchProtectionInput) (backend.BranchProtection, error)
- func (c *FakeClient) CreateEnvironment(ns, slug string, in backend.CreateEnvironmentInput) (backend.Environment, error)
- func (c *FakeClient) CreateGroup(name string) (backend.Group, error)
- func (c *FakeClient) CreateIPAllowlist(workspace string, in backend.CreateIPAllowlistInput) (backend.IPAllowlist, error)
- func (c *FakeClient) CreateIssue(ns, slug string, in backend.CreateIssueInput) (backend.Issue, error)
- func (c *FakeClient) CreateIssueVersion(ns, slug, name string) (backend.IssueVersion, error)
- func (c *FakeClient) CreatePAT(userSlug string, in backend.CreatePATInput) (backend.PATWithSecret, error)
- func (c *FakeClient) CreatePR(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
- func (c *FakeClient) CreatePipelineSchedule(ns, slug string, input backend.PipelineScheduleInput) (backend.PipelineSchedule, error)
- func (c *FakeClient) CreateRepo(ns string, in backend.CreateRepoInput) (backend.Repository, error)
- func (c *FakeClient) CreateRepoLabel(ns, slug string, in backend.CreateRepoLabelInput) (backend.RepoLabel, error)
- func (c *FakeClient) CreateReviewerGroup(ns, slug string, in backend.CreateReviewerGroupInput) (backend.ReviewerGroup, error)
- func (c *FakeClient) CreateRunner(workspace string, in backend.CreateRunnerInput) (backend.Runner, error)
- func (c *FakeClient) CreateServerProject(in backend.CreateServerProjectInput) (backend.ServerProject, error)
- func (c *FakeClient) CreateSnippet(workspace string, in backend.CreateSnippetInput) (backend.Snippet, error)
- func (c *FakeClient) CreateTag(ns, slug string, in backend.CreateTagInput) (backend.Tag, error)
- func (c *FakeClient) CreateWebhook(ns, slug string, in backend.CreateWebhookInput) (backend.Webhook, error)
- func (c *FakeClient) CreateWorkspaceProject(ws string, input backend.CreateWorkspaceProjectInput) (backend.WorkspaceProject, error)
- func (c *FakeClient) CreateWorkspaceWebhook(workspace string, in backend.CreateWebhookInput) (backend.Webhook, error)
- func (c *FakeClient) DeactivateUser(slug string) error
- func (c *FakeClient) DeclinePR(ns, slug string, id int) error
- func (c *FakeClient) DefaultReviewers(ns, slug, fromBranch, toBranch string) ([]backend.User, error)
- func (c *FakeClient) DeleteAnnotations(project, slug, hash, key string) error
- func (c *FakeClient) DeleteBranch(ns, slug, branch string) error
- func (c *FakeClient) DeleteBranchProtection(ns, slug string, id int) error
- func (c *FakeClient) DeleteBranchRule(ns, slug string, id int) error
- func (c *FakeClient) DeleteCodeInsightsReport(project, slug, hash, key string) error
- func (c *FakeClient) DeleteCommitComment(ns, slug, hash string, commentID int) error
- func (c *FakeClient) DeleteDeployKey(ns, slug string, id int) error
- func (c *FakeClient) DeleteEnvVariable(ns, slug, envUUID, varUUID string) error
- func (c *FakeClient) DeleteEnvironment(ns, slug, uuid string) error
- func (c *FakeClient) DeleteGroup(name string) error
- func (c *FakeClient) DeleteIPAllowlist(workspace, uuid string) error
- func (c *FakeClient) DeleteIssueAttachment(ns, slug string, id int, filename string) error
- func (c *FakeClient) DeleteIssueComment(ns, slug string, id, commentID int) error
- func (c *FakeClient) DeleteIssueVersion(ns, slug string, id int) error
- func (c *FakeClient) DeleteMergeCheck(project, slug, key string) error
- func (c *FakeClient) DeletePRComment(ns, slug string, id, commentID int) error
- func (c *FakeClient) DeletePipelineCache(ns, slug, uuid string) error
- func (c *FakeClient) DeletePipelineKnownHost(ns, slug, uuid string) error
- func (c *FakeClient) DeletePipelineSchedule(ns, slug, uuid string) error
- func (c *FakeClient) DeletePipelineVariable(ns, slug, key string) error
- func (c *FakeClient) DeleteRepo(ns, slug string) error
- func (c *FakeClient) DeleteRepoDownload(ns, slug, name string) error
- func (c *FakeClient) DeleteRepoLabel(ns, slug string, id int) error
- func (c *FakeClient) DeleteReport(project, slug, hash, key string) error
- func (c *FakeClient) DeleteReviewerGroup(ns, slug string, id int) error
- func (c *FakeClient) DeleteRunner(workspace, runnerUUID string) error
- func (c *FakeClient) DeleteSSHKey(id int) error
- func (c *FakeClient) DeleteServerProject(key string) error
- func (c *FakeClient) DeleteSnippet(workspace, id string) error
- func (c *FakeClient) DeleteSnippetComment(workspace, snippetID string, commentID int) error
- func (c *FakeClient) DeleteTag(ns, slug, name string) error
- func (c *FakeClient) DeleteWebhook(ns, slug, id string) error
- func (c *FakeClient) DeleteWorkspacePipelineVariable(workspace, uuid string) error
- func (c *FakeClient) DeleteWorkspaceProject(ws, key string) error
- func (c *FakeClient) DeleteWorkspaceVariable(ns, key string) error
- func (c *FakeClient) DeleteWorkspaceWebhook(workspace, uuid string) error
- func (c *FakeClient) DisableAutoMerge(ns, slug string, id int) error
- func (c *FakeClient) DisableRepoHook(project, slug, hookKey string) error
- func (c *FakeClient) DownloadPipelineArtifact(ws, slug, pipelineUUID, stepUUID, name string, out io.Writer) error
- func (c *FakeClient) DownloadRepoDownload(ns, slug, name string, out io.Writer) error
- func (c *FakeClient) DryRunMergePR(ns, slug string, prID int, strategy string) (backend.MergeDryRunResult, error)
- func (c *FakeClient) EditCommitComment(ns, slug, hash string, commentID int, body string) (backend.CommitComment, error)
- func (c *FakeClient) EditIssueComment(ns, slug string, id, commentID int, body string) (backend.IssueComment, error)
- func (c *FakeClient) EditPRComment(ns, slug string, id, commentID int, body string) (backend.PRComment, error)
- func (c *FakeClient) EditRepo(ns, slug string, in backend.EditRepoInput) (backend.Repository, error)
- func (c *FakeClient) EnableAutoMerge(ns, slug string, id int, strategy string) error
- func (c *FakeClient) EnableRepoHook(project, slug, hookKey string) error
- func (c *FakeClient) ForkRepo(ns, slug string, in backend.ForkRepoInput) (backend.Repository, error)
- func (c *FakeClient) GetBanner() (backend.BannerConfig, error)
- func (c *FakeClient) GetBranchModel(ws, slug string) (backend.BranchModel, error)
- func (c *FakeClient) GetBranchModelSettings(ws, slug string) (backend.BranchModelSettings, error)
- func (c *FakeClient) GetClusterNodes() ([]backend.ClusterNode, error)
- func (c *FakeClient) GetCodeInsightsReport(project, slug, hash, key string) (backend.CodeInsightsReport, error)
- func (c *FakeClient) GetCommit(ns, slug, hash string) (backend.Commit, error)
- func (c *FakeClient) GetCurrentUser() (backend.User, error)
- func (c *FakeClient) GetDeployment(ns, slug, uuid string) (backend.Deployment, error)
- func (c *FakeClient) GetDiff(ns, slug, from, to string) (string, error)
- func (c *FakeClient) GetDiffStat(ns, slug, from, to string) (backend.DiffStat, error)
- func (c *FakeClient) GetFileContent(ns, slug, ref, path string) ([]byte, error)
- func (c *FakeClient) GetHostInfo() (backend.HostInfo, error)
- func (c *FakeClient) GetIssue(ns, slug string, id int) (backend.Issue, error)
- func (c *FakeClient) GetIssueVersion(ns, slug string, id int) (backend.IssueVersion, error)
- func (c *FakeClient) GetLicense() (backend.AdminLicense, error)
- func (c *FakeClient) GetLoggingConfig() (backend.LoggingConfig, error)
- func (c *FakeClient) GetMailServerConfig() (backend.MailServerConfig, error)
- func (c *FakeClient) GetMergeCheck(project, slug, key string) (backend.MergeCheck, error)
- func (c *FakeClient) GetMilestone(ns, slug string, id int) (backend.Milestone, error)
- func (c *FakeClient) GetMirrorServer(id string) (backend.MirrorServer, error)
- func (c *FakeClient) GetPR(ns, slug string, id int) (backend.PullRequest, error)
- func (c *FakeClient) GetPRActivity(ns, slug string, id int, limit int) ([]backend.PRActivityEvent, error)
- func (c *FakeClient) GetPRDiff(ns, slug string, id int) (string, error)
- func (c *FakeClient) GetPipeline(ns, slug, uuid string) (backend.Pipeline, error)
- func (c *FakeClient) GetPipelineKnownHost(ns, slug, uuid string) (backend.PipelineKnownHost, error)
- func (c *FakeClient) GetPipelineOIDCConfig(workspace string) (backend.PipelineOIDCConfig, error)
- func (c *FakeClient) GetPipelineOIDCKeys(workspace string) (backend.PipelineOIDCKeys, error)
- func (c *FakeClient) GetPipelineSSHKeyPair(ns, slug string) (backend.PipelineSSHKeyPair, error)
- func (c *FakeClient) GetPipelineStepLog(ns, slug, pipelineUUID, stepUUID string) (io.ReadCloser, error)
- func (c *FakeClient) GetPipelineTestReport(ws, slug, pipelineUUID, stepUUID string) (backend.PipelineTestReport, error)
- func (c *FakeClient) GetPipelinesConfig(ws, slug string) (backend.PipelineConfig, error)
- func (c *FakeClient) GetRateLimitConfig() (backend.RateLimitConfig, error)
- func (c *FakeClient) GetRepo(ns, slug string) (backend.Repository, error)
- func (c *FakeClient) GetRepoHook(project, slug, hookKey string) (backend.RepoHook, error)
- func (c *FakeClient) GetRepoHookSettings(project, slug, hookKey string) (json.RawMessage, error)
- func (c *FakeClient) GetRepoPRSettings(ns, slug string) (backend.RepoPRSettings, error)
- func (c *FakeClient) GetReport(project, slug, hash, key string) (backend.CodeInsightsReport, error)
- func (c *FakeClient) GetServerProject(key string) (backend.ServerProject, error)
- func (c *FakeClient) GetSnippet(workspace, id string) (backend.Snippet, error)
- func (c *FakeClient) GetWebhook(ns, slug, id string) (backend.Webhook, error)
- func (c *FakeClient) GetWorkspacePipelineVariable(workspace, uuid string) (backend.PipelineVariable, error)
- func (c *FakeClient) GetWorkspaceProject(ws, key string) (backend.WorkspaceProject, error)
- func (c *FakeClient) GrantProjectPermission(ctx context.Context, project string, subject backend.PermissionSubject, ...) error
- func (c *FakeClient) GrantRepoPermission(ctx context.Context, project, slug string, subject backend.PermissionSubject, ...) error
- func (c *FakeClient) GrantWorkspacePerm(ws, user, permission string) error
- func (c *FakeClient) GrantWorkspaceProjectPerm(workspace, projectKey string, in backend.WorkspaceProjectPermInput) error
- func (c *FakeClient) ListAdminUsers(filter string, limit int) ([]backend.AdminUser, error)
- func (c *FakeClient) ListAnnotations(project, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
- func (c *FakeClient) ListAuditLog(workspace string, opts backend.AuditLogOpts) ([]backend.AuditEvent, error)
- func (c *FakeClient) ListBranchProtections(ns, slug string, limit int) ([]backend.BranchProtection, error)
- func (c *FakeClient) ListBranchRules(ns, slug string) ([]backend.BranchRule, error)
- func (c *FakeClient) ListBranches(ns, slug string, limit int) ([]backend.Branch, error)
- func (c *FakeClient) ListCodeInsightsAnnotations(project, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
- func (c *FakeClient) ListCodeInsightsReports(project, slug, hash string) ([]backend.CodeInsightsReport, error)
- func (c *FakeClient) ListCommitComments(ns, slug, hash string, limit int) ([]backend.CommitComment, error)
- func (c *FakeClient) ListCommitFiles(ns, slug, hash string) ([]backend.DiffStatEntry, error)
- func (c *FakeClient) ListCommitStatuses(ns, slug, hash string) ([]backend.CommitStatus, error)
- func (c *FakeClient) ListCommits(ns, slug, branch string, limit int) ([]backend.Commit, error)
- func (c *FakeClient) ListDefaultReviewers(ns, slug string) ([]backend.DefaultReviewer, error)
- func (c *FakeClient) ListDeployKeys(ns, slug string) ([]backend.DeployKey, error)
- func (c *FakeClient) ListDeployments(ns, slug string, limit int) ([]backend.Deployment, error)
- func (c *FakeClient) ListEnvVariables(ns, slug, envUUID string) ([]backend.EnvVariable, error)
- func (c *FakeClient) ListEnvironments(ns, slug string) ([]backend.Environment, error)
- func (c *FakeClient) ListGroupMembers(groupName string, limit int) ([]backend.GroupMember, error)
- func (c *FakeClient) ListGroups(filter string, limit int) ([]backend.Group, error)
- func (c *FakeClient) ListIPAllowlists(workspace string) ([]backend.IPAllowlist, error)
- func (c *FakeClient) ListIssueActivity(ns, slug string, issueID int, limit int) ([]backend.IssueChange, error)
- func (c *FakeClient) ListIssueAttachments(ns, slug string, id int) ([]backend.IssueAttachment, error)
- func (c *FakeClient) ListIssueComments(ns, slug string, id int) ([]backend.IssueComment, error)
- func (c *FakeClient) ListIssueVersions(ns, slug string, limit int) ([]backend.IssueVersion, error)
- func (c *FakeClient) ListIssues(ns, slug, state string, limit int) ([]backend.Issue, error)
- func (c *FakeClient) ListMilestones(ns, slug string, limit int) ([]backend.Milestone, error)
- func (c *FakeClient) ListMirrorServers(limit int) ([]backend.MirrorServer, error)
- func (c *FakeClient) ListMirroredRepos(mirrorID string, limit int) ([]backend.MirroredRepo, error)
- func (c *FakeClient) ListMyPRs(ns, slug string) ([]backend.MyPREntry, error)
- func (c *FakeClient) ListPATs(userSlug string, limit int) ([]backend.PAT, error)
- func (c *FakeClient) ListPRComments(ns, slug string, id int) ([]backend.PRComment, error)
- func (c *FakeClient) ListPRCommits(ns, slug string, prID int) ([]backend.Commit, error)
- func (c *FakeClient) ListPRFiles(ns, slug string, prID int) ([]backend.DiffStatEntry, error)
- func (c *FakeClient) ListPRParticipants(ns, slug string, prID int) ([]backend.PRParticipant, error)
- func (c *FakeClient) ListPRs(ns, slug, state string, limit int) ([]backend.PullRequest, error)
- func (c *FakeClient) ListPipelineArtifacts(ws, slug, pipelineUUID, stepUUID string, limit int) ([]backend.PipelineArtifact, error)
- func (c *FakeClient) ListPipelineCaches(ns, slug string) ([]backend.PipelineCache, error)
- func (c *FakeClient) ListPipelineKnownHosts(ns, slug string) ([]backend.PipelineKnownHost, error)
- func (c *FakeClient) ListPipelineSchedules(ns, slug string) ([]backend.PipelineSchedule, error)
- func (c *FakeClient) ListPipelineSteps(ns, slug, uuid string) ([]backend.PipelineStep, error)
- func (c *FakeClient) ListPipelineTestCases(ws, slug, pipelineUUID, stepUUID string, filter backend.TestCaseFilter) ([]backend.PipelineTestCase, error)
- func (c *FakeClient) ListPipelineVariables(ns, slug string) ([]backend.PipelineVariable, error)
- func (c *FakeClient) ListPipelines(ns, slug string, limit int) ([]backend.Pipeline, error)
- func (c *FakeClient) ListProjectDefaultReviewers(workspace, projectKey string, limit int) ([]backend.ProjectDefaultReviewer, error)
- func (c *FakeClient) ListProjectPermissions(ctx context.Context, project string) ([]backend.PermissionGrant, error)
- func (c *FakeClient) ListProjects(workspace string, limit int) ([]backend.Project, error)
- func (c *FakeClient) ListRepoDownloads(ns, slug string, limit int) ([]backend.RepoDownload, error)
- func (c *FakeClient) ListRepoForks(ns, slug string, limit int) ([]backend.Repository, error)
- func (c *FakeClient) ListRepoHooks(project, slug string) ([]backend.RepoHook, error)
- func (c *FakeClient) ListRepoLabels(ns, slug string) ([]backend.RepoLabel, error)
- func (c *FakeClient) ListRepoPermissions(ctx context.Context, project, slug string) ([]backend.PermissionGrant, error)
- func (c *FakeClient) ListRepoWatchers(ns, slug string) ([]backend.User, error)
- func (c *FakeClient) ListReports(project, slug, hash string) ([]backend.CodeInsightsReport, error)
- func (c *FakeClient) ListRepos(ns string, limit int) ([]backend.Repository, error)
- func (c *FakeClient) ListReviewerGroups(ns, slug string) ([]backend.ReviewerGroup, error)
- func (c *FakeClient) ListRunners(workspace string) ([]backend.Runner, error)
- func (c *FakeClient) ListSSHKeys() ([]backend.SSHKey, error)
- func (c *FakeClient) ListServerProjects(filter string, limit int) ([]backend.ServerProject, error)
- func (c *FakeClient) ListSnippetComments(workspace, snippetID string, limit int) ([]backend.SnippetComment, error)
- func (c *FakeClient) ListSnippets(workspace string, limit int) ([]backend.Snippet, error)
- func (c *FakeClient) ListTags(ns, slug string, limit int) ([]backend.Tag, error)
- func (c *FakeClient) ListTree(ns, slug, ref, path string) ([]backend.TreeEntry, error)
- func (c *FakeClient) ListWebhooks(ns, slug string) ([]backend.Webhook, error)
- func (c *FakeClient) ListWorkspaceMemberPerms(ws string, limit int) ([]backend.WorkspaceMemberPerm, error)
- func (c *FakeClient) ListWorkspaceMembers(workspace string, limit int) ([]backend.WorkspaceMember, error)
- func (c *FakeClient) ListWorkspacePipelineVariables(workspace string) ([]backend.PipelineVariable, error)
- func (c *FakeClient) ListWorkspaceProjectPerms(workspace, projectKey string, limit int) ([]backend.WorkspaceProjectPerm, error)
- func (c *FakeClient) ListWorkspaceRepoPerms(ws string, limit int) ([]backend.WorkspaceRepoPerm, error)
- func (c *FakeClient) ListWorkspaceVariables(ns string) ([]backend.PipelineVariable, error)
- func (c *FakeClient) ListWorkspaceWebhooks(workspace string) ([]backend.Webhook, error)
- func (c *FakeClient) ListWorkspaces(limit int) ([]backend.Workspace, error)
- func (c *FakeClient) MergePR(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
- func (c *FakeClient) PutCodeInsightsAnnotations(project, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
- func (c *FakeClient) PutCodeInsightsReport(project, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
- func (c *FakeClient) PutFile(ns, slug, path string, in backend.PutFileInput) error
- func (c *FakeClient) ReadyPR(ns, slug string, id int) error
- func (c *FakeClient) RegeneratePipelineSSHKeyPair(ns, slug string, bits int) (backend.PipelineSSHKeyPair, error)
- func (c *FakeClient) RemoveDefaultReviewer(ns, slug, userSlug string) error
- func (c *FakeClient) RemoveGroupMember(groupName, user string) error
- func (c *FakeClient) RemoveProjectDefaultReviewer(workspace, projectKey, accountID string) error
- func (c *FakeClient) RemoveReviewers(ns, slug string, id int, users []string) error
- func (c *FakeClient) RenameRepo(ns, slug, newName string) (backend.Repository, error)
- func (c *FakeClient) RenameUser(slug, newSlug string) error
- func (c *FakeClient) ReopenIssue(ns, slug string, id int) error
- func (c *FakeClient) ReportCommitStatus(ns, slug, hash string, input backend.CommitStatusInput) (backend.CommitStatus, error)
- func (c *FakeClient) RequestReview(ns, slug string, id int, users []string) error
- func (c *FakeClient) RerunPipeline(ns, slug, sourceUUID string) (backend.Pipeline, error)
- func (c *FakeClient) RevokePAT(userSlug, tokenID string) error
- func (c *FakeClient) RevokeProjectPermission(ctx context.Context, project string, subject backend.PermissionSubject) error
- func (c *FakeClient) RevokeRepoPermission(ctx context.Context, project, slug string, subject backend.PermissionSubject) error
- func (c *FakeClient) RevokeWorkspacePerm(ws, user string) error
- func (c *FakeClient) RevokeWorkspaceProjectPerm(workspace, projectKey, subjectSlug string, isGroup bool) error
- func (c *FakeClient) RotateSecrets() error
- func (c *FakeClient) RunPipeline(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
- func (c *FakeClient) SearchCode(workspace, query string, limit int) ([]backend.CodeSearchHit, error)
- func (c *FakeClient) SearchCommits(ns, slug string, opts backend.CommitSearchOpts) ([]backend.Commit, error)
- func (c *FakeClient) SearchWorkspaces(opts backend.WorkspaceSearchOpts) ([]backend.Workspace, error)
- func (c *FakeClient) SetBanner(in backend.BannerConfig) error
- func (c *FakeClient) SetEnvVariable(ns, slug, envUUID string, in backend.EnvVariableInput) (backend.EnvVariable, error)
- func (c *FakeClient) SetLoggingConfig(in backend.LoggingConfigInput) error
- func (c *FakeClient) SetMailServerConfig(in backend.MailServerConfig) error
- func (c *FakeClient) SetMergeCheck(project, slug, key string, in backend.MergeCheckInput) error
- func (c *FakeClient) SetPipelineVariable(ns, slug string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
- func (c *FakeClient) SetRateLimitConfig(in backend.RateLimitConfig) error
- func (c *FakeClient) SetRepoDefaultBranch(ns, slug, branch string) error
- func (c *FakeClient) SetRepoHookSettings(project, slug, hookKey string, cfg json.RawMessage) error
- func (c *FakeClient) SetRepoVisibility(ns, slug string, isPrivate bool) error
- func (c *FakeClient) SetReport(project, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
- func (c *FakeClient) SetWorkspacePipelineVariable(workspace string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
- func (c *FakeClient) SetWorkspaceVariable(ns string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
- func (c *FakeClient) StopPipeline(ws, slug, pipelineUUID string) error
- func (c *FakeClient) SubmitReview(ns, slug string, id int, in backend.SubmitReviewInput) error
- func (c *FakeClient) SyncRepo(ns, slug, branch string) (backend.SyncResult, error)
- func (c *FakeClient) TransferRepo(ns, slug, target string) (backend.Repository, error)
- func (c *FakeClient) TriggerPipeline(ns, slug string, input backend.PipelineTriggerInput) (backend.PipelineTriggerResult, error)
- func (c *FakeClient) UnapprovePR(ns, slug string, id int) error
- func (c *FakeClient) UnreadyPR(ns, slug string, id int) error
- func (c *FakeClient) UnvoteIssue(ns, slug string, id int) error
- func (c *FakeClient) UnwatchIssue(ns, slug string, id int) error
- func (c *FakeClient) UpdateBranchModelSettings(ws, slug string, in backend.BranchModelSettingsInput) (backend.BranchModelSettings, error)
- func (c *FakeClient) UpdateBranchRule(ns, slug string, id int, in backend.UpdateBranchRuleInput) (backend.BranchRule, error)
- func (c *FakeClient) UpdateIssue(ns, slug string, id int, in backend.UpdateIssueInput) (backend.Issue, error)
- func (c *FakeClient) UpdatePR(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
- func (c *FakeClient) UpdatePRBranch(ns, slug string, prID int) error
- func (c *FakeClient) UpdatePRParticipant(ns, slug string, prID int, accountID, state string) (backend.PRParticipant, error)
- func (c *FakeClient) UpdatePipelinesConfig(ws, slug string, in backend.PipelineConfig) (backend.PipelineConfig, error)
- func (c *FakeClient) UpdateRepoLabel(ns, slug string, id int, in backend.UpdateRepoLabelInput) (backend.RepoLabel, error)
- func (c *FakeClient) UpdateRepoPRSettings(ns, slug string, in backend.RepoPRSettingsInput) (backend.RepoPRSettings, error)
- func (c *FakeClient) UpdateServerProject(key string, in backend.UpdateServerProjectInput) (backend.ServerProject, error)
- func (c *FakeClient) UpdateWorkspaceProject(ws, key string, input backend.UpdateWorkspaceProjectInput) (backend.WorkspaceProject, error)
- func (c *FakeClient) UploadRepoDownload(ns, slug, name string, body io.Reader) (backend.RepoDownload, error)
- func (c *FakeClient) VoteIssue(ns, slug string, id int) error
- func (c *FakeClient) WatchIssue(ns, slug string, id int) error
- type FakeEditorLauncher
- type FakeKeyring
- type FakeRunner
- type IOStreams
- type PROption
- type RepoOption
- type RunResponse
- type StubResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContainsAuthHint ¶
AssertContainsAuthHint asserts the output contains an auth login hint for the given hostname.
func AssertGolden ¶
AssertGolden compares got against the contents of testdata/<name>.golden relative to the current test's package. When the BITBOTTLE_UPDATE_GOLDEN environment variable is set to a truthy value, the golden file is written instead of compared.
func AssertJSONArray ¶
AssertJSONArray asserts that got is a valid JSON array of length n.
func AssertNoOutput ¶
AssertNoOutput asserts that a buffer-like value produced no output.
func BackendPRFactory ¶
func BackendPRFactory(opts ...BackendPROption) backend.PullRequest
BackendPRFactory returns a default backend.PullRequest with options applied.
func BackendRepoFactory ¶
func BackendRepoFactory(opts ...BackendRepoOption) backend.Repository
BackendRepoFactory returns a default backend.Repository with options applied.
func BackendUserFactory ¶
func BackendUserFactory(opts ...BackendUserOption) backend.User
BackendUserFactory returns a default backend.User with options applied.
func CloudPRFactory ¶
func CloudPRFactory(opts ...CloudPROption) map[string]any
CloudPRFactory returns a default Bitbucket Cloud pull request object.
func CloudPagedResponse ¶
CloudPagedResponse wraps the given values slice in a Bitbucket Cloud paged envelope.
func CloudRepoFactory ¶
func CloudRepoFactory(opts ...CloudRepoOption) map[string]any
CloudRepoFactory returns a default Bitbucket Cloud repository object.
func NewTestServer ¶
func NewTestServer(t *testing.T, stubs ...StubResponse) *httptest.Server
NewTestServer returns an httptest.NewTLSServer that dispatches requests to the first stub whose Method + PathSuffix match. Unmatched requests fail the test immediately.
func PRFactory ¶
PRFactory returns a default Bitbucket pull request object with optional functional overrides applied in order.
func PagedResponse ¶
PagedResponse wraps the given values slice in a Bitbucket paged envelope.
func RepoFactory ¶
func RepoFactory(opts ...RepoOption) map[string]any
RepoFactory returns a default Bitbucket repository object with optional functional overrides applied in order.
Types ¶
type BackendPROption ¶
type BackendPROption func(*backend.PullRequest)
BackendPROption mutates a backend.PullRequest.
func BackendPRWithFromBranch ¶
func BackendPRWithFromBranch(branch string) BackendPROption
BackendPRWithFromBranch sets FromBranch on a backend.PullRequest.
func BackendPRWithID ¶
func BackendPRWithID(id int) BackendPROption
BackendPRWithID sets the ID on a backend.PullRequest.
func BackendPRWithState ¶
func BackendPRWithState(state string) BackendPROption
BackendPRWithState sets State on a backend.PullRequest.
func BackendPRWithTitle ¶
func BackendPRWithTitle(title string) BackendPROption
BackendPRWithTitle sets Title on a backend.PullRequest.
func BackendPRWithWebURL ¶
func BackendPRWithWebURL(url string) BackendPROption
BackendPRWithWebURL sets the WebURL on a backend.PullRequest.
type BackendRepoOption ¶
type BackendRepoOption func(*backend.Repository)
BackendRepoOption mutates a backend.Repository.
func BackendRepoWithSlug ¶
func BackendRepoWithSlug(slug string) BackendRepoOption
BackendRepoWithSlug sets the slug on a backend.Repository.
func BackendRepoWithWebURL ¶
func BackendRepoWithWebURL(url string) BackendRepoOption
BackendRepoWithWebURL sets the WebURL on a backend.Repository.
type BackendUserOption ¶
BackendUserOption mutates a backend.User.
func BackendUserWithSlug ¶
func BackendUserWithSlug(slug string) BackendUserOption
BackendUserWithSlug sets the slug on a backend.User.
type BitbucketCloudServer ¶
type BitbucketCloudServer struct {
// contains filtered or unexported fields
}
BitbucketCloudServer is a fluent builder around NewTestServer that knows common Bitbucket Cloud API v2.0 endpoints. Cloud paths use /2.0/... prefix.
func NewBitbucketCloudServer ¶
func NewBitbucketCloudServer(t *testing.T) *BitbucketCloudServer
NewBitbucketCloudServer creates a new fluent BitbucketCloudServer builder.
func (*BitbucketCloudServer) Build ¶
func (b *BitbucketCloudServer) Build() *httptest.Server
Build constructs the httptest.Server using the accumulated stubs.
func (*BitbucketCloudServer) WithCurrentUser ¶
func (b *BitbucketCloudServer) WithCurrentUser(user map[string]any) *BitbucketCloudServer
WithCurrentUser stubs GET /user.
func (*BitbucketCloudServer) WithError ¶
func (b *BitbucketCloudServer) WithError(pathSuffix string, status int, message string) *BitbucketCloudServer
WithError stubs an error response in Cloud format for paths ending with pathSuffix.
func (*BitbucketCloudServer) WithPR ¶
func (b *BitbucketCloudServer) WithPR(workspace, slug string, id int, pr map[string]any) *BitbucketCloudServer
WithPR stubs GET /repositories/{workspace}/{slug}/pullrequests/{id}.
func (*BitbucketCloudServer) WithPRList ¶
func (b *BitbucketCloudServer) WithPRList(workspace, slug string, prs []map[string]any) *BitbucketCloudServer
WithPRList stubs GET /repositories/{workspace}/{slug}/pullrequests.
func (*BitbucketCloudServer) WithRepo ¶
func (b *BitbucketCloudServer) WithRepo(workspace, slug string, repo map[string]any) *BitbucketCloudServer
WithRepo stubs GET /repositories/{workspace}/{slug}.
func (*BitbucketCloudServer) WithRepoList ¶
func (b *BitbucketCloudServer) WithRepoList(workspace string, repos []map[string]any) *BitbucketCloudServer
WithRepoList stubs GET /repositories/{workspace} with the provided list.
type BitbucketServer ¶
type BitbucketServer struct {
// contains filtered or unexported fields
}
BitbucketServer is a fluent builder around NewTestServer that knows common Bitbucket Data Center endpoints.
func NewBitbucketServer ¶
func NewBitbucketServer(t *testing.T) *BitbucketServer
NewBitbucketServer creates a new fluent BitbucketServer builder.
func (*BitbucketServer) Build ¶
func (b *BitbucketServer) Build() *httptest.Server
Build constructs the httptest.Server using the accumulated stubs.
func (*BitbucketServer) WithApplicationProperties ¶
func (b *BitbucketServer) WithApplicationProperties(version string) *BitbucketServer
WithApplicationProperties stubs GET /rest/api/1.0/application-properties.
func (*BitbucketServer) WithCurrentUser ¶
func (b *BitbucketServer) WithCurrentUser(user map[string]any) *BitbucketServer
WithCurrentUser stubs the "current user" endpoint used for whoami-style calls.
func (*BitbucketServer) WithError ¶
func (b *BitbucketServer) WithError(pathSuffix string, status int, message string) *BitbucketServer
WithError stubs an error response matching any request whose path ends with pathSuffix.
func (*BitbucketServer) WithPR ¶
func (b *BitbucketServer) WithPR(project, slug string, id int, pr map[string]any) *BitbucketServer
WithPR stubs GET .../pull-requests/{id}.
func (*BitbucketServer) WithPRList ¶
func (b *BitbucketServer) WithPRList(project, slug string, prs []map[string]any) *BitbucketServer
WithPRList stubs GET /rest/api/1.0/projects/{project}/repos/{slug}/pull-requests.
func (*BitbucketServer) WithRepo ¶
func (b *BitbucketServer) WithRepo(project, slug string, repo map[string]any) *BitbucketServer
WithRepo stubs GET /rest/api/1.0/projects/{project}/repos/{slug}.
func (*BitbucketServer) WithRepoList ¶
func (b *BitbucketServer) WithRepoList(repos []map[string]any) *BitbucketServer
WithRepoList stubs GET /rest/api/1.0/repos with the provided list of repos.
type CloudPROption ¶
CloudPROption mutates a Bitbucket Cloud pull request fixture.
func CloudPRWithAuthor ¶
func CloudPRWithAuthor(accountID, displayName string) CloudPROption
CloudPRWithAuthor sets the Cloud PR author account_id and display_name.
func CloudPRWithDraft ¶
func CloudPRWithDraft(draft bool) CloudPROption
CloudPRWithDraft sets the draft flag on a Cloud PR.
func CloudPRWithState ¶
func CloudPRWithState(state string) CloudPROption
CloudPRWithState sets the Cloud PR state.
func CloudPRWithTitle ¶
func CloudPRWithTitle(title string) CloudPROption
CloudPRWithTitle sets the Cloud PR title.
type CloudRepoOption ¶
CloudRepoOption mutates a Bitbucket Cloud repository fixture.
func CloudRepoWithSlug ¶
func CloudRepoWithSlug(workspace, slug string) CloudRepoOption
CloudRepoWithSlug sets the slug, name, and full_name of the cloud repo.
type FakeBrowserLauncher ¶
FakeBrowserLauncher is a test double for a browser.Launcher.
func (*FakeBrowserLauncher) Browse ¶
func (b *FakeBrowserLauncher) Browse(url string) error
Browse records the URL and returns the configured error, if any.
type FakeClient ¶
type FakeClient struct {
T *testing.T
// Repo methods
ListReposFn func(ns string, limit int) ([]backend.Repository, error)
GetRepoFn func(ns, slug string) (backend.Repository, error)
CreateRepoFn func(ns string, in backend.CreateRepoInput) (backend.Repository, error)
DeleteRepoFn func(ns, slug string) error
RenameRepoFn func(ns, slug, newName string) (backend.Repository, error)
ForkRepoFn func(ns, slug string, in backend.ForkRepoInput) (backend.Repository, error)
TransferRepoFn func(ns, slug, target string) (backend.Repository, error)
SetRepoVisibilityFn func(ns, slug string, isPrivate bool) error
SetRepoDefaultBranchFn func(ns, slug, branch string) error
// PR methods
ListPRsFn func(ns, slug, state string, limit int) ([]backend.PullRequest, error)
GetPRFn func(ns, slug string, id int) (backend.PullRequest, error)
CreatePRFn func(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
MergePRFn func(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
EnableAutoMergeFn func(ns, slug string, id int, strategy string) error
DisableAutoMergeFn func(ns, slug string, id int) error
ApprovePRFn func(ns, slug string, id int) error
GetPRDiffFn func(ns, slug string, id int) (string, error)
// Branch / user methods
ListBranchesFn func(ns, slug string, limit int) ([]backend.Branch, error)
DeleteBranchFn func(ns, slug, branch string) error
GetCurrentUserFn func() (backend.User, error)
// Branch create method
CreateBranchFn func(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
// Tag methods
ListTagsFn func(ns, slug string, limit int) ([]backend.Tag, error)
CreateTagFn func(ns, slug string, in backend.CreateTagInput) (backend.Tag, error)
DeleteTagFn func(ns, slug, name string) error
// PR lifecycle methods
UpdatePRFn func(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
DeclinePRFn func(ns, slug string, id int) error
UnapprovePRFn func(ns, slug string, id int) error
ReadyPRFn func(ns, slug string, id int) error
UnreadyPRFn func(ns, slug string, id int) error
RequestReviewFn func(ns, slug string, id int, users []string) error
RemoveReviewersFn func(ns, slug string, id int, users []string) error
SubmitReviewFn func(ns, slug string, id int, in backend.SubmitReviewInput) error
// Pipeline methods (Cloud-only; satisfies backend.PipelineClient when set)
ListPipelinesFn func(ns, slug string, limit int) ([]backend.Pipeline, error)
GetPipelineFn func(ns, slug, uuid string) (backend.Pipeline, error)
RunPipelineFn func(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
StopPipelineFn func(ws, slug, pipelineUUID string) error
RerunPipelineFn func(ns, slug, sourceUUID string) (backend.Pipeline, error)
ListPipelineStepsFn func(ns, slug, uuid string) ([]backend.PipelineStep, error)
GetPipelineStepLogFn func(ns, slug, pipelineUUID, stepUUID string) (io.ReadCloser, error)
ListPipelineVariablesFn func(ns, slug string) ([]backend.PipelineVariable, error)
SetPipelineVariableFn func(ns, slug string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
DeletePipelineVariableFn func(ns, slug, key string) error
// Pipeline artifact methods (Cloud-only; satisfies backend.PipelineArtifactClient when set)
ListPipelineArtifactsFn func(ws, slug, pipelineUUID, stepUUID string, limit int) ([]backend.PipelineArtifact, error)
DownloadPipelineArtifactFn func(ws, slug, pipelineUUID, stepUUID, name string, out io.Writer) error
// Commit methods
ListCommitsFn func(ns, slug, branch string, limit int) ([]backend.Commit, error)
GetCommitFn func(ns, slug, hash string) (backend.Commit, error)
CherryPickCommitFn func(ns, slug string, in backend.CherryPickInput) (backend.Commit, error)
// Commit comment methods
ListCommitCommentsFn func(ns, slug, hash string, limit int) ([]backend.CommitComment, error)
AddCommitCommentFn func(ns, slug, hash string, in backend.AddCommitCommentInput) (backend.CommitComment, error)
EditCommitCommentFn func(ns, slug, hash string, commentID int, body string) (backend.CommitComment, error)
DeleteCommitCommentFn func(ns, slug, hash string, commentID int) error
// PR comment methods
ListPRCommentsFn func(ns, slug string, id int) ([]backend.PRComment, error)
AddPRCommentFn func(ns, slug string, id int, in backend.AddPRCommentInput) (backend.PRComment, error)
EditPRCommentFn func(ns, slug string, id, commentID int, body string) (backend.PRComment, error)
DeletePRCommentFn func(ns, slug string, id, commentID int) error
// PR comment reaction methods (Server-only; satisfies backend.CommentReactor when set)
ListCommentReactionsFn func(ns, slug string, prID, commentID int) ([]backend.CommentReaction, error)
AddCommentReactionFn func(ns, slug string, prID, commentID int, emoji string) error
RemoveCommentReactionFn func(ns, slug string, prID, commentID int, emoji string) error
// PR activity
GetPRActivityFn func(ns, slug string, id int, limit int) ([]backend.PRActivityEvent, error)
// PR merge preview (both backends; satisfies backend.PRMergePreviewClient when set)
DryRunMergePRFn func(ns, slug string, prID int, strategy string) (backend.MergeDryRunResult, error)
// Commit status methods
ListCommitStatusesFn func(ns, slug, hash string) ([]backend.CommitStatus, error)
ReportCommitStatusFn func(ns, slug, hash string, input backend.CommitStatusInput) (backend.CommitStatus, error)
// Webhook methods
ListWebhooksFn func(ns, slug string) ([]backend.Webhook, error)
GetWebhookFn func(ns, slug, id string) (backend.Webhook, error)
CreateWebhookFn func(ns, slug string, in backend.CreateWebhookInput) (backend.Webhook, error)
DeleteWebhookFn func(ns, slug, id string) error
// Workspace methods (Cloud-only; satisfies backend.WorkspaceClient when set)
ListWorkspacesFn func(limit int) ([]backend.Workspace, error)
ListProjectsFn func(workspace string, limit int) ([]backend.Project, error)
// Workspace member methods (Cloud-only; satisfies backend.WorkspaceMemberClient when set)
ListWorkspaceMembersFn func(workspace string, limit int) ([]backend.WorkspaceMember, error)
// Workspace webhook methods (Cloud-only; satisfies backend.WorkspaceWebhookClient when set)
ListWorkspaceWebhooksFn func(workspace string) ([]backend.Webhook, error)
CreateWorkspaceWebhookFn func(workspace string, in backend.CreateWebhookInput) (backend.Webhook, error)
DeleteWorkspaceWebhookFn func(workspace, uuid string) error
// Issue methods (Cloud-only; satisfies backend.IssueClient when set)
ListIssuesFn func(ns, slug, state string, limit int) ([]backend.Issue, error)
GetIssueFn func(ns, slug string, id int) (backend.Issue, error)
CreateIssueFn func(ns, slug string, in backend.CreateIssueInput) (backend.Issue, error)
UpdateIssueFn func(ns, slug string, id int, in backend.UpdateIssueInput) (backend.Issue, error)
ReopenIssueFn func(ns, slug string, id int) error
AssignIssueFn func(ns, slug string, id int, assignee string) error
ListIssueCommentsFn func(ns, slug string, id int) ([]backend.IssueComment, error)
AddIssueCommentFn func(ns, slug string, id int, body string) (backend.IssueComment, error)
EditIssueCommentFn func(ns, slug string, id, commentID int, body string) (backend.IssueComment, error)
DeleteIssueCommentFn func(ns, slug string, id, commentID int) error
// GHP methods
UpdatePRBranchFn func(ns, slug string, prID int) error
ListMyPRsFn func(ns, slug string) ([]backend.MyPREntry, error)
// Default reviewers (Server-only; satisfies backend.DefaultReviewersResolver when set)
DefaultReviewersFn func(ns, slug, fromBranch, toBranch string) ([]backend.User, error)
// Branch protection (Server-only; satisfies backend.BranchProtector when set)
ListBranchProtectionsFn func(ns, slug string, limit int) ([]backend.BranchProtection, error)
CreateBranchProtectionFn func(ns, slug string, in backend.CreateBranchProtectionInput) (backend.BranchProtection, error)
DeleteBranchProtectionFn func(ns, slug string, id int) error
// Code search (Cloud-only; satisfies backend.CodeSearcher when set)
SearchCodeFn func(workspace, query string, limit int) ([]backend.CodeSearchHit, error)
// Commit search (both backends; satisfies backend.CommitSearcher when set)
SearchCommitsFn func(ns, slug string, opts backend.CommitSearchOpts) ([]backend.Commit, error)
// Source primitives (both backends; satisfies backend.SourceReader when set)
GetFileContentFn func(ns, slug, ref, path string) ([]byte, error)
ListTreeFn func(ns, slug, ref, path string) ([]backend.TreeEntry, error)
// Deployment methods (Cloud-only; satisfies backend.DeploymentClient when set)
ListDeploymentsFn func(ns, slug string, limit int) ([]backend.Deployment, error)
GetDeploymentFn func(ns, slug, uuid string) (backend.Deployment, error)
ListEnvironmentsFn func(ns, slug string) ([]backend.Environment, error)
CreateEnvironmentFn func(ns, slug string, in backend.CreateEnvironmentInput) (backend.Environment, error)
DeleteEnvironmentFn func(ns, slug, uuid string) error
ListEnvVariablesFn func(ns, slug, envUUID string) ([]backend.EnvVariable, error)
SetEnvVariableFn func(ns, slug, envUUID string, in backend.EnvVariableInput) (backend.EnvVariable, error)
DeleteEnvVariableFn func(ns, slug, envUUID, varUUID string) error
// Workspace variable methods (Cloud-only; satisfies backend.WorkspaceVariableClient when set)
ListWorkspaceVariablesFn func(ns string) ([]backend.PipelineVariable, error)
SetWorkspaceVariableFn func(ns string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
DeleteWorkspaceVariableFn func(ns, key string) error
// Workspace pipeline variable methods (Cloud-only; satisfies backend.WorkspacePipelineVariableClient when set)
ListWorkspacePipelineVariablesFn func(workspace string) ([]backend.PipelineVariable, error)
GetWorkspacePipelineVariableFn func(workspace, uuid string) (backend.PipelineVariable, error)
SetWorkspacePipelineVariableFn func(workspace string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
DeleteWorkspacePipelineVariableFn func(workspace, uuid string) error
// Permissions methods (Server-only; satisfies backend.PermissionsClient when set)
ListProjectPermissionsFn func(ctx context.Context, project string) ([]backend.PermissionGrant, error)
GrantProjectPermissionFn func(ctx context.Context, project string, subject backend.PermissionSubject, perm string) error
RevokeProjectPermissionFn func(ctx context.Context, project string, subject backend.PermissionSubject) error
ListRepoPermissionsFn func(ctx context.Context, project, slug string) ([]backend.PermissionGrant, error)
GrantRepoPermissionFn func(ctx context.Context, project, slug string, subject backend.PermissionSubject, perm string) error
RevokeRepoPermissionFn func(ctx context.Context, project, slug string, subject backend.PermissionSubject) error
// Admin methods (Server-only; satisfies backend.AdminClient when set)
RotateSecretsFn func() error
GetLoggingConfigFn func() (backend.LoggingConfig, error)
SetLoggingConfigFn func(in backend.LoggingConfigInput) error
// Admin user methods (Server-only)
ListAdminUsersFn func(filter string, limit int) ([]backend.AdminUser, error)
RenameUserFn func(slug, newSlug string) error
ActivateUserFn func(slug string) error
DeactivateUserFn func(slug string) error
// Admin system methods (Server-only)
GetLicenseFn func() (backend.AdminLicense, error)
GetClusterNodesFn func() ([]backend.ClusterNode, error)
// Admin mail server methods (Server-only)
GetMailServerConfigFn func() (backend.MailServerConfig, error)
SetMailServerConfigFn func(in backend.MailServerConfig) error
// Admin banner methods (Server-only)
GetBannerFn func() (backend.BannerConfig, error)
SetBannerFn func(in backend.BannerConfig) error
ClearBannerFn func() error
// Admin rate-limit methods (Server-only)
GetRateLimitConfigFn func() (backend.RateLimitConfig, error)
SetRateLimitConfigFn func(in backend.RateLimitConfig) error
// Source write methods (both backends; satisfies backend.SourceWriter when set)
PutFileFn func(ns, slug, path string, in backend.PutFileInput) error
// RepoHookClient (Server-only; satisfies backend.RepoHookClient when set)
ListRepoHooksFn func(project, slug string) ([]backend.RepoHook, error)
GetRepoHookFn func(project, slug, hookKey string) (backend.RepoHook, error)
EnableRepoHookFn func(project, slug, hookKey string) error
DisableRepoHookFn func(project, slug, hookKey string) error
GetRepoHookSettingsFn func(project, slug, hookKey string) (json.RawMessage, error)
SetRepoHookSettingsFn func(project, slug, hookKey string, cfg json.RawMessage) error
// Code Insights (Server-only; satisfies backend.CodeInsightsClient when set)
ListReportsFn func(project, slug, hash string) ([]backend.CodeInsightsReport, error)
GetReportFn func(project, slug, hash, key string) (backend.CodeInsightsReport, error)
SetReportFn func(project, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
DeleteReportFn func(project, slug, hash, key string) error
ListAnnotationsFn func(project, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
AddAnnotationsFn func(project, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
DeleteAnnotationsFn func(project, slug, hash, key string) error
SetMergeCheckFn func(project, slug, key string, in backend.MergeCheckInput) error
GetMergeCheckFn func(project, slug, key string) (backend.MergeCheck, error)
DeleteMergeCheckFn func(project, slug, key string) error
// Cloud Code Insights (Cloud-only; satisfies backend.CloudCodeInsightsClient when set)
ListCodeInsightsReportsFn func(project, slug, hash string) ([]backend.CodeInsightsReport, error)
GetCodeInsightsReportFn func(project, slug, hash, key string) (backend.CodeInsightsReport, error)
PutCodeInsightsReportFn func(project, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
DeleteCodeInsightsReportFn func(project, slug, hash, key string) error
ListCodeInsightsAnnotationsFn func(project, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
PutCodeInsightsAnnotationsFn func(project, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
// Branch model methods (Cloud-only; satisfies backend.BranchModelClient when set)
GetBranchModelFn func(ws, slug string) (backend.BranchModel, error)
GetBranchModelSettingsFn func(ws, slug string) (backend.BranchModelSettings, error)
UpdateBranchModelSettingsFn func(ws, slug string, in backend.BranchModelSettingsInput) (backend.BranchModelSettings, error)
// Branch rule methods (Cloud-only; satisfies backend.BranchRuleClient when set)
ListBranchRulesFn func(ns, slug string) ([]backend.BranchRule, error)
AddBranchRuleFn func(ns, slug string, input backend.BranchRuleInput) (backend.BranchRule, error)
DeleteBranchRuleFn func(ns, slug string, id int) error
UpdateBranchRuleFn func(ns, slug string, id int, in backend.UpdateBranchRuleInput) (backend.BranchRule, error)
// Deploy key methods (both backends; satisfies backend.DeployKeyClient when set)
ListDeployKeysFn func(ns, slug string) ([]backend.DeployKey, error)
AddDeployKeyFn func(ns, slug string, input backend.DeployKeyInput) (backend.DeployKey, error)
DeleteDeployKeyFn func(ns, slug string, id int) error
// Commit file methods (both backends; satisfies backend.CommitFileClient when set)
ListCommitFilesFn func(ns, slug, hash string) ([]backend.DiffStatEntry, error)
// SSH key methods (Cloud-only; satisfies backend.SSHKeyClient when set)
ListSSHKeysFn func() ([]backend.SSHKey, error)
AddSSHKeyFn func(input backend.SSHKeyInput) (backend.SSHKey, error)
DeleteSSHKeyFn func(id int) error
// Default reviewer CRUD methods (both backends; satisfies backend.DefaultReviewerClient when set)
ListDefaultReviewersFn func(ns, slug string) ([]backend.DefaultReviewer, error)
AddDefaultReviewerFn func(ns, slug, userSlug string) error
RemoveDefaultReviewerFn func(ns, slug, userSlug string) error
// Reviewer group methods (Server-only; satisfies backend.ReviewerGroupClient when set)
ListReviewerGroupsFn func(ns, slug string) ([]backend.ReviewerGroup, error)
CreateReviewerGroupFn func(ns, slug string, in backend.CreateReviewerGroupInput) (backend.ReviewerGroup, error)
DeleteReviewerGroupFn func(ns, slug string, id int) error
// Pipeline trigger methods (Cloud-only; satisfies backend.PipelineTriggerClient when set)
TriggerPipelineFn func(ns, slug string, input backend.PipelineTriggerInput) (backend.PipelineTriggerResult, error)
// Pipeline schedule methods (Cloud-only; satisfies backend.PipelineScheduleClient when set)
ListPipelineSchedulesFn func(ns, slug string) ([]backend.PipelineSchedule, error)
CreatePipelineScheduleFn func(ns, slug string, input backend.PipelineScheduleInput) (backend.PipelineSchedule, error)
DeletePipelineScheduleFn func(ns, slug, uuid string) error
// Pipeline cache methods (Cloud-only; satisfies backend.PipelineCacheClient when set)
ListPipelineCachesFn func(ns, slug string) ([]backend.PipelineCache, error)
DeletePipelineCacheFn func(ns, slug, uuid string) error
// Runner methods (Cloud-only; satisfies backend.RunnerClient when set)
ListRunnersFn func(workspace string) ([]backend.Runner, error)
CreateRunnerFn func(workspace string, in backend.CreateRunnerInput) (backend.Runner, error)
DeleteRunnerFn func(workspace, runnerUUID string) error
// Audit methods (Cloud-only; satisfies backend.AuditClient when set)
ListAuditLogFn func(workspace string, opts backend.AuditLogOpts) ([]backend.AuditEvent, error)
// IPAllowlist methods (Cloud-only; satisfies backend.IPAllowlistClient when set)
ListIPAllowlistsFn func(workspace string) ([]backend.IPAllowlist, error)
CreateIPAllowlistFn func(workspace string, in backend.CreateIPAllowlistInput) (backend.IPAllowlist, error)
DeleteIPAllowlistFn func(workspace, uuid string) error
// Diff methods (both backends; satisfies backend.DiffClient when set)
GetDiffFn func(ns, slug, from, to string) (string, error)
GetDiffStatFn func(ns, slug, from, to string) (backend.DiffStat, error)
// PR commit methods (both backends; satisfies backend.PRCommitClient when set)
ListPRCommitsFn func(ns, slug string, prID int) ([]backend.Commit, error)
// PR file methods (both backends; satisfies backend.PRFileClient when set)
ListPRFilesFn func(ns, slug string, prID int) ([]backend.DiffStatEntry, error)
// PR participant methods (both backends; satisfies backend.PRParticipantClient when set)
ListPRParticipantsFn func(ns, slug string, prID int) ([]backend.PRParticipant, error)
// PR participant update methods (Cloud-only; satisfies backend.PRParticipantUpdater when set)
UpdatePRParticipantFn func(ns, slug string, prID int, accountID, state string) (backend.PRParticipant, error)
// Repo watcher methods (both backends; satisfies backend.RepoWatcherClient when set)
ListRepoWatchersFn func(ns, slug string) ([]backend.User, error)
// Repo forks methods (both backends; satisfies backend.RepoForksLister when set)
ListRepoForksFn func(ns, slug string, limit int) ([]backend.Repository, error)
// Repo sync methods (Cloud-only; satisfies backend.RepoSyncer when set)
SyncRepoFn func(ns, slug, branch string) (backend.SyncResult, error)
// Repo edit methods (both backends; satisfies backend.RepoEditor when set)
EditRepoFn func(ns, slug string, in backend.EditRepoInput) (backend.Repository, error)
// Repo PR settings methods (Server-only; satisfies backend.RepoPRSettingsClient when set)
GetRepoPRSettingsFn func(ns, slug string) (backend.RepoPRSettings, error)
UpdateRepoPRSettingsFn func(ns, slug string, in backend.RepoPRSettingsInput) (backend.RepoPRSettings, error)
// Snippet methods (Cloud-only; satisfies backend.SnippetClient when set)
ListSnippetsFn func(workspace string, limit int) ([]backend.Snippet, error)
GetSnippetFn func(workspace, id string) (backend.Snippet, error)
CreateSnippetFn func(workspace string, in backend.CreateSnippetInput) (backend.Snippet, error)
DeleteSnippetFn func(workspace, id string) error
ListSnippetCommentsFn func(workspace, snippetID string, limit int) ([]backend.SnippetComment, error)
AddSnippetCommentFn func(workspace, snippetID, body string) (backend.SnippetComment, error)
DeleteSnippetCommentFn func(workspace, snippetID string, commentID int) error
// Group methods (Server-only; satisfies backend.GroupClient when set)
ListGroupsFn func(filter string, limit int) ([]backend.Group, error)
CreateGroupFn func(name string) (backend.Group, error)
DeleteGroupFn func(name string) error
// Group member methods (Server-only; satisfies backend.GroupMemberClient when set)
ListGroupMembersFn func(groupName string, limit int) ([]backend.GroupMember, error)
AddGroupMemberFn func(groupName, user string) error
RemoveGroupMemberFn func(groupName, user string) error
// Server project methods (Server-only; satisfies backend.ServerProjectClient when set)
ListServerProjectsFn func(filter string, limit int) ([]backend.ServerProject, error)
GetServerProjectFn func(key string) (backend.ServerProject, error)
CreateServerProjectFn func(in backend.CreateServerProjectInput) (backend.ServerProject, error)
UpdateServerProjectFn func(key string, in backend.UpdateServerProjectInput) (backend.ServerProject, error)
DeleteServerProjectFn func(key string) error
// PAT methods (Server-only; satisfies backend.PATClient when set)
ListPATsFn func(userSlug string, limit int) ([]backend.PAT, error)
CreatePATFn func(userSlug string, in backend.CreatePATInput) (backend.PATWithSecret, error)
RevokePATFn func(userSlug, tokenID string) error
// IssueAttacher methods (Cloud-only; satisfies backend.IssueAttacher when set)
ListIssueAttachmentsFn func(ns, slug string, id int) ([]backend.IssueAttachment, error)
DeleteIssueAttachmentFn func(ns, slug string, id int, filename string) error
// IssueVoter methods (Cloud-only; satisfies backend.IssueVoter when set)
VoteIssueFn func(ns, slug string, id int) error
UnvoteIssueFn func(ns, slug string, id int) error
// IssueWatcher methods (Cloud-only; satisfies backend.IssueWatcher when set)
WatchIssueFn func(ns, slug string, id int) error
UnwatchIssueFn func(ns, slug string, id int) error
// IssueActivityClient methods (Cloud-only; satisfies backend.IssueActivityClient when set)
ListIssueActivityFn func(ns, slug string, issueID int, limit int) ([]backend.IssueChange, error)
// WorkspaceSearcher methods (Cloud-only; satisfies backend.WorkspaceSearcher when set)
SearchWorkspacesFn func(opts backend.WorkspaceSearchOpts) ([]backend.Workspace, error)
// WorkspaceProjectPermsClient methods (Cloud-only; satisfies backend.WorkspaceProjectPermsClient when set)
ListWorkspaceProjectPermsFn func(workspace, projectKey string, limit int) ([]backend.WorkspaceProjectPerm, error)
GrantWorkspaceProjectPermFn func(workspace, projectKey string, in backend.WorkspaceProjectPermInput) error
RevokeWorkspaceProjectPermFn func(workspace, projectKey, subjectSlug string, isGroup bool) error
// WorkspaceProjectDefaultReviewerClient methods (Cloud-only; satisfies backend.WorkspaceProjectDefaultReviewerClient when set)
ListProjectDefaultReviewersFn func(workspace, projectKey string, limit int) ([]backend.ProjectDefaultReviewer, error)
AddProjectDefaultReviewerFn func(workspace, projectKey, accountID string) error
RemoveProjectDefaultReviewerFn func(workspace, projectKey, accountID string) error
// RepoLabelClient methods (both backends; satisfies backend.RepoLabelClient when set)
ListRepoLabelsFn func(ns, slug string) ([]backend.RepoLabel, error)
CreateRepoLabelFn func(ns, slug string, in backend.CreateRepoLabelInput) (backend.RepoLabel, error)
UpdateRepoLabelFn func(ns, slug string, id int, in backend.UpdateRepoLabelInput) (backend.RepoLabel, error)
DeleteRepoLabelFn func(ns, slug string, id int) error
// PipelineConfigClient methods (Cloud-only; satisfies backend.PipelineConfigClient when set)
GetPipelinesConfigFn func(ws, slug string) (backend.PipelineConfig, error)
UpdatePipelinesConfigFn func(ws, slug string, in backend.PipelineConfig) (backend.PipelineConfig, error)
// PipelineTestReportClient methods (Cloud-only)
GetPipelineTestReportFn func(ws, slug, pipelineUUID, stepUUID string) (backend.PipelineTestReport, error)
ListPipelineTestCasesFn func(ws, slug, pipelineUUID, stepUUID string, filter backend.TestCaseFilter) ([]backend.PipelineTestCase, error)
// RefComparer methods (Cloud + Server/DC)
CompareRefsFn func(ns, slug, base, head string, limit int) (backend.RefComparison, error)
// RepoDownloadClient methods (Cloud-only; satisfies backend.RepoDownloadClient when set)
ListRepoDownloadsFn func(ns, slug string, limit int) ([]backend.RepoDownload, error)
UploadRepoDownloadFn func(ns, slug, name string, body io.Reader) (backend.RepoDownload, error)
DownloadRepoDownloadFn func(ns, slug, name string, out io.Writer) error
DeleteRepoDownloadFn func(ns, slug, name string) error
// MilestoneClient methods (Cloud-only; satisfies backend.MilestoneClient when set)
ListMilestonesFn func(ns, slug string, limit int) ([]backend.Milestone, error)
GetMilestoneFn func(ns, slug string, id int) (backend.Milestone, error)
// IssueVersionClient methods (Cloud-only; satisfies backend.IssueVersionClient when set)
ListIssueVersionsFn func(ns, slug string, limit int) ([]backend.IssueVersion, error)
GetIssueVersionFn func(ns, slug string, id int) (backend.IssueVersion, error)
CreateIssueVersionFn func(ns, slug, name string) (backend.IssueVersion, error)
DeleteIssueVersionFn func(ns, slug string, id int) error
// CloudProjectClient methods (Cloud-only; satisfies backend.CloudProjectClient when set)
CreateWorkspaceProjectFn func(ws string, input backend.CreateWorkspaceProjectInput) (backend.WorkspaceProject, error)
GetWorkspaceProjectFn func(ws, key string) (backend.WorkspaceProject, error)
UpdateWorkspaceProjectFn func(ws, key string, input backend.UpdateWorkspaceProjectInput) (backend.WorkspaceProject, error)
DeleteWorkspaceProjectFn func(ws, key string) error
// MirrorClient methods (Server-only; satisfies backend.MirrorClient when set)
ListMirrorServersFn func(limit int) ([]backend.MirrorServer, error)
GetMirrorServerFn func(id string) (backend.MirrorServer, error)
ListMirroredReposFn func(mirrorID string, limit int) ([]backend.MirroredRepo, error)
// WorkspacePermsClient methods (Cloud-only; satisfies backend.WorkspacePermsClient when set)
ListWorkspaceMemberPermsFn func(ws string, limit int) ([]backend.WorkspaceMemberPerm, error)
ListWorkspaceRepoPermsFn func(ws string, limit int) ([]backend.WorkspaceRepoPerm, error)
GrantWorkspacePermFn func(ws, user, permission string) error
RevokeWorkspacePermFn func(ws, user string) error
// PipelineSSHKeyPairClient methods (Cloud-only; satisfies backend.PipelineSSHKeyPairClient when set)
GetPipelineSSHKeyPairFn func(ns, slug string) (backend.PipelineSSHKeyPair, error)
RegeneratePipelineSSHKeyPairFn func(ns, slug string, bits int) (backend.PipelineSSHKeyPair, error)
// PipelineKnownHostsClient methods (Cloud-only; satisfies backend.PipelineKnownHostsClient when set)
ListPipelineKnownHostsFn func(ns, slug string) ([]backend.PipelineKnownHost, error)
GetPipelineKnownHostFn func(ns, slug, uuid string) (backend.PipelineKnownHost, error)
AddPipelineKnownHostFn func(ns, slug string, in backend.PipelineKnownHostInput) (backend.PipelineKnownHost, error)
DeletePipelineKnownHostFn func(ns, slug, uuid string) error
// PipelineOIDCClient methods (Cloud-only; satisfies backend.PipelineOIDCClient when set)
GetPipelineOIDCConfigFn func(workspace string) (backend.PipelineOIDCConfig, error)
GetPipelineOIDCKeysFn func(workspace string) (backend.PipelineOIDCKeys, error)
// HostInfoClient methods (both backends; satisfies backend.HostInfoClient when set)
GetHostInfoFn func() (backend.HostInfo, error)
}
FakeClient is a test double for backend.Client. Set the Fn fields for the methods your test exercises. Unset methods call t.Fatalf so unexpected calls are loud failures.
func (*FakeClient) ActivateUser ¶ added in v1.101.0
func (c *FakeClient) ActivateUser(slug string) error
func (*FakeClient) AddAnnotations ¶ added in v1.23.0
func (c *FakeClient) AddAnnotations(project, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
func (*FakeClient) AddBranchRule ¶ added in v1.53.0
func (c *FakeClient) AddBranchRule(ns, slug string, input backend.BranchRuleInput) (backend.BranchRule, error)
func (*FakeClient) AddCommitComment ¶ added in v1.27.0
func (c *FakeClient) AddCommitComment(ns, slug, hash string, in backend.AddCommitCommentInput) (backend.CommitComment, error)
func (*FakeClient) AddDefaultReviewer ¶ added in v1.50.0
func (c *FakeClient) AddDefaultReviewer(ns, slug, userSlug string) error
func (*FakeClient) AddDeployKey ¶ added in v1.47.0
func (c *FakeClient) AddDeployKey(ns, slug string, input backend.DeployKeyInput) (backend.DeployKey, error)
func (*FakeClient) AddGroupMember ¶ added in v1.95.0
func (c *FakeClient) AddGroupMember(groupName, user string) error
func (*FakeClient) AddIssueComment ¶ added in v1.23.0
func (c *FakeClient) AddIssueComment(ns, slug string, id int, body string) (backend.IssueComment, error)
func (*FakeClient) AddPRComment ¶ added in v1.6.0
func (c *FakeClient) AddPRComment(ns, slug string, id int, in backend.AddPRCommentInput) (backend.PRComment, error)
func (*FakeClient) AddPipelineKnownHost ¶ added in v1.114.0
func (c *FakeClient) AddPipelineKnownHost(ns, slug string, in backend.PipelineKnownHostInput) (backend.PipelineKnownHost, error)
func (*FakeClient) AddProjectDefaultReviewer ¶ added in v1.122.0
func (c *FakeClient) AddProjectDefaultReviewer(workspace, projectKey, accountID string) error
func (*FakeClient) AddSSHKey ¶ added in v1.51.0
func (c *FakeClient) AddSSHKey(input backend.SSHKeyInput) (backend.SSHKey, error)
func (*FakeClient) AddSnippetComment ¶ added in v1.123.0
func (c *FakeClient) AddSnippetComment(workspace, snippetID, body string) (backend.SnippetComment, error)
func (*FakeClient) AssignIssue ¶ added in v1.23.0
func (c *FakeClient) AssignIssue(ns, slug string, id int, assignee string) error
func (*FakeClient) CherryPickCommit ¶ added in v1.108.0
func (c *FakeClient) CherryPickCommit(ns, slug string, in backend.CherryPickInput) (backend.Commit, error)
func (*FakeClient) ClearBanner ¶ added in v1.103.0
func (c *FakeClient) ClearBanner() error
func (*FakeClient) CompareRefs ¶ added in v1.110.0
func (c *FakeClient) CompareRefs(ns, slug, base, head string, limit int) (backend.RefComparison, error)
func (*FakeClient) CreateBranch ¶
func (c *FakeClient) CreateBranch(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
func (*FakeClient) CreateBranchProtection ¶ added in v1.17.0
func (c *FakeClient) CreateBranchProtection(ns, slug string, in backend.CreateBranchProtectionInput) (backend.BranchProtection, error)
func (*FakeClient) CreateEnvironment ¶ added in v1.29.0
func (c *FakeClient) CreateEnvironment(ns, slug string, in backend.CreateEnvironmentInput) (backend.Environment, error)
func (*FakeClient) CreateGroup ¶ added in v1.95.0
func (c *FakeClient) CreateGroup(name string) (backend.Group, error)
func (*FakeClient) CreateIPAllowlist ¶ added in v1.106.0
func (c *FakeClient) CreateIPAllowlist(workspace string, in backend.CreateIPAllowlistInput) (backend.IPAllowlist, error)
func (*FakeClient) CreateIssue ¶ added in v1.17.0
func (c *FakeClient) CreateIssue(ns, slug string, in backend.CreateIssueInput) (backend.Issue, error)
func (*FakeClient) CreateIssueVersion ¶ added in v1.112.0
func (c *FakeClient) CreateIssueVersion(ns, slug, name string) (backend.IssueVersion, error)
func (*FakeClient) CreatePAT ¶ added in v1.99.0
func (c *FakeClient) CreatePAT(userSlug string, in backend.CreatePATInput) (backend.PATWithSecret, error)
func (*FakeClient) CreatePR ¶
func (c *FakeClient) CreatePR(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
func (*FakeClient) CreatePipelineSchedule ¶ added in v1.54.0
func (c *FakeClient) CreatePipelineSchedule(ns, slug string, input backend.PipelineScheduleInput) (backend.PipelineSchedule, error)
func (*FakeClient) CreateRepo ¶
func (c *FakeClient) CreateRepo(ns string, in backend.CreateRepoInput) (backend.Repository, error)
func (*FakeClient) CreateRepoLabel ¶ added in v1.100.0
func (c *FakeClient) CreateRepoLabel(ns, slug string, in backend.CreateRepoLabelInput) (backend.RepoLabel, error)
func (*FakeClient) CreateReviewerGroup ¶ added in v1.69.0
func (c *FakeClient) CreateReviewerGroup(ns, slug string, in backend.CreateReviewerGroupInput) (backend.ReviewerGroup, error)
func (*FakeClient) CreateRunner ¶ added in v1.104.0
func (c *FakeClient) CreateRunner(workspace string, in backend.CreateRunnerInput) (backend.Runner, error)
func (*FakeClient) CreateServerProject ¶ added in v1.98.0
func (c *FakeClient) CreateServerProject(in backend.CreateServerProjectInput) (backend.ServerProject, error)
func (*FakeClient) CreateSnippet ¶ added in v1.91.0
func (c *FakeClient) CreateSnippet(workspace string, in backend.CreateSnippetInput) (backend.Snippet, error)
func (*FakeClient) CreateTag ¶
func (c *FakeClient) CreateTag(ns, slug string, in backend.CreateTagInput) (backend.Tag, error)
func (*FakeClient) CreateWebhook ¶ added in v1.15.0
func (c *FakeClient) CreateWebhook(ns, slug string, in backend.CreateWebhookInput) (backend.Webhook, error)
func (*FakeClient) CreateWorkspaceProject ¶ added in v1.112.0
func (c *FakeClient) CreateWorkspaceProject(ws string, input backend.CreateWorkspaceProjectInput) (backend.WorkspaceProject, error)
func (*FakeClient) CreateWorkspaceWebhook ¶ added in v1.66.0
func (c *FakeClient) CreateWorkspaceWebhook(workspace string, in backend.CreateWebhookInput) (backend.Webhook, error)
func (*FakeClient) DeactivateUser ¶ added in v1.101.0
func (c *FakeClient) DeactivateUser(slug string) error
func (*FakeClient) DefaultReviewers ¶ added in v1.17.0
func (c *FakeClient) DefaultReviewers(ns, slug, fromBranch, toBranch string) ([]backend.User, error)
DefaultReviewers defaults to "no defaults configured" (nil, nil) when the Fn is unset — unlike most FakeClient methods which Fatalf on unset Fn. Rationale: default-reviewers is a passive lookup automatically triggered by `pr create`, not an action a test deliberately exercises. Most pr-create tests don't care about reviewers and shouldn't be forced to set a stub just to silence the auto-fetch path. Tests that DO assert on the lookup (see create_default_reviewers_test.go) wire DefaultReviewersFn explicitly.
func (*FakeClient) DeleteAnnotations ¶ added in v1.23.0
func (c *FakeClient) DeleteAnnotations(project, slug, hash, key string) error
func (*FakeClient) DeleteBranch ¶
func (c *FakeClient) DeleteBranch(ns, slug, branch string) error
func (*FakeClient) DeleteBranchProtection ¶ added in v1.17.0
func (c *FakeClient) DeleteBranchProtection(ns, slug string, id int) error
func (*FakeClient) DeleteBranchRule ¶ added in v1.53.0
func (c *FakeClient) DeleteBranchRule(ns, slug string, id int) error
func (*FakeClient) DeleteCodeInsightsReport ¶ added in v1.130.0
func (c *FakeClient) DeleteCodeInsightsReport(project, slug, hash, key string) error
func (*FakeClient) DeleteCommitComment ¶ added in v1.27.0
func (c *FakeClient) DeleteCommitComment(ns, slug, hash string, commentID int) error
func (*FakeClient) DeleteDeployKey ¶ added in v1.47.0
func (c *FakeClient) DeleteDeployKey(ns, slug string, id int) error
func (*FakeClient) DeleteEnvVariable ¶ added in v1.29.0
func (c *FakeClient) DeleteEnvVariable(ns, slug, envUUID, varUUID string) error
func (*FakeClient) DeleteEnvironment ¶ added in v1.29.0
func (c *FakeClient) DeleteEnvironment(ns, slug, uuid string) error
func (*FakeClient) DeleteGroup ¶ added in v1.95.0
func (c *FakeClient) DeleteGroup(name string) error
func (*FakeClient) DeleteIPAllowlist ¶ added in v1.106.0
func (c *FakeClient) DeleteIPAllowlist(workspace, uuid string) error
func (*FakeClient) DeleteIssueAttachment ¶ added in v1.100.0
func (c *FakeClient) DeleteIssueAttachment(ns, slug string, id int, filename string) error
func (*FakeClient) DeleteIssueComment ¶ added in v1.23.0
func (c *FakeClient) DeleteIssueComment(ns, slug string, id, commentID int) error
func (*FakeClient) DeleteIssueVersion ¶ added in v1.112.0
func (c *FakeClient) DeleteIssueVersion(ns, slug string, id int) error
func (*FakeClient) DeleteMergeCheck ¶ added in v1.23.0
func (c *FakeClient) DeleteMergeCheck(project, slug, key string) error
func (*FakeClient) DeletePRComment ¶ added in v1.24.0
func (c *FakeClient) DeletePRComment(ns, slug string, id, commentID int) error
func (*FakeClient) DeletePipelineCache ¶ added in v1.67.0
func (c *FakeClient) DeletePipelineCache(ns, slug, uuid string) error
func (*FakeClient) DeletePipelineKnownHost ¶ added in v1.114.0
func (c *FakeClient) DeletePipelineKnownHost(ns, slug, uuid string) error
func (*FakeClient) DeletePipelineSchedule ¶ added in v1.54.0
func (c *FakeClient) DeletePipelineSchedule(ns, slug, uuid string) error
func (*FakeClient) DeletePipelineVariable ¶ added in v1.15.0
func (c *FakeClient) DeletePipelineVariable(ns, slug, key string) error
func (*FakeClient) DeleteRepo ¶
func (c *FakeClient) DeleteRepo(ns, slug string) error
func (*FakeClient) DeleteRepoDownload ¶ added in v1.111.0
func (c *FakeClient) DeleteRepoDownload(ns, slug, name string) error
func (*FakeClient) DeleteRepoLabel ¶ added in v1.100.0
func (c *FakeClient) DeleteRepoLabel(ns, slug string, id int) error
func (*FakeClient) DeleteReport ¶ added in v1.23.0
func (c *FakeClient) DeleteReport(project, slug, hash, key string) error
func (*FakeClient) DeleteReviewerGroup ¶ added in v1.69.0
func (c *FakeClient) DeleteReviewerGroup(ns, slug string, id int) error
func (*FakeClient) DeleteRunner ¶ added in v1.104.0
func (c *FakeClient) DeleteRunner(workspace, runnerUUID string) error
func (*FakeClient) DeleteSSHKey ¶ added in v1.51.0
func (c *FakeClient) DeleteSSHKey(id int) error
func (*FakeClient) DeleteServerProject ¶ added in v1.98.0
func (c *FakeClient) DeleteServerProject(key string) error
func (*FakeClient) DeleteSnippet ¶ added in v1.91.0
func (c *FakeClient) DeleteSnippet(workspace, id string) error
func (*FakeClient) DeleteSnippetComment ¶ added in v1.123.0
func (c *FakeClient) DeleteSnippetComment(workspace, snippetID string, commentID int) error
func (*FakeClient) DeleteTag ¶
func (c *FakeClient) DeleteTag(ns, slug, name string) error
func (*FakeClient) DeleteWebhook ¶ added in v1.15.0
func (c *FakeClient) DeleteWebhook(ns, slug, id string) error
func (*FakeClient) DeleteWorkspacePipelineVariable ¶ added in v1.115.0
func (c *FakeClient) DeleteWorkspacePipelineVariable(workspace, uuid string) error
func (*FakeClient) DeleteWorkspaceProject ¶ added in v1.112.0
func (c *FakeClient) DeleteWorkspaceProject(ws, key string) error
func (*FakeClient) DeleteWorkspaceVariable ¶ added in v1.31.0
func (c *FakeClient) DeleteWorkspaceVariable(ns, key string) error
func (*FakeClient) DeleteWorkspaceWebhook ¶ added in v1.66.0
func (c *FakeClient) DeleteWorkspaceWebhook(workspace, uuid string) error
func (*FakeClient) DisableAutoMerge ¶ added in v1.30.0
func (c *FakeClient) DisableAutoMerge(ns, slug string, id int) error
func (*FakeClient) DisableRepoHook ¶ added in v1.129.0
func (c *FakeClient) DisableRepoHook(project, slug, hookKey string) error
func (*FakeClient) DownloadPipelineArtifact ¶ added in v1.93.0
func (c *FakeClient) DownloadPipelineArtifact(ws, slug, pipelineUUID, stepUUID, name string, out io.Writer) error
func (*FakeClient) DownloadRepoDownload ¶ added in v1.111.0
func (c *FakeClient) DownloadRepoDownload(ns, slug, name string, out io.Writer) error
func (*FakeClient) DryRunMergePR ¶ added in v1.124.0
func (c *FakeClient) DryRunMergePR(ns, slug string, prID int, strategy string) (backend.MergeDryRunResult, error)
func (*FakeClient) EditCommitComment ¶ added in v1.27.0
func (c *FakeClient) EditCommitComment(ns, slug, hash string, commentID int, body string) (backend.CommitComment, error)
func (*FakeClient) EditIssueComment ¶ added in v1.23.0
func (c *FakeClient) EditIssueComment(ns, slug string, id, commentID int, body string) (backend.IssueComment, error)
func (*FakeClient) EditPRComment ¶ added in v1.24.0
func (*FakeClient) EditRepo ¶ added in v1.89.0
func (c *FakeClient) EditRepo(ns, slug string, in backend.EditRepoInput) (backend.Repository, error)
func (*FakeClient) EnableAutoMerge ¶ added in v1.30.0
func (c *FakeClient) EnableAutoMerge(ns, slug string, id int, strategy string) error
func (*FakeClient) EnableRepoHook ¶ added in v1.129.0
func (c *FakeClient) EnableRepoHook(project, slug, hookKey string) error
func (*FakeClient) ForkRepo ¶ added in v1.16.0
func (c *FakeClient) ForkRepo(ns, slug string, in backend.ForkRepoInput) (backend.Repository, error)
func (*FakeClient) GetBanner ¶ added in v1.103.0
func (c *FakeClient) GetBanner() (backend.BannerConfig, error)
func (*FakeClient) GetBranchModel ¶ added in v1.92.0
func (c *FakeClient) GetBranchModel(ws, slug string) (backend.BranchModel, error)
func (*FakeClient) GetBranchModelSettings ¶ added in v1.92.0
func (c *FakeClient) GetBranchModelSettings(ws, slug string) (backend.BranchModelSettings, error)
func (*FakeClient) GetClusterNodes ¶ added in v1.101.0
func (c *FakeClient) GetClusterNodes() ([]backend.ClusterNode, error)
func (*FakeClient) GetCodeInsightsReport ¶ added in v1.130.0
func (c *FakeClient) GetCodeInsightsReport(project, slug, hash, key string) (backend.CodeInsightsReport, error)
func (*FakeClient) GetCommit ¶
func (c *FakeClient) GetCommit(ns, slug, hash string) (backend.Commit, error)
func (*FakeClient) GetCurrentUser ¶
func (c *FakeClient) GetCurrentUser() (backend.User, error)
func (*FakeClient) GetDeployment ¶ added in v1.29.0
func (c *FakeClient) GetDeployment(ns, slug, uuid string) (backend.Deployment, error)
func (*FakeClient) GetDiff ¶ added in v1.49.0
func (c *FakeClient) GetDiff(ns, slug, from, to string) (string, error)
func (*FakeClient) GetDiffStat ¶ added in v1.49.0
func (c *FakeClient) GetDiffStat(ns, slug, from, to string) (backend.DiffStat, error)
func (*FakeClient) GetFileContent ¶ added in v1.22.0
func (c *FakeClient) GetFileContent(ns, slug, ref, path string) ([]byte, error)
func (*FakeClient) GetHostInfo ¶ added in v1.126.0
func (c *FakeClient) GetHostInfo() (backend.HostInfo, error)
func (*FakeClient) GetIssueVersion ¶ added in v1.112.0
func (c *FakeClient) GetIssueVersion(ns, slug string, id int) (backend.IssueVersion, error)
func (*FakeClient) GetLicense ¶ added in v1.101.0
func (c *FakeClient) GetLicense() (backend.AdminLicense, error)
func (*FakeClient) GetLoggingConfig ¶ added in v1.38.0
func (c *FakeClient) GetLoggingConfig() (backend.LoggingConfig, error)
func (*FakeClient) GetMailServerConfig ¶ added in v1.102.0
func (c *FakeClient) GetMailServerConfig() (backend.MailServerConfig, error)
func (*FakeClient) GetMergeCheck ¶ added in v1.23.0
func (c *FakeClient) GetMergeCheck(project, slug, key string) (backend.MergeCheck, error)
func (*FakeClient) GetMilestone ¶ added in v1.111.0
func (*FakeClient) GetMirrorServer ¶ added in v1.113.0
func (c *FakeClient) GetMirrorServer(id string) (backend.MirrorServer, error)
func (*FakeClient) GetPR ¶
func (c *FakeClient) GetPR(ns, slug string, id int) (backend.PullRequest, error)
func (*FakeClient) GetPRActivity ¶ added in v1.26.0
func (c *FakeClient) GetPRActivity(ns, slug string, id int, limit int) ([]backend.PRActivityEvent, error)
func (*FakeClient) GetPRDiff ¶
func (c *FakeClient) GetPRDiff(ns, slug string, id int) (string, error)
func (*FakeClient) GetPipeline ¶
func (c *FakeClient) GetPipeline(ns, slug, uuid string) (backend.Pipeline, error)
func (*FakeClient) GetPipelineKnownHost ¶ added in v1.114.0
func (c *FakeClient) GetPipelineKnownHost(ns, slug, uuid string) (backend.PipelineKnownHost, error)
func (*FakeClient) GetPipelineOIDCConfig ¶ added in v1.125.0
func (c *FakeClient) GetPipelineOIDCConfig(workspace string) (backend.PipelineOIDCConfig, error)
func (*FakeClient) GetPipelineOIDCKeys ¶ added in v1.125.0
func (c *FakeClient) GetPipelineOIDCKeys(workspace string) (backend.PipelineOIDCKeys, error)
func (*FakeClient) GetPipelineSSHKeyPair ¶ added in v1.114.0
func (c *FakeClient) GetPipelineSSHKeyPair(ns, slug string) (backend.PipelineSSHKeyPair, error)
func (*FakeClient) GetPipelineStepLog ¶ added in v1.15.0
func (c *FakeClient) GetPipelineStepLog(ns, slug, pipelineUUID, stepUUID string) (io.ReadCloser, error)
func (*FakeClient) GetPipelineTestReport ¶ added in v1.110.0
func (c *FakeClient) GetPipelineTestReport(ws, slug, pipelineUUID, stepUUID string) (backend.PipelineTestReport, error)
func (*FakeClient) GetPipelinesConfig ¶ added in v1.109.0
func (c *FakeClient) GetPipelinesConfig(ws, slug string) (backend.PipelineConfig, error)
func (*FakeClient) GetRateLimitConfig ¶ added in v1.134.0
func (c *FakeClient) GetRateLimitConfig() (backend.RateLimitConfig, error)
func (*FakeClient) GetRepo ¶
func (c *FakeClient) GetRepo(ns, slug string) (backend.Repository, error)
func (*FakeClient) GetRepoHook ¶ added in v1.129.0
func (c *FakeClient) GetRepoHook(project, slug, hookKey string) (backend.RepoHook, error)
func (*FakeClient) GetRepoHookSettings ¶ added in v1.129.0
func (c *FakeClient) GetRepoHookSettings(project, slug, hookKey string) (json.RawMessage, error)
func (*FakeClient) GetRepoPRSettings ¶ added in v1.94.0
func (c *FakeClient) GetRepoPRSettings(ns, slug string) (backend.RepoPRSettings, error)
func (*FakeClient) GetReport ¶ added in v1.23.0
func (c *FakeClient) GetReport(project, slug, hash, key string) (backend.CodeInsightsReport, error)
func (*FakeClient) GetServerProject ¶ added in v1.98.0
func (c *FakeClient) GetServerProject(key string) (backend.ServerProject, error)
func (*FakeClient) GetSnippet ¶ added in v1.91.0
func (c *FakeClient) GetSnippet(workspace, id string) (backend.Snippet, error)
func (*FakeClient) GetWebhook ¶ added in v1.15.0
func (c *FakeClient) GetWebhook(ns, slug, id string) (backend.Webhook, error)
func (*FakeClient) GetWorkspacePipelineVariable ¶ added in v1.115.0
func (c *FakeClient) GetWorkspacePipelineVariable(workspace, uuid string) (backend.PipelineVariable, error)
func (*FakeClient) GetWorkspaceProject ¶ added in v1.112.0
func (c *FakeClient) GetWorkspaceProject(ws, key string) (backend.WorkspaceProject, error)
func (*FakeClient) GrantProjectPermission ¶ added in v1.37.0
func (c *FakeClient) GrantProjectPermission(ctx context.Context, project string, subject backend.PermissionSubject, perm string) error
func (*FakeClient) GrantRepoPermission ¶ added in v1.37.0
func (c *FakeClient) GrantRepoPermission(ctx context.Context, project, slug string, subject backend.PermissionSubject, perm string) error
func (*FakeClient) GrantWorkspacePerm ¶ added in v1.113.0
func (c *FakeClient) GrantWorkspacePerm(ws, user, permission string) error
func (*FakeClient) GrantWorkspaceProjectPerm ¶ added in v1.120.0
func (c *FakeClient) GrantWorkspaceProjectPerm(workspace, projectKey string, in backend.WorkspaceProjectPermInput) error
func (*FakeClient) ListAdminUsers ¶ added in v1.101.0
func (*FakeClient) ListAnnotations ¶ added in v1.23.0
func (c *FakeClient) ListAnnotations(project, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
func (*FakeClient) ListAuditLog ¶ added in v1.105.0
func (c *FakeClient) ListAuditLog(workspace string, opts backend.AuditLogOpts) ([]backend.AuditEvent, error)
func (*FakeClient) ListBranchProtections ¶ added in v1.17.0
func (c *FakeClient) ListBranchProtections(ns, slug string, limit int) ([]backend.BranchProtection, error)
func (*FakeClient) ListBranchRules ¶ added in v1.53.0
func (c *FakeClient) ListBranchRules(ns, slug string) ([]backend.BranchRule, error)
func (*FakeClient) ListBranches ¶
func (*FakeClient) ListCodeInsightsAnnotations ¶ added in v1.130.0
func (c *FakeClient) ListCodeInsightsAnnotations(project, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
func (*FakeClient) ListCodeInsightsReports ¶ added in v1.130.0
func (c *FakeClient) ListCodeInsightsReports(project, slug, hash string) ([]backend.CodeInsightsReport, error)
func (*FakeClient) ListCommitComments ¶ added in v1.27.0
func (c *FakeClient) ListCommitComments(ns, slug, hash string, limit int) ([]backend.CommitComment, error)
func (*FakeClient) ListCommitFiles ¶ added in v1.55.0
func (c *FakeClient) ListCommitFiles(ns, slug, hash string) ([]backend.DiffStatEntry, error)
func (*FakeClient) ListCommitStatuses ¶ added in v1.6.0
func (c *FakeClient) ListCommitStatuses(ns, slug, hash string) ([]backend.CommitStatus, error)
func (*FakeClient) ListCommits ¶
func (*FakeClient) ListDefaultReviewers ¶ added in v1.50.0
func (c *FakeClient) ListDefaultReviewers(ns, slug string) ([]backend.DefaultReviewer, error)
func (*FakeClient) ListDeployKeys ¶ added in v1.47.0
func (c *FakeClient) ListDeployKeys(ns, slug string) ([]backend.DeployKey, error)
func (*FakeClient) ListDeployments ¶ added in v1.29.0
func (c *FakeClient) ListDeployments(ns, slug string, limit int) ([]backend.Deployment, error)
func (*FakeClient) ListEnvVariables ¶ added in v1.29.0
func (c *FakeClient) ListEnvVariables(ns, slug, envUUID string) ([]backend.EnvVariable, error)
func (*FakeClient) ListEnvironments ¶ added in v1.29.0
func (c *FakeClient) ListEnvironments(ns, slug string) ([]backend.Environment, error)
func (*FakeClient) ListGroupMembers ¶ added in v1.95.0
func (c *FakeClient) ListGroupMembers(groupName string, limit int) ([]backend.GroupMember, error)
func (*FakeClient) ListGroups ¶ added in v1.95.0
func (*FakeClient) ListIPAllowlists ¶ added in v1.106.0
func (c *FakeClient) ListIPAllowlists(workspace string) ([]backend.IPAllowlist, error)
func (*FakeClient) ListIssueActivity ¶ added in v1.118.0
func (c *FakeClient) ListIssueActivity(ns, slug string, issueID int, limit int) ([]backend.IssueChange, error)
func (*FakeClient) ListIssueAttachments ¶ added in v1.100.0
func (c *FakeClient) ListIssueAttachments(ns, slug string, id int) ([]backend.IssueAttachment, error)
func (*FakeClient) ListIssueComments ¶ added in v1.23.0
func (c *FakeClient) ListIssueComments(ns, slug string, id int) ([]backend.IssueComment, error)
func (*FakeClient) ListIssueVersions ¶ added in v1.112.0
func (c *FakeClient) ListIssueVersions(ns, slug string, limit int) ([]backend.IssueVersion, error)
func (*FakeClient) ListIssues ¶ added in v1.17.0
func (*FakeClient) ListMilestones ¶ added in v1.111.0
func (*FakeClient) ListMirrorServers ¶ added in v1.113.0
func (c *FakeClient) ListMirrorServers(limit int) ([]backend.MirrorServer, error)
func (*FakeClient) ListMirroredRepos ¶ added in v1.113.0
func (c *FakeClient) ListMirroredRepos(mirrorID string, limit int) ([]backend.MirroredRepo, error)
func (*FakeClient) ListMyPRs ¶ added in v1.28.0
func (c *FakeClient) ListMyPRs(ns, slug string) ([]backend.MyPREntry, error)
func (*FakeClient) ListPRComments ¶ added in v1.6.0
func (*FakeClient) ListPRCommits ¶ added in v1.56.0
func (*FakeClient) ListPRFiles ¶ added in v1.57.0
func (c *FakeClient) ListPRFiles(ns, slug string, prID int) ([]backend.DiffStatEntry, error)
func (*FakeClient) ListPRParticipants ¶ added in v1.60.0
func (c *FakeClient) ListPRParticipants(ns, slug string, prID int) ([]backend.PRParticipant, error)
func (*FakeClient) ListPRs ¶
func (c *FakeClient) ListPRs(ns, slug, state string, limit int) ([]backend.PullRequest, error)
func (*FakeClient) ListPipelineArtifacts ¶ added in v1.93.0
func (c *FakeClient) ListPipelineArtifacts(ws, slug, pipelineUUID, stepUUID string, limit int) ([]backend.PipelineArtifact, error)
func (*FakeClient) ListPipelineCaches ¶ added in v1.67.0
func (c *FakeClient) ListPipelineCaches(ns, slug string) ([]backend.PipelineCache, error)
func (*FakeClient) ListPipelineKnownHosts ¶ added in v1.114.0
func (c *FakeClient) ListPipelineKnownHosts(ns, slug string) ([]backend.PipelineKnownHost, error)
func (*FakeClient) ListPipelineSchedules ¶ added in v1.54.0
func (c *FakeClient) ListPipelineSchedules(ns, slug string) ([]backend.PipelineSchedule, error)
func (*FakeClient) ListPipelineSteps ¶ added in v1.15.0
func (c *FakeClient) ListPipelineSteps(ns, slug, uuid string) ([]backend.PipelineStep, error)
func (*FakeClient) ListPipelineTestCases ¶ added in v1.110.0
func (c *FakeClient) ListPipelineTestCases(ws, slug, pipelineUUID, stepUUID string, filter backend.TestCaseFilter) ([]backend.PipelineTestCase, error)
func (*FakeClient) ListPipelineVariables ¶ added in v1.15.0
func (c *FakeClient) ListPipelineVariables(ns, slug string) ([]backend.PipelineVariable, error)
func (*FakeClient) ListPipelines ¶
func (*FakeClient) ListProjectDefaultReviewers ¶ added in v1.122.0
func (c *FakeClient) ListProjectDefaultReviewers(workspace, projectKey string, limit int) ([]backend.ProjectDefaultReviewer, error)
func (*FakeClient) ListProjectPermissions ¶ added in v1.37.0
func (c *FakeClient) ListProjectPermissions(ctx context.Context, project string) ([]backend.PermissionGrant, error)
func (*FakeClient) ListProjects ¶ added in v1.17.0
func (*FakeClient) ListRepoDownloads ¶ added in v1.111.0
func (c *FakeClient) ListRepoDownloads(ns, slug string, limit int) ([]backend.RepoDownload, error)
func (*FakeClient) ListRepoForks ¶ added in v1.64.0
func (c *FakeClient) ListRepoForks(ns, slug string, limit int) ([]backend.Repository, error)
func (*FakeClient) ListRepoHooks ¶ added in v1.129.0
func (c *FakeClient) ListRepoHooks(project, slug string) ([]backend.RepoHook, error)
func (*FakeClient) ListRepoLabels ¶ added in v1.100.0
func (c *FakeClient) ListRepoLabels(ns, slug string) ([]backend.RepoLabel, error)
func (*FakeClient) ListRepoPermissions ¶ added in v1.37.0
func (c *FakeClient) ListRepoPermissions(ctx context.Context, project, slug string) ([]backend.PermissionGrant, error)
func (*FakeClient) ListRepoWatchers ¶ added in v1.58.0
func (c *FakeClient) ListRepoWatchers(ns, slug string) ([]backend.User, error)
func (*FakeClient) ListReports ¶ added in v1.23.0
func (c *FakeClient) ListReports(project, slug, hash string) ([]backend.CodeInsightsReport, error)
func (*FakeClient) ListRepos ¶
func (c *FakeClient) ListRepos(ns string, limit int) ([]backend.Repository, error)
func (*FakeClient) ListReviewerGroups ¶ added in v1.69.0
func (c *FakeClient) ListReviewerGroups(ns, slug string) ([]backend.ReviewerGroup, error)
func (*FakeClient) ListRunners ¶ added in v1.104.0
func (c *FakeClient) ListRunners(workspace string) ([]backend.Runner, error)
func (*FakeClient) ListSSHKeys ¶ added in v1.51.0
func (c *FakeClient) ListSSHKeys() ([]backend.SSHKey, error)
func (*FakeClient) ListServerProjects ¶ added in v1.98.0
func (c *FakeClient) ListServerProjects(filter string, limit int) ([]backend.ServerProject, error)
func (*FakeClient) ListSnippetComments ¶ added in v1.123.0
func (c *FakeClient) ListSnippetComments(workspace, snippetID string, limit int) ([]backend.SnippetComment, error)
func (*FakeClient) ListSnippets ¶ added in v1.91.0
func (*FakeClient) ListTree ¶ added in v1.22.0
func (c *FakeClient) ListTree(ns, slug, ref, path string) ([]backend.TreeEntry, error)
func (*FakeClient) ListWebhooks ¶ added in v1.15.0
func (c *FakeClient) ListWebhooks(ns, slug string) ([]backend.Webhook, error)
func (*FakeClient) ListWorkspaceMemberPerms ¶ added in v1.113.0
func (c *FakeClient) ListWorkspaceMemberPerms(ws string, limit int) ([]backend.WorkspaceMemberPerm, error)
func (*FakeClient) ListWorkspaceMembers ¶ added in v1.62.0
func (c *FakeClient) ListWorkspaceMembers(workspace string, limit int) ([]backend.WorkspaceMember, error)
func (*FakeClient) ListWorkspacePipelineVariables ¶ added in v1.115.0
func (c *FakeClient) ListWorkspacePipelineVariables(workspace string) ([]backend.PipelineVariable, error)
func (*FakeClient) ListWorkspaceProjectPerms ¶ added in v1.120.0
func (c *FakeClient) ListWorkspaceProjectPerms(workspace, projectKey string, limit int) ([]backend.WorkspaceProjectPerm, error)
func (*FakeClient) ListWorkspaceRepoPerms ¶ added in v1.113.0
func (c *FakeClient) ListWorkspaceRepoPerms(ws string, limit int) ([]backend.WorkspaceRepoPerm, error)
func (*FakeClient) ListWorkspaceVariables ¶ added in v1.31.0
func (c *FakeClient) ListWorkspaceVariables(ns string) ([]backend.PipelineVariable, error)
func (*FakeClient) ListWorkspaceWebhooks ¶ added in v1.66.0
func (c *FakeClient) ListWorkspaceWebhooks(workspace string) ([]backend.Webhook, error)
func (*FakeClient) ListWorkspaces ¶ added in v1.17.0
func (c *FakeClient) ListWorkspaces(limit int) ([]backend.Workspace, error)
func (*FakeClient) MergePR ¶
func (c *FakeClient) MergePR(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
func (*FakeClient) PutCodeInsightsAnnotations ¶ added in v1.130.0
func (c *FakeClient) PutCodeInsightsAnnotations(project, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
func (*FakeClient) PutCodeInsightsReport ¶ added in v1.130.0
func (c *FakeClient) PutCodeInsightsReport(project, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
func (*FakeClient) PutFile ¶ added in v1.102.0
func (c *FakeClient) PutFile(ns, slug, path string, in backend.PutFileInput) error
func (*FakeClient) RegeneratePipelineSSHKeyPair ¶ added in v1.114.0
func (c *FakeClient) RegeneratePipelineSSHKeyPair(ns, slug string, bits int) (backend.PipelineSSHKeyPair, error)
func (*FakeClient) RemoveDefaultReviewer ¶ added in v1.50.0
func (c *FakeClient) RemoveDefaultReviewer(ns, slug, userSlug string) error
func (*FakeClient) RemoveGroupMember ¶ added in v1.95.0
func (c *FakeClient) RemoveGroupMember(groupName, user string) error
func (*FakeClient) RemoveProjectDefaultReviewer ¶ added in v1.122.0
func (c *FakeClient) RemoveProjectDefaultReviewer(workspace, projectKey, accountID string) error
func (*FakeClient) RemoveReviewers ¶ added in v1.76.0
func (c *FakeClient) RemoveReviewers(ns, slug string, id int, users []string) error
func (*FakeClient) RenameRepo ¶ added in v1.16.0
func (c *FakeClient) RenameRepo(ns, slug, newName string) (backend.Repository, error)
func (*FakeClient) RenameUser ¶ added in v1.101.0
func (c *FakeClient) RenameUser(slug, newSlug string) error
func (*FakeClient) ReopenIssue ¶ added in v1.23.0
func (c *FakeClient) ReopenIssue(ns, slug string, id int) error
func (*FakeClient) ReportCommitStatus ¶ added in v1.59.0
func (c *FakeClient) ReportCommitStatus(ns, slug, hash string, input backend.CommitStatusInput) (backend.CommitStatus, error)
func (*FakeClient) RequestReview ¶
func (c *FakeClient) RequestReview(ns, slug string, id int, users []string) error
func (*FakeClient) RerunPipeline ¶ added in v1.108.0
func (c *FakeClient) RerunPipeline(ns, slug, sourceUUID string) (backend.Pipeline, error)
func (*FakeClient) RevokePAT ¶ added in v1.99.0
func (c *FakeClient) RevokePAT(userSlug, tokenID string) error
func (*FakeClient) RevokeProjectPermission ¶ added in v1.37.0
func (c *FakeClient) RevokeProjectPermission(ctx context.Context, project string, subject backend.PermissionSubject) error
func (*FakeClient) RevokeRepoPermission ¶ added in v1.37.0
func (c *FakeClient) RevokeRepoPermission(ctx context.Context, project, slug string, subject backend.PermissionSubject) error
func (*FakeClient) RevokeWorkspacePerm ¶ added in v1.113.0
func (c *FakeClient) RevokeWorkspacePerm(ws, user string) error
func (*FakeClient) RevokeWorkspaceProjectPerm ¶ added in v1.120.0
func (c *FakeClient) RevokeWorkspaceProjectPerm(workspace, projectKey, subjectSlug string, isGroup bool) error
func (*FakeClient) RotateSecrets ¶ added in v1.38.0
func (c *FakeClient) RotateSecrets() error
func (*FakeClient) RunPipeline ¶
func (c *FakeClient) RunPipeline(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
func (*FakeClient) SearchCode ¶ added in v1.21.0
func (c *FakeClient) SearchCode(workspace, query string, limit int) ([]backend.CodeSearchHit, error)
func (*FakeClient) SearchCommits ¶ added in v1.135.0
func (c *FakeClient) SearchCommits(ns, slug string, opts backend.CommitSearchOpts) ([]backend.Commit, error)
func (*FakeClient) SearchWorkspaces ¶ added in v1.119.0
func (c *FakeClient) SearchWorkspaces(opts backend.WorkspaceSearchOpts) ([]backend.Workspace, error)
func (*FakeClient) SetBanner ¶ added in v1.103.0
func (c *FakeClient) SetBanner(in backend.BannerConfig) error
func (*FakeClient) SetEnvVariable ¶ added in v1.29.0
func (c *FakeClient) SetEnvVariable(ns, slug, envUUID string, in backend.EnvVariableInput) (backend.EnvVariable, error)
func (*FakeClient) SetLoggingConfig ¶ added in v1.38.0
func (c *FakeClient) SetLoggingConfig(in backend.LoggingConfigInput) error
func (*FakeClient) SetMailServerConfig ¶ added in v1.102.0
func (c *FakeClient) SetMailServerConfig(in backend.MailServerConfig) error
func (*FakeClient) SetMergeCheck ¶ added in v1.23.0
func (c *FakeClient) SetMergeCheck(project, slug, key string, in backend.MergeCheckInput) error
func (*FakeClient) SetPipelineVariable ¶ added in v1.15.0
func (c *FakeClient) SetPipelineVariable(ns, slug string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
func (*FakeClient) SetRateLimitConfig ¶ added in v1.134.0
func (c *FakeClient) SetRateLimitConfig(in backend.RateLimitConfig) error
func (*FakeClient) SetRepoDefaultBranch ¶ added in v1.85.0
func (c *FakeClient) SetRepoDefaultBranch(ns, slug, branch string) error
func (*FakeClient) SetRepoHookSettings ¶ added in v1.129.0
func (c *FakeClient) SetRepoHookSettings(project, slug, hookKey string, cfg json.RawMessage) error
func (*FakeClient) SetRepoVisibility ¶ added in v1.65.0
func (c *FakeClient) SetRepoVisibility(ns, slug string, isPrivate bool) error
func (*FakeClient) SetReport ¶ added in v1.23.0
func (c *FakeClient) SetReport(project, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
func (*FakeClient) SetWorkspacePipelineVariable ¶ added in v1.115.0
func (c *FakeClient) SetWorkspacePipelineVariable(workspace string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
func (*FakeClient) SetWorkspaceVariable ¶ added in v1.31.0
func (c *FakeClient) SetWorkspaceVariable(ns string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
func (*FakeClient) StopPipeline ¶ added in v1.90.0
func (c *FakeClient) StopPipeline(ws, slug, pipelineUUID string) error
func (*FakeClient) SubmitReview ¶ added in v1.25.0
func (c *FakeClient) SubmitReview(ns, slug string, id int, in backend.SubmitReviewInput) error
func (*FakeClient) SyncRepo ¶ added in v1.133.0
func (c *FakeClient) SyncRepo(ns, slug, branch string) (backend.SyncResult, error)
func (*FakeClient) TransferRepo ¶ added in v1.52.0
func (c *FakeClient) TransferRepo(ns, slug, target string) (backend.Repository, error)
func (*FakeClient) TriggerPipeline ¶ added in v1.48.0
func (c *FakeClient) TriggerPipeline(ns, slug string, input backend.PipelineTriggerInput) (backend.PipelineTriggerResult, error)
func (*FakeClient) UnapprovePR ¶
func (c *FakeClient) UnapprovePR(ns, slug string, id int) error
func (*FakeClient) UnreadyPR ¶ added in v1.75.0
func (c *FakeClient) UnreadyPR(ns, slug string, id int) error
func (*FakeClient) UnvoteIssue ¶ added in v1.100.0
func (c *FakeClient) UnvoteIssue(ns, slug string, id int) error
func (*FakeClient) UnwatchIssue ¶ added in v1.100.0
func (c *FakeClient) UnwatchIssue(ns, slug string, id int) error
func (*FakeClient) UpdateBranchModelSettings ¶ added in v1.92.0
func (c *FakeClient) UpdateBranchModelSettings(ws, slug string, in backend.BranchModelSettingsInput) (backend.BranchModelSettings, error)
func (*FakeClient) UpdateBranchRule ¶ added in v1.121.0
func (c *FakeClient) UpdateBranchRule(ns, slug string, id int, in backend.UpdateBranchRuleInput) (backend.BranchRule, error)
func (*FakeClient) UpdateIssue ¶ added in v1.17.0
func (c *FakeClient) UpdateIssue(ns, slug string, id int, in backend.UpdateIssueInput) (backend.Issue, error)
func (*FakeClient) UpdatePR ¶
func (c *FakeClient) UpdatePR(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
func (*FakeClient) UpdatePRBranch ¶ added in v1.28.0
func (c *FakeClient) UpdatePRBranch(ns, slug string, prID int) error
func (*FakeClient) UpdatePRParticipant ¶ added in v1.117.0
func (c *FakeClient) UpdatePRParticipant(ns, slug string, prID int, accountID, state string) (backend.PRParticipant, error)
func (*FakeClient) UpdatePipelinesConfig ¶ added in v1.109.0
func (c *FakeClient) UpdatePipelinesConfig(ws, slug string, in backend.PipelineConfig) (backend.PipelineConfig, error)
func (*FakeClient) UpdateRepoLabel ¶ added in v1.100.0
func (c *FakeClient) UpdateRepoLabel(ns, slug string, id int, in backend.UpdateRepoLabelInput) (backend.RepoLabel, error)
func (*FakeClient) UpdateRepoPRSettings ¶ added in v1.94.0
func (c *FakeClient) UpdateRepoPRSettings(ns, slug string, in backend.RepoPRSettingsInput) (backend.RepoPRSettings, error)
func (*FakeClient) UpdateServerProject ¶ added in v1.98.0
func (c *FakeClient) UpdateServerProject(key string, in backend.UpdateServerProjectInput) (backend.ServerProject, error)
func (*FakeClient) UpdateWorkspaceProject ¶ added in v1.112.0
func (c *FakeClient) UpdateWorkspaceProject(ws, key string, input backend.UpdateWorkspaceProjectInput) (backend.WorkspaceProject, error)
func (*FakeClient) UploadRepoDownload ¶ added in v1.111.0
func (c *FakeClient) UploadRepoDownload(ns, slug, name string, body io.Reader) (backend.RepoDownload, error)
func (*FakeClient) VoteIssue ¶ added in v1.100.0
func (c *FakeClient) VoteIssue(ns, slug string, id int) error
func (*FakeClient) WatchIssue ¶ added in v1.100.0
func (c *FakeClient) WatchIssue(ns, slug string, id int) error
type FakeEditorLauncher ¶
FakeEditorLauncher is a test double for an editor.Launcher. When Edit is called it records the filename, writes Content to the file, and returns Err.
func (*FakeEditorLauncher) Edit ¶
func (e *FakeEditorLauncher) Edit(filename string) error
Edit records the filename and (if Err is nil) writes Content into it.
type FakeKeyring ¶
type FakeKeyring struct {
GetErr error
SetErr error
DelErr error
// contains filtered or unexported fields
}
FakeKeyring is an in-memory test double for a system keyring.
func NewFakeKeyring ¶
func NewFakeKeyring() *FakeKeyring
NewFakeKeyring returns an empty FakeKeyring.
func (*FakeKeyring) Delete ¶
func (k *FakeKeyring) Delete(service, user string) error
Delete removes a stored password. If DelErr is set it is returned.
func (*FakeKeyring) Get ¶
func (k *FakeKeyring) Get(service, user string) (string, error)
Get returns the stored password or an error. If GetErr is set it is returned. Missing entries return a "not found" error.
func (*FakeKeyring) Set ¶
func (k *FakeKeyring) Set(service, user, password string) error
Set stores a password. If SetErr is set it is returned.
type FakeRunner ¶
type FakeRunner struct {
Calls []Call
// BitbottleConfig overrides answers for `git config --local --get
// bitbottle.<key>` lookups. Tests that exercise the pinned-default-repo
// path populate this map; legacy tests leave it nil and bitbottle.* reads
// resolve to "missing" without consuming a queued response.
BitbottleConfig map[string]string
// contains filtered or unexported fields
}
FakeRunner is a test double for a git command runner.
func NewFakeRunner ¶
func NewFakeRunner(responses ...RunResponse) *FakeRunner
NewFakeRunner constructs a FakeRunner seeded with the provided responses. Responses are consumed in order; if the runner is called more times than there are responses the extras return zero values.
func (*FakeRunner) AssertCalled ¶
func (r *FakeRunner) AssertCalled(t testing.TB, args ...string)
AssertCalled fails t if no recorded call matches the supplied args exactly.
func (*FakeRunner) AssertNotCalled ¶
func (r *FakeRunner) AssertNotCalled(t testing.TB, args ...string)
AssertNotCalled fails t if any recorded call matches the supplied args.
func (*FakeRunner) Run ¶
func (r *FakeRunner) Run(args ...string) (string, string, error)
Run records the call and returns the next canned response.
Reads of bitbottle.* keys via `git config --local --get bitbottle.<name>` are answered as "missing" (empty stdout, no error) without consuming a queued response. This lets pre-existing tests that seed responses only for the legacy git-remote inference path continue to work after the factory gained a `bitbottle repo set-default` consult step. Tests that intentionally exercise the pinned-default path supply explicit responses; their first `bitbottle.host` lookup matches the queued stdout before this shortcut fires.
func (*FakeRunner) RunInteractive ¶
func (r *FakeRunner) RunInteractive(args ...string) error
RunInteractive records the call (flagged as interactive) and returns only the error from the next canned response.
type IOStreams ¶
type IOStreams struct {
In io.ReadCloser
Out io.Writer
ErrOut io.Writer
IsStdoutTTY func() bool
IsStderrTTY func() bool
ColorEnabled bool
}
IOStreams is a test double for pkg/iostreams.IOStreams. It will be replaced with the real import once pkg/iostreams exists.
func TTYIOStreams ¶
TTYIOStreams returns an IOStreams that claims stdout and stderr are TTYs and has color enabled.
type PROption ¶
PROption mutates a Bitbucket pull request fixture.
func PRWithBaseBranch ¶
PRWithBaseBranch sets toRef to the given destination branch.
func PRWithBranch ¶
PRWithBranch sets fromRef to the given source branch.
func PRWithState ¶
PRWithState sets the PR state (OPEN, MERGED, DECLINED).
type RepoOption ¶
RepoOption mutates a Bitbucket repository fixture.
func RepoWithProject ¶
func RepoWithProject(key string) RepoOption
RepoWithProject sets the nested project.key field.
func RepoWithSlug ¶
func RepoWithSlug(slug string) RepoOption
RepoWithSlug sets the slug and name fields of the repo.
type RunResponse ¶
RunResponse is a canned result for a single Run/RunInteractive invocation.
type StubResponse ¶
type StubResponse struct {
Method string
PathSuffix string
Status int
Body any
Handler http.HandlerFunc
}
StubResponse describes a single canned HTTP response for NewTestServer. If Handler is set it takes precedence over Status/Body.