Skip to content

VcsProvider

Defined in: vcs/types.ts:122

A source-control-hosting platform client, abstracted so that commands never encode one platform’s API shape, URL scheme, or vocabulary.

branchExists(project, branchName): Promise<boolean>

Defined in: vcs/types.ts:147

Returns whether a branch exists in a project.

VcsProjectRef

string

Promise<boolean>


buildAuthenticatedRemoteUrl(token, projectPath): string

Defined in: vcs/types.ts:197

Builds a token-authenticated remote URL suitable for push/tag operations (e.g. git remote add).

string

string

string


buildChangeRequestUrl(projectUrl, changeRequestIid): string

Defined in: vcs/types.ts:194

Builds the browser URL for a merge/pull request, given the project’s own web URL. The path differs per platform — GitLab nests it under /-/merge_requests/, GitHub under /pull/.

string

string | number

string


buildCiCloneUrl(ciJobToken, projectPath): string

Defined in: vcs/types.ts:200

Builds a CI-job-token-authenticated remote URL suitable for a read-only git clone.

string

string

string


commitFile(project, branchName, commitMessage, filePath, content): Promise<VcsCommit>

Defined in: vcs/types.ts:153

Commits new content for a single file to a branch.

VcsProjectRef

string

string

string

string

Promise<VcsCommit>


compareRefs(project, from, to): Promise<VcsCommitLogEntry[]>

Defined in: vcs/types.ts:144

Lists the commits reachable from to but not from from (e.g. between two tags/SHAs).

VcsProjectRef

string

string

Promise<VcsCommitLogEntry[]>


createBranch(project, branchName, ref): Promise<VcsBranch>

Defined in: vcs/types.ts:150

Creates a branch from a reference point (usually the project’s default branch).

VcsProjectRef

string

string

Promise<VcsBranch>


createMergeRequest(project, sourceBranch, targetBranch, title, description, labels?): Promise<VcsMergeRequest>

Defined in: vcs/types.ts:169

Creates a new merge/pull request.

VcsProjectRef

string

string

string

string

string[]

Promise<VcsMergeRequest>


findOpenMergeRequest(project, sourceBranch, targetBranch): Promise<VcsMergeRequest | undefined>

Defined in: vcs/types.ts:162

Finds an existing open merge/pull request with the given source and target branch, if any.

VcsProjectRef

string

string

Promise<VcsMergeRequest | undefined>


getCiContext(): VcsCiContext

Defined in: vcs/types.ts:135

Reads the upstream repository’s identity from this platform’s CI environment variables.

VcsCiContext


getFileContent(project, filePath, ref): Promise<string>

Defined in: vcs/types.ts:141

Fetches the raw content of a file from a project at a given ref.

VcsProjectRef

string

string

Promise<string>


getProjectVariables(project): Promise<VcsProjectVariable[]>

Defined in: vcs/types.ts:188

Fetches project/repo-level CI variables. Returns an empty array if unreadable.

VcsProjectRef

Promise<VcsProjectVariable[]>


listProjects(groupId): Promise<VcsProject[]>

Defined in: vcs/types.ts:138

Lists all projects/repos under a group/org, including subgroups where the platform has them.

string | number

Promise<VcsProject[]>


updateMergeRequest(project, mergeRequest, title, description, labels?): Promise<VcsMergeRequest>

Defined in: vcs/types.ts:179

Updates an existing merge/pull request’s title, description, and labels.

VcsProjectRef

VcsMergeRequest

string

string

string[]

Promise<VcsMergeRequest>

readonly apiUrl: string

Defined in: vcs/types.ts:132

The API base URL this provider talks to, derived from the host unless overridden.


readonly host: string

Defined in: vcs/types.ts:129

The instance hostname this provider was built for.


readonly kind: VcsProviderKind

Defined in: vcs/types.ts:123


readonly terminology: VcsTerminology

Defined in: vcs/types.ts:126

The platform’s vocabulary, for composing user-facing text.