Visual Git
Visual Git API are desinged to address the task of facilitating users in effortlessly synchronizing snapshots with the desired branch lines.
Sync snapshots
Syncs snapshots of the project with the branch specified in the target_branch_filter
.
Request parameters
You can call this API using either the project_id
or a combination of project_slug
and organization_slug
.
Curl Request
curl -X POST
--url https://percy.io/api/v1/branchline/sync \
--data '{"project_id": 4xxx25, "target_branch_filter": "feature-branch"}' \
-H 'Content-Type: application/json' \
-H "Authorization: Token token=$PROJECT_TOKEN"
curl -X POST
--url https://percy.io/api/v1/branchline/sync \
--data '{"project_slug": "project-demo", "organization_slug": "org-slug" "target_branch_filter": "feature-branch"}' \
-H 'Content-Type: application/json' \
-H "Authorization: Token token=$PROJECT_TOKEN"
-
project_id* String
The ID of your Percy project.
-
target_branch_filter* String
The name of the branch or branches that you want to sync the snapshots to.
-
snapshot_name_list String
A list of snapshot names that you want to sync. If this property is not provided, all snapshots from the master branch will be synced.
-
project_slug* String
The slug name of your Percy project.
-
organization_slug* String
The organization slug to which the project belongs.
Response attributes 200 OK
JSON
Response
{
"data": {
"type": "branchline-histories",
"id": "30",
"attributes": {
"action": "synced",
"status": "running",
"reason": null,
"source-branch": "master",
"target-branch-filter": "*"
},
"relationships": {
"snapshots": {}
}
}
}
-
attributes Object
Details of test session.
-
action String
Displays
action
as synced. -
status String
Displays
status
as completed. -
reason String
Displays reason what status != running.
-
source-branch String
Branch name from which sync was performed (mostly base-branch).
-
target-branch-filter String
Branch name on which the sync happened.
-
-
relationships Object
Details of test session.
-
snapshots Object
Data of snapshots.
-
Sync status
Retrieves sync status for the given sync_id
.
Request parameters
Curl Request
curl -X GET -H 'Content-Type: application/json' -H "Authorization: Token token=$USER_ADMIN_TOKEN"
https://percy.io/api/v1/branchline/sync/{sync_id}
-
sync_id* String
ID of the sync operation that you want to check the status of.
Response attributes 200 OK
JSON
Response
{
"data": {
"type": "branchline-histories",
"id": "30",
"attributes": {
"action": "synced",
"status": "completed",
"reason": null,
"source-branch": "master",
"target-branch-filter": "*"
},
"relationships": {
"snapshots": {}
}
}
}
-
attributes Object
Details of test session.
-
action String
Displays
action
as synced. -
status String
Displays
status
as completed. -
reason String
Displays reason what status != running.
-
source-branch String
Branch name from which sync was performed (mostly base-branch).
-
target-branch-filter String
Branch name on which the sync happened.
-
-
relationships Object
Details of test session.
-
snapshots Object
Data of snapshots.
-
Merge snapshots
Merges approved snapshots from a feature branch into the master branchline.
Request parameters
Curl Request
curl --request POST \
--url https://percy.io/api/v1/branchline/merge \
--header 'Authorization: Token token=$PROJECT_TOKEN' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--data '{ "data":{ "attributes":{}, "relationships":{ "build":{"data":{"type":"builds","id": "BUILD_ID"}}, }, "type":"branchline-histories"} }'
-
RAW_BODY* String
Replace BUILD_ID with the ID of the build you want to merge.
Response attributes 200 OK
JSON
Response
{
"data": {
"type": "branchline-histories",
"id": "5",
"attributes": {
"action": "merged",
"status": "completed",
"reason": null,
"source-branch": "feature_1",
"target-branch-filter": "master"
},
"relationships": {
"snapshots": {}
}
}
}
-
attributes Object
Details of test session.
-
action String
Displays
action
as synced. -
status String
Displays
status
as running. -
reason String
Displays reason what status != running.
-
source-branch String
Branch name from which sync was performed (mostly base-branch).
-
target-branch-filter String
Branch name on which the sync happened.
-
-
relationships Object
Details of test session.
-
snapshots Object
Data of snapshots.
-
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.