Repository
Summary
Infra Sync Tracker supports two different types of connections to external Git repositories
- Repository fully integrates with Git version control, including branch tracking and two-way branch synchronization.
- Read-only Repository links a particular branch in Infra Sync Tracker to a particular ref in the Git repository. It will only read from the Git repository. It will never make any changes to the external repository.
See the guide for instructions on creating repositories in Infra Sync Tracker.
.infrahub.yml
file
The .infrahub.yml
configuration file specifies exactly what should be imported into Infra Sync Tracker from the external repository, it could be transformations, GraphQL query, artifact definitions, generators ...
See this topic for a full explanation of everything that can be defined in the .infrahub.yml
file.
Architecture
The Infra Sync Tracker web server will never connect directly with external Git repositories. All interactions between Infra Sync Tracker and remote Git repositories are handled by the Task worker. The Task worker(s) can work with any remote Git server that using either git
or http
protocols. The Infra Sync Tracker web server can send commands to the Task worker via our message broker and the Task worker can send data back to the Infra Sync Tracker web server via GraphQL mutations.
Infra Sync Tracker stores all of the data that it needs for every remote repository in a directory defined by the git.repositories_directory
setting in infrahub.toml
. When the Task worker receives an instruction to update a remote repository, it pulls data from the remote repositories and saves it to the filesystem in the git.repositories_directory
directory. The Task worker then parses the new data and sends the necessary GraphQL mutations to the Infra Sync Tracker web server. Infra Sync Tracker attempts to update Repository
with any changes in the remote repository several times per minute. Read-only repositories are only updated when specifically requested.
Please note that each Task worker must have access to the same directory on the file system so that they can share work among each other.
Read-only Repository vs. Repository
Feature | Repository | Read-only Repository |
---|---|---|
Branches | Tracks all remote branches | Data from one remote commit imported to one Infra Sync Tracker branch |
Updates from remote | Automatic via background task | Manually, by updating ref |
Updates to remote | When merging Proposed Change | No |
Read-only Repository
Read-only Repositories will only pull data from an external repository into Infra Sync Tracker and will never push any data to the external repository. A Read-only Repository will pull changes from a single ref
(branch, tag, or commit) into the Infra Sync Tracker branch(es) on which it exists. Read-only repositories are not automatically updated. To update a Read-only Repository, you must manually update the ref
property to a new value, then the Task worker will pull the appropriate commit and create the appropriate objects in Infra Sync Tracker.
See the guide for instructions on pulling changes from read-only repositories in Infra Sync Tracker.
Repository
When you create a Repository
, Infra Sync Tracker will try to pull every branch defined in the external repository and create an associated Infra Sync Tracker branch with the same name and matching data according to what is defined in the .infrahub.yml
configuration file on the particular remote branch. Infra Sync Tracker will attempt to sync updates from the external repository several times per minute in a background task that runs on the Task worker(s).
Editing a given GraphQL Query, Transform, Artifact Definition, or Schema within Infra Sync Tracker will not result in those changes being pushed to the external repository and could potentially be overwritten when Infra Sync Tracker pulls new commits from the external repository. Infra Sync Tracker will only push changes to an external repository when a Proposed Change is merged for which the source and destination branch are both linked to branches on the same external repository. In this case, Infra Sync Tracker will attempt to create a merge commit and push that commit to the destination branch on the external repository.
Repository statuses
Repository object has three status fields, all tracking various metrics.
See this guide for instructions on troubleshooting repositories.
Admin status
Admin status keeps track of Infra Sync Tracker usage of a repository.
- Active
- Inactive
- Staging
Infra Sync Tracker is actively using this repository.
Infra Sync Tracker isn't using this repository.
Infra Sync Tracker is waiting the next proposed change to bring this repository up.
Operational status
Operational status keeps track of the connectivity between Infra Sync Tracker and the Repository.
- Unknown
- Error cred
- Error connection
- Error
- Online
Can't compute the operational status.
Infra Sync Tracker can't authenticate to the repository.
Infra Sync Tracker can't reach the repository.
Issue happened when adding the repository.
Repository is up and running.
Sync status
Sync status keeps track of the synchronisation operation's output.
- Unknown
- In sync
- Error import
- Syncing
Can't compute the sync status.
All assets stored on the repository are synced in Infra Sync Tracker.
Something wrong happened while importing repository to Infra Sync Tracker.
Sync operation is ongoing.
Repository actions
From the repository detailed view you can open a "More" menu containing advanced actions to interact with the repository.
- Check connectivity
- Reimport last commit
Infra Sync Tracker will try to reach the repository and authenticate.
Infra Sync Tracker will fetch files on the remote repository with the existing commit identifier. This action won't change the reference on Infra Sync Tracker side (for example pull the latest commit). This might be useful to force an import after having fixed data on Infra Sync Tracker side.