Skip to content

Fix git commit error in SSI - #7505

Merged
cbeauchesne merged 1 commit into
mainfrom
cbeauchesne/ssi-fix
Aug 13, 2026
Merged

cbeauchesne merged 1 commit into
mainfrom
cbeauchesne/ssi-fix

Conversation

@cbeauchesne

@cbeauchesne cbeauchesne commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Fix errors like this one : https://gitlab.ddbuild.io/DataDog/system-tests/-/jobs/1945373034#L3217

Error log on git pull :

    error: Process exited with status 1: running "cd system-tests && git reset --hard HEAD && git stash && git pull && git stash && git checkout main":
    HEAD is now at 4b0b847 Remove e2e gitlab from schedules (#7388)
    warning: CRLF will be replaced by LF in lib-injection/build/docker/java/dd-lib-java-init-test-app/gradlew.bat.
    The file will have its original line endings in your working directory.

    [...]

    error: Your local changes to the following files would be overwritten by merge:
    	lib-injection/build/docker/java/dd-lib-java-init-test-app/gradlew.bat
    Please, commit your changes or stash them before you can merge.

Changes

Before :

git reset --hard HEAD 
git stash 
git pull 
git stash 
git checkout {ci_commit_branch}

Claude says :

The old sync sequence (git reset --hard HEAD && git stash && git pull && git stash && git checkout {branch}) relies on git pull's merge step, which refuses to overwrite any file it considers locally modified — and on a cached VM image, CRLF renormalization can make a tracked file appear dirty even right after a hard reset, aborting the whole pull. Merging was also the wrong operation for this use case: the goal is to make a disposable VM checkout exactly mirror origin/{branch}, not reconcile local work with upstream. This replaces it with fetch + checkout -f + reset --hard origin/{branch} + clean -fd, none of which perform a merge-safety check, so a stale/falsely-dirty tree can no longer block the sync.

After :

# fetch: bring the target branch's latest commits into the local repo,
# without touching the working tree yet.
git fetch origin

# checkout -f: switch to the target branch, force-overwriting any file
# git thinks is locally modified (this is what a plain merge/pull refuses to do).
git checkout -f {ci_commit_branch}

# reset --hard: snap the branch and working tree to exactly match origin,
# in case the local branch already existed and had diverged/lagged behind it.
git reset --hard origin/{ci_commit_branch}

# clean -fd: remove untracked files/directories left over from whatever
# branch was checked out before, so they can't leak into this test run.
git clean -fd

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

utils/virtual_machine/virtual_machine_provider.py                       @DataDog/system-tests-core

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 46 jobs - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 94307b6 | Docs | Datadog PR Page | Give us feedback!

@cbeauchesne cbeauchesne added the ai-generated The pull request includes a significant amount of AI-generated code label Aug 13, 2026
@cbeauchesne
cbeauchesne marked this pull request as ready for review August 13, 2026 12:09
@cbeauchesne
cbeauchesne requested a review from a team as a code owner August 13, 2026 12:09
@cbeauchesne
cbeauchesne enabled auto-merge (squash) August 13, 2026 12:11
@cbeauchesne
cbeauchesne merged commit 692e946 into main Aug 13, 2026
1132 of 1134 checks passed
@cbeauchesne
cbeauchesne deleted the cbeauchesne/ssi-fix branch August 13, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated The pull request includes a significant amount of AI-generated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants