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.
Methods
Section titled “Methods”branchExists()
Section titled “branchExists()”branchExists(
project,branchName):Promise<boolean>
Defined in: vcs/types.ts:147
Returns whether a branch exists in a project.
Parameters
Section titled “Parameters”project
Section titled “project”branchName
Section titled “branchName”string
Returns
Section titled “Returns”Promise<boolean>
buildAuthenticatedRemoteUrl()
Section titled “buildAuthenticatedRemoteUrl()”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).
Parameters
Section titled “Parameters”string
projectPath
Section titled “projectPath”string
Returns
Section titled “Returns”string
buildChangeRequestUrl()
Section titled “buildChangeRequestUrl()”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/.
Parameters
Section titled “Parameters”projectUrl
Section titled “projectUrl”string
changeRequestIid
Section titled “changeRequestIid”string | number
Returns
Section titled “Returns”string
buildCiCloneUrl()
Section titled “buildCiCloneUrl()”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.
Parameters
Section titled “Parameters”ciJobToken
Section titled “ciJobToken”string
projectPath
Section titled “projectPath”string
Returns
Section titled “Returns”string
commitFile()
Section titled “commitFile()”commitFile(
project,branchName,commitMessage,filePath,content):Promise<VcsCommit>
Defined in: vcs/types.ts:153
Commits new content for a single file to a branch.
Parameters
Section titled “Parameters”project
Section titled “project”branchName
Section titled “branchName”string
commitMessage
Section titled “commitMessage”string
filePath
Section titled “filePath”string
content
Section titled “content”string
Returns
Section titled “Returns”Promise<VcsCommit>
compareRefs()
Section titled “compareRefs()”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).
Parameters
Section titled “Parameters”project
Section titled “project”string
string
Returns
Section titled “Returns”Promise<VcsCommitLogEntry[]>
createBranch()
Section titled “createBranch()”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).
Parameters
Section titled “Parameters”project
Section titled “project”branchName
Section titled “branchName”string
string
Returns
Section titled “Returns”Promise<VcsBranch>
createMergeRequest()
Section titled “createMergeRequest()”createMergeRequest(
project,sourceBranch,targetBranch,title,description,labels?):Promise<VcsMergeRequest>
Defined in: vcs/types.ts:169
Creates a new merge/pull request.
Parameters
Section titled “Parameters”project
Section titled “project”sourceBranch
Section titled “sourceBranch”string
targetBranch
Section titled “targetBranch”string
string
description
Section titled “description”string
labels?
Section titled “labels?”string[]
Returns
Section titled “Returns”Promise<VcsMergeRequest>
findOpenMergeRequest()
Section titled “findOpenMergeRequest()”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.
Parameters
Section titled “Parameters”project
Section titled “project”sourceBranch
Section titled “sourceBranch”string
targetBranch
Section titled “targetBranch”string
Returns
Section titled “Returns”Promise<VcsMergeRequest | undefined>
getCiContext()
Section titled “getCiContext()”getCiContext():
VcsCiContext
Defined in: vcs/types.ts:135
Reads the upstream repository’s identity from this platform’s CI environment variables.
Returns
Section titled “Returns”getFileContent()
Section titled “getFileContent()”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.
Parameters
Section titled “Parameters”project
Section titled “project”filePath
Section titled “filePath”string
string
Returns
Section titled “Returns”Promise<string>
getProjectVariables()
Section titled “getProjectVariables()”getProjectVariables(
project):Promise<VcsProjectVariable[]>
Defined in: vcs/types.ts:188
Fetches project/repo-level CI variables. Returns an empty array if unreadable.
Parameters
Section titled “Parameters”project
Section titled “project”Returns
Section titled “Returns”Promise<VcsProjectVariable[]>
listProjects()
Section titled “listProjects()”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.
Parameters
Section titled “Parameters”groupId
Section titled “groupId”string | number
Returns
Section titled “Returns”Promise<VcsProject[]>
updateMergeRequest()
Section titled “updateMergeRequest()”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.
Parameters
Section titled “Parameters”project
Section titled “project”mergeRequest
Section titled “mergeRequest”string
description
Section titled “description”string
labels?
Section titled “labels?”string[]
Returns
Section titled “Returns”Promise<VcsMergeRequest>
Properties
Section titled “Properties”apiUrl
Section titled “apiUrl”
readonlyapiUrl:string
Defined in: vcs/types.ts:132
The API base URL this provider talks to, derived from the host unless overridden.
readonlyhost:string
Defined in: vcs/types.ts:129
The instance hostname this provider was built for.
readonlykind:VcsProviderKind
Defined in: vcs/types.ts:123
terminology
Section titled “terminology”
readonlyterminology:VcsTerminology
Defined in: vcs/types.ts:126
The platform’s vocabulary, for composing user-facing text.