fix(ci): unblock main formatter + harden auto-commit step#4901
Merged
onsclom merged 3 commits intoMay 18, 2026
Conversation
The format job's "Commit formatting fixes" step previously fed the raw `git diff --name-only` output into `git add`. If a tracked-but-gitignored path (e.g. a build artifact) appeared in the diff, `git add` refused the ignored path and aborted the step, so the auto-fix commit never landed on the PR branch. PRs could then merge with formatting violations still present, leaving main red on the post-merge push-scope check. Stage only the paths listed in `.pr-format-files.existing.txt` — the same scoped set the formatter operates on — so unrelated diffs in the working tree can't poison the commit.
marthakelly
requested review from
jpr5,
mme,
ranst91 and
tylerslaton
as code owners
May 18, 2026 21:13
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
3 tasks
onsclom
approved these changes
May 18, 2026
onsclom
deleted the
martha/oss-131-fix-red-formatter-ci-on-main-copilotkit
branch
May 18, 2026 21:31
marthakelly
added a commit
that referenced
this pull request
May 18, 2026
## Summary Follow-up to #4901. That PR unblocked main with the 12-file format fix, but the workflow change it shipped doesn't actually fix the underlying bug — the auto-commit step is still poisoned the moment any tracked-but-gitignored path lands in a PR's diff. This PR does the real fix and proves it on real CI. ## Why #4901's workflow change wasn't enough `xargs -a .pr-format-files.existing.txt git add --` stages files from the same list oxfmt was scoped to. But the collection step picks up tracked-but-gitignored paths (e.g. `showcase/aimock/d5-recorded/recorded/openai-*.json` — they match `*.json`, are tracked, but sit under a `recorded/` ignore rule). Those paths end up in `.pr-format-files.existing.txt`, oxfmt rewrites them, `git add` still refuses them with the "ignored by one of your .gitignore files" warning and `exit 1`, and the step still aborts. Same failure mode as #4879. ## The real fix Filter `.pr-format-files.existing.txt` against `git ls-files -i -c --exclude-standard` — the authoritative list of tracked-but-ignored paths — in the collection step. Three effects: 1. oxfmt no longer rewrites scratch files (correct semantic: `recorded/` is recording-session scratch per its own .gitignore comment). 2. `git diff --name-only` after the formatter run won't contain any ignored paths attributable to oxfmt. 3. The auto-commit's `git add` only sees non-ignored paths, can't choke. ## Verification **Local** (already done in the working branch): | Setup | git add behavior | |---|---| | Pipe ignored fixture path → git add | `exit 1`, "ignored by .gitignore" | | Pipe mixed list (fixture + real source) → git add | `exit 1`, only real source actually stages, but exit 1 still kills `set -e` step | | Filter the list first via `ls-files -i -c`, then git add | `exit 0`, only real source stages, no warning | **Real CI** (this PR): The second commit deliberately steps on both halves of the failure mode: - A `recorded/openai-*.json` fixture is dirty in the PR diff (tracked-but-ignored path). - One source file (`prebuilt-popup.spec.ts`) is reverted to its pre-#4901 unformatted state (forces oxfmt to do real work and the auto-commit path to run). Without the filter, the format job would die at `git add` exactly the way #4879 did. With the filter, the source file gets auto-fixed and the auto-commit lands cleanly. ## Merge plan If CI is green, drop the `test:` commit (and the auto-fix commit it triggers) with `git reset --hard <fix-sha>` and force-push so only the workflow change lands on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Main has been red on
static / quality → formatsince 2026-05-18 14:24Z. The first red push was the merge of PR #4879, and every push since has stayed red on the same 12 unformatted files undershowcase/integrations/{langgraph-python,langgraph-typescript}.This PR does two things:
Unblocks main — runs
oxfmt --writeagainst the 12 files the push-scope check is failing on. Pure formatting (key reordering, line wrapping); no behavior changes.Hardens the format job's auto-commit step —
Commit formatting fixespreviously fedgit diff --name-onlyintogit add. If a tracked-but-gitignored path showed up in the diff,git addrefused it and the whole step aborted (exit 123), so the auto-fix commit never reached the PR branch. That's how fix(showcase): align LangGraph TypeScript demos to LangGraph Python gold standard #4879 was merged with 12 unformatted files: the PR'soxfmt --writehad fixed them, but the auto-commit blew up onshowcase/aimock/d5-recorded/recordedand the fixes were never pushed back.The step now stages only paths from
.pr-format-files.existing.txt— the same scoped list the formatter operates on — so unrelated working-tree diffs can no longer poison the commit.Verification
oxfmt --check .passes on this branch (9152 files).static / qualitypush run on main should go green.Follow-ups (out of scope)
formata required status check on main so a red format job blocks merge.showcase/aimock/d5-recorded/recordedshould be untracked or its ignore rule adjusted.