Documentation
¶
Index ¶
- Variables
- func Module(c *di.Container)
- type ClonerQueue
- type GitHubRepo
- type GitHubUserError
- type ImporterQueue
- type Service
- func (svc *Service) AddUser(codebaseID, userID string) error
- func (svc *Service) AddUserToCodebases(ctx context.Context, userID string) error
- func (svc *Service) Clone(codebaseID string, installationID int64, gitHubRepositoryID int64, ...) error
- func (svc *Service) CloneMissingRepositories(ctx context.Context, userID string) error
- func (svc *Service) CreateNonReadyCodebaseAndClone(ctx context.Context, ghRepo *gh.Repository, installationID int64, ...) (*codebase.Codebase, error)
- func (svc *Service) CreateNonReadyCodebaseAndCloneByIDs(ctx context.Context, installationID, repositoryID int64, ...) (*codebase.Codebase, error)
- func (svc *Service) CreateOrUpdatePullRequest(ctx context.Context, ws *workspace.Workspace, patchIDs []string) (*github.GitHubPullRequest, error)
- func (svc *Service) EnqueueGitHubPullRequestImport(ctx context.Context, codebaseID, userID string) error
- func (svc *Service) GetAppMetadata() (*config.GitHubAppMetadata, error)
- func (s *Service) GetRepositoryByCodebaseID(_ context.Context, codebaseID string) (*github.GitHubRepository, error)
- func (s *Service) GetRepositoryByInstallationAndRepoID(_ context.Context, installationID, repositoryID int64) (*github.GitHubRepository, error)
- func (svc *Service) GrantCollaboratorsAccess(ctx context.Context, codebaseID string, authAsUserID *string) error
- func (svc *Service) ImportOpenPullRequestsByUser(ctx context.Context, codebaseID, userID string) error
- func (svc *Service) ListAllAccessibleRepositoriesFromGitHub(ctx context.Context, userID string) ([]GitHubRepo, error)
- func (svc *Service) MergePullRequest(ctx context.Context, workspaceID string) error
- func (s *Service) Push(ctx context.Context, gitHubRepository *github.GitHubRepository, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIntegrationNotEnabled = errors.New("github integration is not enabled")
View Source
var ErrNotSetup = errors.New("not setup")
Functions ¶
Types ¶
type ClonerQueue ¶
type ClonerQueue interface {
Enqueue(context.Context, *github.CloneRepositoryEvent) error
}
type GitHubRepo ¶
type GitHubUserError ¶
type GitHubUserError struct {
// contains filtered or unexported fields
}
func (GitHubUserError) Error ¶
func (g GitHubUserError) Error() string
type ImporterQueue ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( logger *zap.Logger, gitHubRepositoryRepo db_github.GitHubRepositoryRepo, gitHubInstallationRepo db_github.GitHubInstallationRepo, gitHubUserRepo db_github.GitHubUserRepo, gitHubPullRequestRepo db_github.GitHubPRRepo, gitHubAppConfig *config_github.GitHubAppConfig, gitHubInstallationClientProvider github_client.InstallationClientProvider, gitHubPersonalClientProvider github_client.PersonalClientProvider, gitHubAppClientProvider github_client.AppClientProvider, gitHubPullRequestImporterQueue *ImporterQueue, gitHubCloneQueue *ClonerQueue, workspaceWriter db_workspace.WorkspaceWriter, workspaceReader db_workspace.WorkspaceReader, codebaseUserRepo db_codebase.CodebaseUserRepository, codebaseRepo db_codebase.CodebaseRepository, executorProvider executor.Provider, snap snapshotter.Snapshotter, analyticsClient analytics.Client, notificationSender sender.NotificationSender, eventsSender events.EventSender, userService service_user.Service, ) *Service
func (*Service) AddUserToCodebases ¶
AddUserToCodebases adds finds all GitHub installations and repositories that this user can see, and adds the user to all of those codebases.
func (*Service) Clone ¶
func (svc *Service) Clone( codebaseID string, installationID int64, gitHubRepositoryID int64, senderUserID string, ) error
Clone processes events to initiate the initial cloning of a codebase
When a webhook event is received from GitHub that the app has been installed on a repository
- The webhook handler creates a Codebase{isReady: false}, a partial GitHubRepository, and potentially a CodebaseUser for the user that initiated the installation (if one can be identified)
- An event is sent to this queue
- This worker, clones the repository, populates the GitHubRepository, discovers all users that should have access, and last sets isReady to true.
func (*Service) CloneMissingRepositories ¶
func (*Service) CreateNonReadyCodebaseAndClone ¶
func (*Service) CreateNonReadyCodebaseAndCloneByIDs ¶
func (*Service) CreateOrUpdatePullRequest ¶
func (*Service) EnqueueGitHubPullRequestImport ¶
func (*Service) GetAppMetadata ¶
func (svc *Service) GetAppMetadata() (*config.GitHubAppMetadata, error)
func (*Service) GetRepositoryByCodebaseID ¶
func (*Service) GetRepositoryByInstallationAndRepoID ¶
func (*Service) GrantCollaboratorsAccess ¶
func (*Service) ImportOpenPullRequestsByUser ¶
func (*Service) ListAllAccessibleRepositoriesFromGitHub ¶
func (*Service) MergePullRequest ¶
Click to show internal directories.
Click to hide internal directories.