Skip to content

Fix: dmr-reconcile failed on missing git

David ROFF requested to merge DMR-SYSTEM into main

Fixes the failure seen when running Check for unmerged batches on main.

$ python3 -m scripts.python.dmr_mr_helper --reconcile-only
FileNotFoundError: [Errno 2] No such file or directory: 'git'

dmr-reconcile runs on a bare python:3.11-slim image and deliberately skips the apt-get install git that dmr-batch does, because reconciling only talks to the GitLab API. But main() called configure_git_identity() before the reconcile-only early return, so it shelled out to a binary that image does not have.

The call moves below that return, next to the code that needs it — everything from the batch guard onward writes to a branch; nothing before it does.

Impact

main currently carries this bug, so the chair button fails every time. The job died before doing any reconcile work, so nothing is half-applied — the stranded issues are simply untouched.

Testing

260 tests pass. A regression test asserts a reconcile-only run touches neither run() nor configure_git_identity(). A unit test alone would not have caught the original bug — the test environment has git — so this was also verified by running the real entry point with git absent from PATH entirely, reproducing the container. Exits 0, prints No orphaned DMRs to reconcile.

After merge

Pressing Check for unmerged batches will return the stranded DMRs to DMR::Approved — the six from MRs !40 (closed), !44 (closed), !47 (closed), !48 (closed), plus whatever the batch MR closed this morning carried.

Merge request reports

Loading