Skip to content

chore(repo): untrack generated static/docs and restore its .gitignore rules (TE-22943) - #3320

Open
chaitanyas-maker wants to merge 1 commit into
LambdaTest:stagefrom
chaitanyas-maker:chore/te-22943-gitignore-static-docs
Open

chore(repo): untrack generated static/docs and restore its .gitignore rules (TE-22943)#3320
chaitanyas-maker wants to merge 1 commit into
LambdaTest:stagefrom
chaitanyas-maker:chore/te-22943-gitignore-static-docs

Conversation

@chaitanyas-maker

@chaitanyas-maker chaitanyas-maker commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of TE-22943. Found while reviewing #3313, pre-existing and unrelated to it.

The .gitignore block covering the auto-generated static/docs/ output kept its comment header but lost every one of its patterns, so 1,316 build artifacts are tracked in git and every npm start / npm run build rewrites them.

Why the diff is large

.gitignore does not affect files already in the index, so restoring the patterns alone would be a no-op. The generated files have to be untracked too. Hence 1,314 deletions.

Nothing is deleted from disk. This is git rm --cached only, so every file stays in your working copy.

How it broke

The patterns were correct in d06a24f8 and were dismantled the same day (2026-07-09):

  • 5952ebdd ("gitignore updated") dropped the !/static/docs/SKILL.md negation and /static/docs/llms.txt
  • 07ac7fff ("openapi md file") dropped /static/docs/*.md

Both look like the rule was deleted so a hand-written file it was excluding could be committed, instead of using git add -f. What survived is an orphaned comment ending in a comma, plus /static/.well-known/.

Impact before this change

From a clean tree, running only the generators that prestart/prebuild already run:

$ git status --porcelain | wc -l
0
$ node scripts/generate-static-md.js && node scripts/generate-llms-txt.js
$ git status --porcelain static/docs | wc -l
74
$ git diff --numstat static/docs | awk '{a+=$1;d+=$2} END{print "+"a" -"d}'
+483 -221

Starting the dev server with zero source edits produced 74 modified files. That churn leaked into unrelated docs PRs and caused avoidable conflicts.

Two files deliberately stay tracked

static/docs/SKILL.md and static/docs/OpenAPI.md are hand-written and have no docs/ source, so a blanket ignore would have destroyed them. They are kept via negation entries.

SKILL.md especially: it is served at /support/docs/SKILL.md (referenced from custom.js:456) and is read as an input by generate-skill-index.js to build static/.well-known/skills/index.json. Losing it breaks the skills index on a clean checkout.

I confirmed the split by resolving every docs/ page through the generator's own resolveSlug() rather than by filename: of the 1,316 tracked files, 1,313 were generated, 1 was llms.txt, and exactly those 2 are hand-written.

Deploy safety

All three deploy workflows (testmucom-prod-deployment.ymltestmuCom, testmucom-stage-deployment.ymlstage, prod-deployment.yml) run npm install --legacy-peer-deps && npm run build. The prebuild hook regenerates static/docs before docusaurus build, and the workflows sync build/, not the repo copy. Published output is unaffected.

Verified by simulating a fresh clone (deleting everything untracked under static/docs, leaving only what git restores):

$ ls static/docs
OpenAPI.md  SKILL.md

$ node scripts/generate-static-md.js && node scripts/generate-llms-txt.js && node scripts/generate-skill-index.js
✅ Generated 1315 static Markdown file(s) in static/docs/.
✅ Generated llms.txt with 1315 doc entries at static/docs/llms.txt.
✅ Generated /support/.well-known/skills/index.json for "TestMu AI Documentation"

$ git status --porcelain | grep -v '^D ' | wc -l
0

All pages regenerate, the skills index builds, and the tree stays clean.

Resulting .gitignore

# Auto-generated docs Markdown + llms.txt index + skills discovery index
# (regenerated on every build by scripts/generate-static-md.js,
# generate-llms-txt.js and generate-skill-index.js via prestart/prebuild).
# SKILL.md and OpenAPI.md are hand-written, so keep them tracked.
/static/docs/*.md
!/static/docs/SKILL.md
!/static/docs/OpenAPI.md
/static/docs/llms.txt
/static/.well-known/

Note for reviewers

After merging, anyone with a local clone will see static/docs/ become untracked. Their files stay on disk; no action needed.

One known follow-up, not addressed here: generate-static-md.js writes but never prunes, so a renamed or deleted docs page leaves a stale .md that is still advertised to AI agents via llms.txt. Currently harmless, worth a separate cleanup step.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PNoANgSH6WwKYwRs1RnkbX

… rules (TE-22943)

The .gitignore block covering the auto-generated static/docs/ output kept
its comment header but lost every one of its patterns, so 1,316 build
artifacts were tracked in git. Because .gitignore does not affect files
already in the index, restoring the patterns alone is a no-op; the
generated files have to be untracked as well.

The patterns were correct in d06a24f and were dismantled the same day:
5952ebd dropped the !SKILL.md negation and llms.txt, then 07ac7ff
dropped /static/docs/*.md. Both look like the rule was deleted so a
hand-written file it was excluding could be committed, instead of using
git add -f.

Impact before this change: from a clean tree, running only the
generators that prestart/prebuild already run produced 74 modified
files and +483/-221 lines with zero source edits. That churn leaked
into unrelated docs PRs and caused avoidable conflicts.

static/docs/SKILL.md and static/docs/OpenAPI.md are hand-written and
have no docs/ source, so they stay tracked via negation entries.
SKILL.md is served at /support/docs/SKILL.md (referenced from
custom.js:456) and is an input to generate-skill-index.js, so losing it
would break the skills index on a clean checkout.

Nothing is removed from disk, only from the index. All deploy workflows
run npm run build, whose prebuild hook regenerates static/docs before
docusaurus build, so published output is unaffected. Verified by
simulating a fresh clone: the generators recreated all 1,315 pages plus
llms.txt, the skills index built, and git status stayed clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNoANgSH6WwKYwRs1RnkbX
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.

1 participant