Skip to content

Conversation

@dudinea
Copy link
Member

@dudinea dudinea commented Oct 31, 2025

Fixes #25101

This PR configures git processes, which are run from Repo Server,
to run repository maintenance/garbage collection in foreground mode,
thus solving the concurrency issue described in #25101.

The PR creates list of mandatory git options (Builtin Git Config)
that will be set for all git processes:

  1. maintenance.autoDetach=false
  2. gc.autoDetach=false

The first one disables background maintenance (including GC) for Git version > 2.46.
The second one disables background garbage collection for earlier Git versions.

By setting the environment variable ARGOCD_GIT_BUILTIN_CONFIG_DISABLED=true
it is possible to disable this mechanism to experiment with background processing or
if this concurrency problem is not an issue in a specific environment.

This PR should be cherry-picked into older supported releases beacause
the problem can potentially happen with older releases (see #25101 for the explanation).

I see that e2e test seems to be flaky and fail for some k8s versions,
do not think this is related to the change.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).
Configures git options maintenance.autoDetach=false and gc.autoDetach
= false when running Git commands using environment variables, which
have preference over any file based configurations that can be
provided by user.

Signed-off-by: Eugene Doudine <eugene.doudine@octopus.com>
Signed-off-by: Eugene Doudine <eugene.doudine@octopus.com>
@bunnyshell
Copy link

bunnyshell bot commented Oct 31, 2025

❗ Preview Environment deployment failed on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment
@dudinea dudinea changed the title Fix git detached auto maintenance Oct 31, 2025
@olivergondza
Copy link
Contributor

Please elaborate on the precise problem this addresses.

Signed-off-by: Eugene Doudine <eugene.doudine@octopus.com>
@dudinea dudinea changed the title fix: disable detached git auto maintenance Oct 31, 2025
Signed-off-by: Eugene Doudine <eugene.doudine@octopus.com>
Signed-off-by: Eugene Doudine <eugene.doudine@octopus.com>
@dudinea dudinea marked this pull request as ready for review November 1, 2025 06:12
@dudinea dudinea requested a review from a team as a code owner November 1, 2025 06:12
@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@c2f611f). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #25127   +/-   ##
=========================================
  Coverage          ?   62.24%           
=========================================
  Files             ?      351           
  Lines             ?    49222           
  Branches          ?        0           
=========================================
  Hits              ?    30638           
  Misses            ?    15656           
  Partials          ?     2928           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants