Repository operations as an API: clone, branch, commit, pull request and secret handling, as the first pipeline stage.
The pipeline starts by acting on the repository, and it does that through an API rather than through shell steps embedded in a build definition. Cloning at a pinned commit, opening a branch, committing generated output and raising a pull request are all calls.
That is what makes generation practical. A configuration bundle produced by a generator can be committed and proposed by the same pipeline that will build it.
Operations
Branch
POST/branches
Retrieve List of Branches per Repository
getBranch
List the name of branches in a repository
This service retrieves a list of names of branches in a given repository and project.
Warning
project_name can still be used instead of repository_name but is to be deprecated in the future.
Not found. Either repository_name or account not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
Clone
POST/clone
Clone Repository
cloneRepository
Clone code
This service clones code for a given repository and branch. The service returns a bundle_id that can be used to check the status and result of the request.
The cloned code is persisted as a .zip file in the Staircase persistence layer.
Warning
project_name can still be used instead of repository_name but is to be deprecated in the future.
{
"message": "Bad request syntax or missed a required field"
}
application/json
Unauthorized, Bad credentials.
{
"message": "Unauthorized, Bad credentials."
}
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found. Either repository_name or branch is not found.
{
"message": "Not found. Either repository_name or branch is not found."
}
application/json
Method not allowed.
{
"message": "The method is not allowed for the requested URL"
}
Request bodyapplication/json
6 fields
Field
Type
Description
repository_namerequired
string
Name of the GitHub repository to be cloned
branch
string
Name of GitHub branch
commit_sha
string
Commit SHA
github_account
string
GitHub account name
github_tokenrequired
string
GitHub token. Go to settings/Personal access token/New/Enable SSO.
callback_url
string (uri)
Callback URL where are you waiting for code status
Response 202application/json
1 fields
Clone job started
Field
Type
Description
bundle_id
string (uuid)
Bundle id of the cloned project
Response 400application/json
1 fields
Bad request syntax or missed a required field
Field
Type
Description
message
string
Error message
Response 401application/json
1 fields
Unauthorized, Bad credentials.
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Not found. Either repository_name or branch is not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
GET/clone/{bundle_id}
Retrieve Clone Status
cloneBundle
This service retrieves the status of a Clone Code request for a given bundle_id. Status = IN_PROGRESS, SUCCEEDED, or FAILED. Continue to ping this service until you receive a status = SUCCEEDED.
Retrieve Clone Status returns a source URL.
The source URL is a presigned URL for the new cloned code package. Provide the source URL as a parameter to the Build Bundle service.
Not found. Either repository_name or account not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
Commit
POST/commits
Retrieve List of Commits per Branch
getCommit
List of a branch commit history
This service retrieves a list of the last of 14 days commits history from a given repository and branch, start date and end date can be given, the difference between the two cannot surpass 14 days. The service returns a list of commits objects with a maximum of 30 . By default, it will return a list of the last 14 days of commits with a maximum response of 30. Next_token can be used to retrieve the next 30 commits until is null.
Warning
project_name can still be used instead of repository_name but is to be deprecated in the future.
{
"message": "Bad request syntax or missed a required field"
}
application/json
Unauthorized, Bad credentials.
{
"message": "Unauthorized, Bad credentials."
}
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found. Either repository_name, branch or commits are not found.
{
"message": "Not found. Either repository_name, branch or commits are not found."
}
application/json
Method not allowed.
{
"message": "The method is not allowed for the requested URL"
}
Request bodyapplication/json
7 fields
Field
Type
Description
repository_namerequired
string
Name of the GitHub repository
branch
string
Name of GitHub branch
github_accountrequired
string
GitHub account name
github_tokenrequired
string
GitHub token. Go to settings/Personal access token/New/Enable SSO.
start_date
string
Minimum date in time that will be returned in this format "YYYY-MM-DD"
end_date
string
Maximum date in time that will be returned in this format "YYYY-MM-DD"
next_token
integer
The token for the next set of items to return. (You received this token from a previous call. If you have reached the end of the stream, the returned token is null.)
Response 202application/json
3 fields
Clone job started
Field
Type
Description
commits
object[]
List of commits of branch.
comment
string
Comment
author
string
Author name
date
string
Date
pagination
integer
Pagination number
totalSize
integer
Total number of commits in the branch
Response 400application/json
1 fields
Bad request syntax or missed a required field
Field
Type
Description
message
string
Error message
Response 401application/json
1 fields
Unauthorized, Bad credentials.
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Not found. Either repository_name, branch or commits are not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
POST/commits/change
Commit changes to new branch
commitChange
This service commits changes provided in zip file by creating new branch from main branch. Zip file should contain git ignore file.
Warning
project_name can still be used instead of repository_name but is to be deprecated in the future.
{
"message": "Bad request syntax or missed a required field"
}
application/json
Unauthorized, Bad credentials.
{
"message": "Unauthorized, Bad credentials."
}
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Not found. Either repository_name, branch or commits are not found.
{
"message": "Not found. Either repository_name, branch or commits are not found."
}
application/json
Method not allowed.
{
"message": "The method is not allowed for the requested URL"
}
Request bodyapplication/json
9 fields
Field
Type
Description
repository_namerequired
string
Name of the GitHub repository
github_accountrequired
string
GitHub account name
github_tokenrequired
string
GitHub token. Go to settings/Personal access token/New/Enable SSO.
new_branchrequired
string
Name of branch that will be created
commit_message
string
Commit message for changes
user_emailrequired
string
Git user email. The email address used in the author identity when creating commit.
user_namerequired
string
Git username. The human-readable name used in the author identity when creating commit.
zip_urlrequired
string
Pre-signed URL that will be used for getting repository zip file.
callback_url
string (uri)
Callback URL where are you waiting for commit status
Response 202application/json
1 fields
Commit operation job started
Field
Type
Description
operation_id
string
Operation ID of started asynchronous job.
Response 400application/json
1 fields
Bad request syntax or missed a required field
Field
Type
Description
message
string
Error message
Response 401application/json
1 fields
Unauthorized, Bad credentials.
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Not found. Either repository_name, branch or commits are not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
GET/commits/change/{operation_id}
Retrieve Commit Changes Status
getCommitChangeStatus
Retrieve Commit Change Status
This service retrieves the status of a Commit Change request for a given operation_id. Status = REQUEST_MADE, IN_PROGRESS, SUCCEEDED, or FAILED.
Response
application/json
Clone status
{
"status": "SUCCEEDED"
}
application/json
Bad syntax
{
"message": "Bad syntax"
}
application/json
Bad request syntax or forbidden request
{
"message": "Bad request syntax or missed a required field"
}
application/json
Commit change operation not found.
{
"message": "Commit change operation not found."
}
application/json
Method not allowed.
{
"message": "The method is not allowed for the requested URL"
}
Parameters
1
Parameter
Type
Example
Description
operation_idrequired
stringpath
979a6aa8-4f2-400d-9451-80ee1e127485
operation id of the started commit change job
Response 200application/json
1 fields
Clone status
Field
Type
Description
status
string
REQUEST_MADE, IN_PROGRESS, FAILED, or SUCCEEDEDFAILEDIN_PROGRESSREQUEST_MADESUCCEEDED
Response 400application/json
1 fields
Bad syntax
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Bad request syntax or forbidden request
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Commit change operation not found.
Field
Type
Description
message
string
Error message
Response 405application/json
1 fields
Method not allowed.
Field
Type
Description
message
string
Error message
Other responses
422
Pull Request
POST/pull-request
Create Pull Request
pullRequest
Create pull request
This service creates pull request. Reviewers field is optional for adding reviewer to pull request. Author of the pull request can not be added as a reviewer.
Warning
project_name can still be used instead of repository_name but is to be deprecated in the future.