fix(civisibility): Use -c flag for git safe.directory instead of modifying global config#4344
Conversation
…appended to the global configuration
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 496930f949
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
Benchmarks |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
dario.castane@datadoghq.com cancelled this merge request build |
|
/remove |
|
View all feedbacks in Devflow UI.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
Tests failed on this commit a6cf2d0: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit 74d5b55: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit 2564cad: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit f225a88: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What does this PR do?
-c safe.directory=<path>flaggetSafeDirectoryConfig()function that caches the repository root path (viasync.Once)execGit()andexecGitStringWithInput()to automatically include the safe.directory configgetLocalGitData()that was adding entries to global git configMotivation
The previous approach modified the global git config by running:
This caused several problems:
--addcreates duplicate entries on repeated runsInstead of modifying global config, we now pass
safe.directoryas a command-line config override:Benefits:
sync.Oncefor performancePort of DataDog/ddtest#29
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!