This document walks you through the steps to follow to Disable NextGen Git Experience using API.
We have an API to disable Git Experience as currently we do not have a feature to disable Git Experience using UI. So, as part of this API,
-
We will remove all the YamlGitConfigs (repos) synced in a particular scope.
-
We will delete GitSyncSettings for that scope, so that whenever user enables git-sync again on that scope the experience will remain same.
-
We will delete Setup Usages of reference Git Connector and YamlGitConfigs, so that if user wants, he can delete that Git connector.
-
We will delete all the branches from our db (gitBranches), if the repo synced in this scope is not synced in any other scope, so that user can again choose which branch he wants to sync in harness when he enables git-exp for same repo.
-
Nothing will change in regard to entities which are git-synced.
Curl of this API -
curl --location --request PUT 'https://app.harness.io/gateway/ng/api/git-sync/disable?accountIdentifier={{accountId}}&orgIdentifier={{orgId}}&projectIdentifier={{projectID}}' \
--header 'Authorization: Bearer {{bearer token}}' \ --header 'Content-length: 0'
Required Params:
-
accountIdentifier
-
orgIdentifier
-
projectIdentifier
-
Bearer Token of User is also required.
Demo:
- Go to Git Experience enabled project :
- Take accountIdentifier, orgIdentifier and projectIdentifier from the URL
- Capture the Bearer Token from Chrome The kebab menu, also known as the three dots menu → More tools → Network → Click anywhere in your Harness UI → expand the Headers → Request Headers → Authorization copy the bearer token
curl --location --request PUT 'https://app.harness.io/gateway/ng/api/git-sync/disable?accountIdentifier=(accountIdentifier)&orgIdentifier=(orgIdentifier)&projectIdentifier=(projectIdentifier)' \ --header 'Authorization: Bearer (token)' \
- Now you can see Git Experience has been removed from the project :
These are the steps we need to follow to Disable NextGen Git Experience using API.