Fix CI pre-commit file-mode failure #581
Conversation
Greptile SummaryThis PR adds
Confidence Score: 4/5The intent is correct but the step ordering makes the fix self-defeating — needs one reorder before merging. There is a single P1 issue: the .github/workflows/ci.yml — step ordering around Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Ignore file-mode changes\ngit config --global core.fileMode false\n⚠️ git not yet installed!"] -->|FAILS: git not found| B["Install git\napt-get install git ..."]
B --> C["Clean up symlinks"]
C --> D["Mark repo as safe\ngit config safe.directory"]
D --> E["Checkout Code\nactions/checkout@v4"]
E --> F["Git LFS pull"]
F --> G["git status"]
G --> H["Run pre-commit\npre-commit/action@v3.0.1"]
style A fill:#ff6b6b,color:#fff
style B fill:#ffd93d
Reviews (1): Last reviewed commit: "try if it fix" | Re-trigger Greptile |
| - name: Ignore file-mode changes | ||
| run: git config --global core.fileMode false |
There was a problem hiding this comment.
git config runs before git is installed
The python:3.11-slim image does not ship with git. The "Install git" step (line 52–58) is where git is first made available, but git config --global core.fileMode false runs before it — so this step will fail with git: command not found, breaking the job it was meant to fix.
Move the "Ignore file-mode changes" step to after the "Install git" step:
| - name: Ignore file-mode changes | |
| run: git config --global core.fileMode false | |
| - &install_git_step | |
| name: Install git (and tools needed by hooks) | |
| run: | | |
| apt-get update | |
| apt-get install -y --no-install-recommends git git-lfs clang-format ca-certificates make | |
| git --version | |
| git lfs version | |
| # On self-hosted runners the workspace persists between runs and files | |
| # can end up with 755 permissions. Hooks that rewrite files preserve | |
| # the 755 mode, causing a 644→755 diff that fails pre-commit. | |
| # Telling git to ignore file-mode changes avoids this. | |
| - name: Ignore file-mode changes | |
| run: git config --global core.fileMode false |
(Note: a multi-hunk edit is needed; the original block at lines 49–50 should also be removed.)
kellyguo11
left a comment
There was a problem hiding this comment.
LGTM — clean, minimal fix.
What it does: On self-hosted runners, the persistent workspace can leave files with executable (755) permissions from previous runs. Pre-commit hooks that rewrite files preserve those modes, producing spurious 644→755 diffs that fail the check-executables-have-shebangs and similar checks. Setting core.fileMode false tells git to ignore these permission-only changes.
Step ordering is correct: The git config runs after checkout (so .git/ exists) and right before pre-commit/action, which is the ideal placement. Uses local config (not --global), scoped to this repo only — good.
CI confirms: Pre-commit job passes on the latest commit (a18564ca). The Run policy-related tests failure is unrelated to this change.
Note: Greptile's comment about step ordering was based on the first commit; the second commit (reorder) fixed that, so it's a stale concern.
Nit (non-blocking): Commit messages could be more descriptive ("try if it fix" → something like "ci: ignore file-mode changes in pre-commit job"), but that's cosmetic.
alexmillane
left a comment
There was a problem hiding this comment.
Looks reasonable if it works!
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
Adds git config core.fileMode false before the pre-commit step in CI to prevent spurious 644→755 file-mode diffs on self-hosted runners. Clean, targeted fix for a known CI flake.
Design Assessment
Design is sound. Setting core.fileMode false at the workflow level is the standard fix for permission-drift on persistent workspaces. The step is correctly placed after checkout/LFS but before pre-commit/action, and the comment explains the why clearly.
Findings
No issues found. This is a well-scoped, minimal CI fix:
- ✅ Correct placement in the workflow (after
git status, beforepre-commit) - ✅ Uses
git config(local scope by default) — won't leak to other jobs or repos - ✅ Comment explains the root cause concisely
- ✅ Pre-commit check is now passing on this branch
Test Coverage
No new tests needed — this is a CI workflow configuration change with no runtime impact on the codebase. The pre-commit CI check itself serves as the validation (and it's passing ✅).
CI Status
- Pre-commit: ✅ Passing
- Docs build: ✅ Passing
- Tests: 🔄 In progress
Verdict
APPROVE — Correct fix, minimal blast radius, well-documented. Ship it.
Summary
Fix pre-commit CI job failing with "pre-commit hook(s) made changes". E.g. https://github.com/isaac-sim/IsaacLab-Arena/actions/runs/24260814760/job/70843875557
Detailed description