Documentation
¶
Index ¶
- Constants
- func LocalWorkspaceRoot() (string, error)
- func RepoPath(workspacePath string, workspaceDirname string, repoName string) string
- func TicketWorkspacePath(workspaceRoot string, orgSlug string, projectSlug string, ...) (string, error)
- func TicketWorkspacePattern(workspaceRoot string, orgSlug string, projectSlug string) (string, error)
- func WrapPrepareTransportError(machineName string, cause error) error
- type HTTPBasicAuthInput
- type HTTPBasicAuthRequest
- type Manager
- type PrepareError
- type PrepareFailureStage
- type PreparedRepo
- type RemoteManager
- type RepoInput
- type RepoRequest
- type SetupInput
- type SetupRequest
- type Workspace
Constants ¶
const LocalWorkspacePatternRoot = "~/.openase/workspace"
LocalWorkspacePatternRoot is the display form for the local ticket workspace root.
Variables ¶
This section is empty.
Functions ¶
func LocalWorkspaceRoot ¶
LocalWorkspaceRoot resolves the absolute local ticket workspace root.
func TicketWorkspacePath ¶
func TicketWorkspacePath(workspaceRoot string, orgSlug string, projectSlug string, ticketIdentifier string) (string, error)
TicketWorkspacePath derives the absolute ticket workspace path.
func TicketWorkspacePattern ¶
func TicketWorkspacePattern(workspaceRoot string, orgSlug string, projectSlug string) (string, error)
TicketWorkspacePattern derives the read-only ticket workspace convention with a ticket placeholder.
Types ¶
type HTTPBasicAuthInput ¶
HTTPBasicAuthInput describes raw HTTPS credentials for one repository.
type HTTPBasicAuthRequest ¶
HTTPBasicAuthRequest is the parsed HTTPS credential for one repository.
type PrepareError ¶
type PrepareError struct {
Stage PrepareFailureStage
Message string
Cause error
}
func (*PrepareError) Error ¶
func (e *PrepareError) Error() string
func (*PrepareError) Unwrap ¶
func (e *PrepareError) Unwrap() error
type PrepareFailureStage ¶
type PrepareFailureStage string
const ( PrepareFailureStageTransport PrepareFailureStage = "transport" PrepareFailureStageWorkspaceRoot PrepareFailureStage = "workspace_root" PrepareFailureStageRepoAuth PrepareFailureStage = "repo_auth" PrepareFailureStageGitOperation PrepareFailureStage = "git_operation" )
type PreparedRepo ¶
type PreparedRepo struct {
Name string
RepositoryURL string
DefaultBranch string
BranchName string
WorkspaceDirname string
HeadCommit string
Path string
}
PreparedRepo describes one repository that was prepared inside a workspace.
type RemoteManager ¶
type RemoteManager struct {
// contains filtered or unexported fields
}
RemoteManager prepares ticket workspaces on a remote machine over SSH.
func NewRemoteManager ¶
func NewRemoteManager(pool *sshinfra.Pool) *RemoteManager
func (*RemoteManager) Prepare ¶
func (m *RemoteManager) Prepare(ctx context.Context, machine domain.Machine, request SetupRequest) (Workspace, error)
type RepoInput ¶
type RepoInput struct {
Name string
RepositoryURL string
DefaultBranch string
WorkspaceDirname *string
BranchName *string
HTTPBasicAuth *HTTPBasicAuthInput
}
RepoInput describes one repository to materialize in a workspace.
type RepoRequest ¶
type RepoRequest struct {
Name string
RepositoryURL string
DefaultBranch string
WorkspaceDirname string
BranchName string
HeadCommit string
HTTPBasicAuth *HTTPBasicAuthRequest
}
RepoRequest is the parsed repository setup request.
type SetupInput ¶
type SetupInput struct {
WorkspaceRoot string
OrganizationSlug string
ProjectSlug string
AgentName string
TicketIdentifier string
Repos []RepoInput
}
SetupInput is the raw boundary input for workspace preparation.
type SetupRequest ¶
type SetupRequest struct {
WorkspaceRoot string
OrganizationSlug string
ProjectSlug string
TicketIdentifier string
BranchName string
Repos []RepoRequest
}
SetupRequest is the parsed workspace preparation request.
func ParseSetupRequest ¶
func ParseSetupRequest(input SetupInput) (SetupRequest, error)
ParseSetupRequest validates raw workspace setup input into a parsed request.
type Workspace ¶
type Workspace struct {
Path string
BranchName string
Repos []PreparedRepo
}
Workspace describes a prepared ticket workspace on disk.
func PrepareWithCommandRunner ¶
func PrepareWithCommandRunner(runner commandRunner, request SetupRequest) (Workspace, error)