-
Notifications
You must be signed in to change notification settings - Fork 100
Describe how git drift detection works in detail #3194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
flin-8
wants to merge
7
commits into
main
Choose a base branch
from
frank/gitdrift
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
43ee3c3
Fix version year
flin-8 1fdd1fd
Merge branch 'main' into frank/gitdrift
flin-8 e378c2d
Revert "Fix version year"
flin-8 7379ba4
Reapply "Fix version year"
flin-8 b15b566
Good start
flin-8 5b91ee0
Merge branch 'main' of https://github.com/OctopusDeploy/docs into fra…
flin-8 0d9ac62
final edit
flin-8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.26 KB
public/docs/i/1000/argo-cd/live-object-status/2-argo-out-of-sync.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.3 KB
public/docs/i/1000/argo-cd/live-object-status/4-user-change-related.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.1 KB
public/docs/i/1000/argo-cd/live-object-status/5-user-change-unrelated.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
public/docs/i/2000/argo-cd/live-object-status/2-argo-out-of-sync.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
public/docs/i/2000/argo-cd/live-object-status/4-user-change-related.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.3 KB
public/docs/i/2000/argo-cd/live-object-status/5-user-change-unrelated.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.34 KB
public/docs/i/600/argo-cd/live-object-status/4-user-change-related.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.41 KB
public/docs/i/600/argo-cd/live-object-status/5-user-change-unrelated.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.9 KB
public/docs/i/x/argo-cd/live-object-status/5-user-change-unrelated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
public/docs/img/argo-cd/live-object-status/1-same-commit.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":1118,"height":374,"updated":"2026-06-03T00:56:48.087Z"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
public/docs/img/argo-cd/live-object-status/2-argo-out-of-sync.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":1118,"height":374,"updated":"2026-06-03T00:56:48.111Z"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
public/docs/img/argo-cd/live-object-status/3-octopus-ahead.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":1118,"height":378,"updated":"2026-06-03T00:56:48.136Z"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
public/docs/img/argo-cd/live-object-status/4-user-change-related.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":1118,"height":376,"updated":"2026-06-03T00:56:48.162Z"} |
Binary file added
BIN
+36.5 KB
public/docs/img/argo-cd/live-object-status/5-user-change-unrelated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
public/docs/img/argo-cd/live-object-status/5-user-change-unrelated.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":1118,"height":376,"updated":"2026-06-03T00:56:48.185Z"} |
135 changes: 135 additions & 0 deletions
135
src/pages/docs/argo-cd/live-object-status/git-drift-detection.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| --- | ||
| layout: src/layouts/Default.astro | ||
| pubDate: 2026-06-03 | ||
| modDate: 2026-06-03 | ||
| title: Git Drift Detection | ||
| description: How git drift detection works in detail | ||
| navTitle: Git Drift Detection | ||
| --- | ||
|
|
||
| ## When is the application synced with your intended changes? | ||
|
|
||
| Argo CD's sync status tells you whether the manifests in the repository have been applied to the cluster. It doesn't tell you however, whether the changes Octopus made have been overwritten in the repository. | ||
|
|
||
| In short, the sync status Octopus displays combines two underlying concepts: | ||
|
|
||
| 1. Whether the intended changes made by Octopus are in the repository | ||
| 1. Whether the manifests in the repository have been applied to the cluster | ||
|
|
||
| The following scenarios illustrate how this works. | ||
|
|
||
| ### Scenario 1: All synced | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| 1. Octopus commits `97A2` | ||
| 1. Argo CD refreshes to `97A2` and syncs the changes to the cluster | ||
|
|
||
| Sync status: | ||
|
|
||
| - Argo CD: **In sync** | ||
| - Octopus: **In sync** | ||
|
|
||
| This is the simplest scenario where all parties are looking at the same commit, so everyone is **In sync**. | ||
|
|
||
| ### Scenario 2: Out of sync | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| 1. Octopus commits `97A2` | ||
| 1. Argo CD refreshes to `97A2` but has yet to sync the changes to the cluster | ||
|
|
||
| Sync status: | ||
|
|
||
| - Argo CD: **Out of sync** | ||
| - Octopus: **Out of sync** | ||
|
|
||
| Even though Octopus and Argo CD are looking at the same commit, the changes have not yet been applied to the cluster, so Octopus still shows **Out of sync**. | ||
|
|
||
| ### Scenario 3: Octopus is ahead of Argo CD | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| 1. Octopus commits `8DEF` | ||
| 1. Argo CD has yet to refresh, so it still considers `97A2` to be the latest | ||
|
|
||
| Sync status: | ||
|
|
||
| - Argo CD: **In sync** | ||
| - Octopus: **Git drift** | ||
|
|
||
| In this scenario, Octopus has made a change that Argo CD doesn't see yet. This state is called **Git drift** — even though everything looks up to date from Argo CD's perspective, the changes made by Octopus aren't in the cluster. | ||
|
|
||
| ### Scenario 4: External change overwrites Octopus-generated changes | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| 1. Octopus commits `97A2` | ||
| 1. Another process commits `1123` with contents overwriting Octopus-generated changes | ||
| 1. Argo CD refreshes to `1123` and syncs the changes to the cluster | ||
|
|
||
| Sync status: | ||
|
|
||
| - Argo CD: **In sync** | ||
| - Octopus: **Git drift** | ||
|
|
||
| This also results in **Git drift** because a later commit overwrites Octopus's changes — for example, a user updating image tags that Octopus previously set. | ||
|
|
||
| ### Scenario 5: External change is unrelated to Octopus-generated changes | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| 1. Octopus commits `97A2` | ||
| 1. Another process commits `1124` with contents unrelated to Octopus-generated changes | ||
| 1. Argo CD refreshes to `1124` and syncs the changes to the cluster | ||
|
|
||
| Sync status: | ||
|
|
||
| - Argo CD: **In sync** | ||
| - Octopus: **In sync** | ||
|
|
||
| Here the later commit only contains unrelated changes — for example, a user updating the replica count after Octopus updated the image tags. Since Octopus-generated changes are still in the cluster, it displays **In sync**. | ||
|
|
||
| ## How does Octopus know what changes are intended? | ||
|
|
||
| Since Octopus pushed the changes to the Git repository, it can keep track of the intended changes. The two Argo CD steps record this information differently. | ||
|
|
||
| ### Update Argo CD Application Image Tags | ||
|
|
||
| This step updates the image tags in the manifests. To track changes, Octopus records JSON patches for the files it updates. | ||
|
|
||
| When detecting whether these changes have been overwritten: | ||
|
|
||
| 1. Octopus checks out the Git repository files for the commit that Argo CD is looking at | ||
| 1. Octopus re-applies the JSON patches to the files it previously updated | ||
| 1. If the files have any changes, then Octopus's changes have been overwritten | ||
|
|
||
| :::div{.info} | ||
| JSON patches have limitations — if the manifest has been significantly restructured, you might see an unexpected **Git drift** status. Simply redeploy to clear this false positive. | ||
| ::: | ||
|
|
||
| ### Update Argo CD Application Manifests | ||
|
|
||
| This step generates the manifests that go into the application's repository. To track changes, Octopus records the file hashes it generates. | ||
|
|
||
| When detecting whether these changes have been overwritten: | ||
|
|
||
| 1. Octopus checks out the Git repository files for the commit that Argo CD is looking at | ||
| 1. Octopus checks if the file contents have changed by comparing the hashes of the files it generated | ||
| 1. If the files have any changes, then Octopus's changes have been overwritten | ||
|
|
||
| ### Does Octopus inspect the Git tree? | ||
|
|
||
| Octopus does not determine sync status by walking the Git commit graph. It checks file contents directly because a later commit can overwrite the intended changes. | ||
|
|
||
| The only exception is a small optimization: file comparisons are skipped if the commit SHA that Argo CD is looking at matches the commit Octopus made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOS is now a section, the original page becomes
Overview