Git Sync


Overview

Your integration content — routes, mappers, filters, classes, and property files — lives in the instance Git repository. When you commit a change, for example a fix in a mapper, the running instance must pick that change up before it has any effect. This page describes when that happens, how to control it, how to trigger it manually, and how to watch it in the logs.


What changed in IM 8.0

Before IM 8.0, every commit to the instance repository triggered a pipeline job. The job called the instance API and the change was applied immediately.

This mechanism is completely removed in IM 8.0. Instances deploy through ArgoCD, the instance repository no longer runs deployment pipelines, and no job synchronizes your commit to the running instance anymore.

Instead, the instance now checks the repository itself on a fixed interval — the periodic git sync. You can also trigger a sync manually through the API (see below).


How your change is applied

  1. You commit the change to the instance repository (for example src/main/resources/mapper/import-products.mapper.xml).

  2. At the next periodic sync — by default within one minute — the instance fetches the repository and compares it with the last synced state.

  3. The instance applies every difference: added resources are deployed, modified resources are redeployed, and deleted resources are removed.

  4. Routes affected by the change restart automatically, so the new version is live without a manual restart.

If a single file fails to apply, the sync still applies the remaining changes and reports the failure in the log.


Configuration

Set these properties in the instance property file (for example src/main/resources/application-<env>.properties). See Properties for the full reference.

Property

Default

Description

integration.configuration.git.sync-ms

60000

How often the instance checks the repository for changes, in milliseconds. The default is 60 seconds, applied centrally through the configuration server. 0 or a negative value turns the periodic sync off.

integration.configuration.git.restart-routes

true

Restart the routes affected by a change automatically after the sync applies it.

Usage notes:

  • Lower the interval when you want faster feedback during development; raise it when you want to reduce the load caused by frequent repository checks.

  • A change to sync-ms takes effect after the instance restarts.

  • When you turn the periodic sync off (sync-ms=0), committed changes are applied only when you trigger a sync manually, or when the instance restarts.


Trigger a sync immediately

When you do not want to wait for the next interval, call the instance API:

POST https://<instance-host>/api/git/ping

The endpoint takes no body and returns immediately; the sync runs in the background. The result appears in the log within a few seconds (see the next section).


Watch the sync in the logs

At the default INFO level, the sync logs only when it finds changes to apply. A run that finds no changes writes nothing — a quiet log means the repository is in sync, not that the sync is off. Failures appear at the ERROR level.

Level

Log message

Meaning

INFO

Periodic git repository sync scheduled every 60000 ms

Logged once at startup. Confirms the periodic sync is active and shows the effective interval. If this message is missing, the periodic sync is turned off.

INFO

There are 2 changes which will be applied

The run found changes; one line per changed file follows.

INFO

Going to add object [MAPPER] with name [...] @ path [...]

A single resource is applied (add, modify, or delete variants).

INFO

All changes have been successfully applied

Every change in this run was applied.

INFO

There are routes which needs to be restarted [...] after git sync

The affected routes restart with the new resource versions.

ERROR

Failed to apply 1 of 3 objects from git:

One or more files could not be applied; the next line lists the failed objects and the reasons. The remaining changes were still applied.

To verify that a specific commit reached the instance: commit, wait one interval (or call POST /api/git/ping), and look for the changes which will be applied line naming your file.

See every sync run

The messages of the individual runs — including runs that find no changes — are logged at the DEBUG level. To see them, set the log level of the GitSyncService class in the instance property file:

logging.level.net.pricefx.integration.configuration.git.GitSyncService=DEBUG

Level

Log message

Meaning

DEBUG

Going to full-sync git repository.

A sync run starts (periodic or triggered through the API).

DEBUG

Get diff between head and commitId [...]

The run compares the repository head with the last synced commit.

DEBUG

There are no changes

The run found no difference — nothing to apply.

DEBUG

Git repository in sync.

The run finished.