paradime.admin.git reads how a workspace reaches its git repository, connects a repository, and manages the workspace’s deploy key. For the GraphQL operations, see Git repositories.
Prerequisites
- These operations are part of the Enterprise plan. On other plans, they raise
AdminPlanUpgradeRequiredException. - Your API key needs the Git repository admin capability group.
- The admin client of the
paradime-iopackage. See Admin client.
Get the repository and deploy key
Reads the workspace’s git repository, how Paradime reaches it, and the workspace’s deploy key. When the workspace has no deploy key yet, a key with the Git repository admin group creates the first one.Connect a repository
Connects the workspace’s repository. Sending the same input again changes nothing and starts no job. Pass one of three connection inputs:DeployKeyConnectionInput: Paradime clones and pushes with the workspace’s deploy key. Add the key to the repository with write access first. Withvalidate_repository=True(the default), the clone, thedbt_project.ymlcheck, the production sync and the editor restart run in a job.GitHubAppConnectionInput: through the Paradime GitHub App. See Connect through the GitHub App.GitLabAppConnectionInput: through the company’s GitLab connection. See Connect a GitLab repository.
How Paradime reaches the repository. See Types.
The repository now (
git_repository) and, when the deploy key connects it with validation, the cloning job (job). Wait for the job with admin.jobs.wait. Its result is a GitRepositoryConnectResult.Check repository access
Starts a job that checks the workspace’s deploy key can push to a repository. Changes nothing. The job fails withCONNECTION_TEST_FAILED when the key can’t push.
Rotate the deploy key
Replaces the workspace’s deploy key. Every call makes a new key.Rotate a key that the connected repository uses. Without it, that call raises
AdminConflictException. Clone and push break until you add the new key to the repository.Types
Import the models and enums fromparadime.apis.admin.git.types.
GitRepositoryState values: