Skip to content

Add LFS hook cleanup for self-hosted runners#845

Merged
jiaenren merged 1 commit intomainfrom
jiaenr/fix-lfs-self-hosted
Apr 10, 2026
Merged

Add LFS hook cleanup for self-hosted runners#845
jiaenren merged 1 commit intomainfrom
jiaenr/fix-lfs-self-hosted

Conversation

@jiaenren
Copy link
Copy Markdown
Collaborator

@jiaenren jiaenren commented Apr 10, 2026

Description

Fixes Git LFS Hook already exists failures on self-hosted runners.

Root cause: Self-hosted runners share workspace between jobs. When ci-internal and coverage both run on the same runner with lfs: true, the first job installs LFS hooks (pre-push, post-checkout, etc.) that persist in the workspace. The second job's git lfs install --local (run by actions/checkout) refuses to overwrite the existing hooks and fails with exit code 2.

Fix: Remove stale LFS hooks before checkout in both self-hosted runner jobs (ci-internal and coverage). This cleans up any stale hooks from previous runs so actions/checkout with lfs: true can install them cleanly.

Issue - None

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@jiaenren jiaenren requested a review from a team as a code owner April 10, 2026 00:44
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removed Git LFS configuration from the actions/checkout step in the coverage workflow's backend path. The lfs: true parameter is deleted, disabling automatic Git LFS file handling during repository checkout. No alternative LFS setup step is introduced in this change.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/coverage.yaml
Removed lfs: true parameter from the actions/checkout step in the backend coverage job, eliminating automatic Git LFS file handling during checkout.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 In workflows vast, a change so small,
Two lines removed—no LFS at all,
Git flows lighter, swift and free,
Through coverage paths, simplified we be! 📝✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Add LFS hook cleanup for self-hosted runners' does not match the actual changeset, which removes LFS from the coverage workflow to prevent hook conflicts, not to add cleanup. Update the title to accurately reflect the main change, such as 'Remove LFS from coverage workflow to prevent hook conflicts on self-hosted runners' or 'Disable LFS in coverage job to reduce hook installation conflicts'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jiaenr/fix-lfs-self-hosted

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

📖 Docs preview: https://d3in15bfzp49i0.cloudfront.net/845/index.html

@jiaenren jiaenren changed the title Force Git LFS hook install on self-hosted runners Remove unnecessary LFS from coverage workflow Apr 10, 2026
@jiaenren jiaenren force-pushed the jiaenr/fix-lfs-self-hosted branch from 7881245 to 014d7e3 Compare April 10, 2026 01:08
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.40%. Comparing base (f6535b9) to head (31a4c19).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #845      +/-   ##
==========================================
+ Coverage   42.82%   43.40%   +0.57%     
==========================================
  Files         203      203              
  Lines       27123    27123              
  Branches     7759     7759              
==========================================
+ Hits        11616    11773     +157     
+ Misses      15398    15240     -158     
- Partials      109      110       +1     
Flag Coverage Δ
backend 44.89% <ø> (-0.01%) ⬇️
ui 27.77% <ø> (+6.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jiaenren jiaenren changed the title Remove unnecessary LFS from coverage workflow Add LFS hook cleanup for self-hosted runners Apr 10, 2026
Removes stale LFS hook files left by previous jobs on shared self-hosted
runners, preventing "Hook already exists: pre-push" failures.
git lfs uninstall --local only removes filter config, not hook files,
so we delete them directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jiaenren jiaenren merged commit 8e48ab2 into main Apr 10, 2026
20 of 23 checks passed
@jiaenren jiaenren deleted the jiaenr/fix-lfs-self-hosted branch April 10, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants