Repository navigation
docs: Fix docs build disk space failure - #391
Conversation
Signed-off-by: Ilya Boyandin <[email protected]>
📝 WalkthroughWalkthroughThe PR updates the GitHub Actions deploy-docs workflow: replaces Git LFS setup with verification checks, adds runner disk cleanup and reporting steps, configures Node 24 with pnpm caching, and restructures/renames TypeDoc and VitePress documentation build steps. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/deploy-docs.yml (1)
38-50: Add a post-cleanup free-space guard to fail fast.Cleanup errors are masked with
|| true; if space is still low, the workflow fails later during docs build. Add an explicit minimum free-space check right after cleanup.Suggested guard
- name: Free disk space on runner run: | echo "Before cleanup:" df -h df -i du -sh /usr/share/dotnet /opt/ghc /usr/local/lib/android 2>/dev/null || true sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android || true echo "After cleanup:" df -h df -i du -sh /usr/share/dotnet /opt/ghc /usr/local/lib/android 2>/dev/null || true + FREE_GB=$(df --output=avail -BG / | tail -1 | tr -dc '0-9') + if [ "${FREE_GB:-0}" -lt 10 ]; then + echo "Insufficient disk after cleanup: ${FREE_GB}G available" + exit 1 + fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/deploy-docs.yml around lines 38 - 50, The "Free disk space on runner" step currently masks cleanup failures with "|| true" and lacks a post-cleanup guard; add a free-space check immediately after the removal commands in that step (the same step block named "Free disk space on runner") that measures available disk space (e.g., parse df output or use df --output=avail) and exits with a non-zero status if free space is below a chosen threshold (fail-fast with exit 1 and a clear error message) so the workflow stops early instead of failing later during the docs build.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/deploy-docs.yml:
- Around line 38-50: The "Free disk space on runner" step currently masks
cleanup failures with "|| true" and lacks a post-cleanup guard; add a free-space
check immediately after the removal commands in that step (the same step block
named "Free disk space on runner") that measures available disk space (e.g.,
parse df output or use df --output=avail) and exits with a non-zero status if
free space is below a chosen threshold (fail-fast with exit 1 and a clear error
message) so the workflow stops early instead of failing later during the docs
build.
Signed-off-by: Ilya Boyandin <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/deploy-docs.yml:
- Around line 33-37: The "Verify Git LFS media" step currently only lists and
sizes LFS files but doesn't materialize them; update that step (named "Verify
Git LFS media") to run an explicit git lfs pull (or git lfs pull --all if
needed) before running git lfs ls-files and du -sh docs/media so pointer files
are smudged into real content for downstream build steps.
| - name: Verify Git LFS media | ||
| run: | | ||
| git lfs install | ||
| git lfs pull | ||
| git lfs ls-files | wc -l | ||
| du -sh docs/media | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Examine the full workflow file to understand the context
cat -n .github/workflows/deploy-docs.ymlRepository: sqlrooms/sqlrooms
Length of output: 4418
🏁 Script executed:
# Search for any Git LFS related steps in the workflow
rg -i "lfs|git" .github/workflows/deploy-docs.yml -A 3 -B 1Repository: sqlrooms/sqlrooms
Length of output: 1518
🏁 Script executed:
# Check if there's a previous version of this file in git
git log --oneline -n 20 -- .github/workflows/deploy-docs.ymlRepository: sqlrooms/sqlrooms
Length of output: 78
🌐 Web query:
actions/checkout@v6 lfs: true git lfs initialization behavior
💡 Result:
With actions/checkout@v6 and with: lfs: true, the action’s Git LFS behavior is essentially:
- Does not set
GIT_LFS_SKIP_SMUDGE(that variable is set only whenlfsis false, to prevent any automatic LFS smudging/download during checkout). [1] - Runs
git lfs install --local(initializes LFS in the repo by configuring the local filters/hooks). [2] - (If NOT using sparse checkout) it pre-fetches LFS objects in parallel via
git lfs fetch origin <ref>before the actualgit checkout, explicitly to avoid the slower “fetch one object at a time during checkout” behavior. [3] - It then performs the normal
git checkout; there is no explicitgit lfs pullorgit lfs checkoutstep implemented by the action itself. [3]
Implications / common gotchas:
- If your working tree still contains LFS pointer files, you may need to run
git lfs checkout(orgit lfs pull) yourself in a later step; users have reported this expectation mismatch. [4] - If another tool re-clones the repo (e.g., some Docker build actions using a remote git URL as build context), that separate clone won’t inherit the LFS results from
actions/checkout. [5]
Sources:
[1] https://raw.githubusercontent.com/actions/checkout/main/dist/index.js (LFS skip-smudge logic)
[2] https://raw.githubusercontent.com/actions/checkout/main/dist/index.js (implements lfsInstall() as git lfs install --local)
[3] https://raw.githubusercontent.com/actions/checkout/main/dist/index.js (pre-checkout git lfs fetch, and no lfs checkout/pull call)
[4] actions/checkout#1019
[5] actions/checkout#270
🏁 Script executed:
# Search for any references to Git LFS in the repository
rg "git lfs" --type yaml --type md -iRepository: sqlrooms/sqlrooms
Length of output: 592
Add explicit git lfs pull to materialize LFS files in this step.
The actions/checkout@v6 action with lfs: true initializes Git LFS and pre-fetches objects, but does not materialize pointer files. The "Verify Git LFS media" step must explicitly pull and smudge the files before the build steps depend on them, or pointer files may remain in the working tree instead of actual file contents.
Suggested patch
- - name: Verify Git LFS media
+ - name: Setup and verify Git LFS media
run: |
+ git lfs pull --include="docs/media/**"
git lfs ls-files | wc -l
du -sh docs/media📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Verify Git LFS media | |
| run: | | |
| git lfs install | |
| git lfs pull | |
| git lfs ls-files | wc -l | |
| du -sh docs/media | |
| - name: Setup and verify Git LFS media | |
| run: | | |
| git lfs pull --include="docs/media/**" | |
| git lfs ls-files | wc -l | |
| du -sh docs/media |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/deploy-docs.yml around lines 33 - 37, The "Verify Git LFS
media" step currently only lists and sizes LFS files but doesn't materialize
them; update that step (named "Verify Git LFS media") to run an explicit git lfs
pull (or git lfs pull --all if needed) before running git lfs ls-files and du
-sh docs/media so pointer files are smudged into real content for downstream
build steps.
Summary by CodeRabbit
Chores
Documentation