René's URL Explorer Experiment


Title: fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198) · Issue #5014 · developing-today/code · GitHub

Open Graph Title: fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198) · Issue #5014 · developing-today/code

X Title: fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198) · Issue #5014 · developing-today/code

Description: Finding The auto-format workflow decides "treefmt changed something" with a whole-worktree check but stages only the files it passed to the formatter. treefmt's rustfmt invocation can change files that were never in that list — rustfmt f...

Open Graph Description: Finding The auto-format workflow decides "treefmt changed something" with a whole-worktree check but stages only the files it passed to the formatter. treefmt's rustfmt invocation can change files ...

X Description: Finding The auto-format workflow decides "treefmt changed something" with a whole-worktree check but stages only the files it passed to the formatter. treefmt's rustfmt invocation can...

Opengraph URL: https://github.com/developing-today/code/issues/5014

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198)","articleBody":"## Finding\n\nThe auto-format workflow decides \"treefmt changed something\" with a whole-worktree check but stages only the files it passed to the formatter. treefmt's rustfmt invocation can change files that were never in that list — rustfmt formats a file's out-of-line `mod` children along with it — so a companion change is either stranded or breaks the run:\n\n- `.github/workflows/auto-format.yml` on current main (`0467ae0f9887`): line 111 runs `nix run .#format -- \"${format_files[@]}\"`, line 112 checks `git diff --quiet` (whole worktree), line 119 stages with `git add -- \"${format_files[@]}\"` and line 120 commits unconditionally.\n- If the listed files were already formatted but a companion changed, nothing is staged and `git commit` exits 1 (\"no changes added to commit\"); under `set -euo pipefail` the step fails, nothing is pushed, and `record_success` never runs — so every later 15-minute run re-diffs the same range and fails the same way until the range moves on.\n- If some listed file did change, the commit succeeds and the companion change is silently discarded with the runner: the unformatted child stays on main.\n\nPR #3198 introduced the restricted staging (it replaced `git add -A` to keep workflow files out of the bot's push, #3118). The later PAT rework (PR #4797, commit df09437d) removed the workflow-file exclusion — `format_files` is now all changed files and the header comment says nothing is excluded from the write pass — but kept the restricted `git add`, so the companion gap survived. CodeRabbit flagged exactly this on PR #3198 (Minor / potential_issue, https://github.com/developing-today/code/pull/3198#discussion_r4433106457); it was never addressed or replied to, and the PR merged as-is (2026-11-02).\n\n## Evidence\n\n- PR: https://github.com/developing-today/code/pull/3198 — MERGED, head `1cc7de210e`; the hunk replaced `git add -A` with `git add -- \"${format_files[@]}\"` while `git diff --quiet` stayed whole-worktree.\n- Current main `0467ae0f98876cef0dfffe9fc75d61c68aeacd67`: `.github/workflows/auto-format.yml:111-120` as quoted above; `treefmt.toml` configures rustfmt as plain `rustfmt --edition 2024` with no `skip_children` / `--skip-children`.\n- Verified on the laptop (2026-11-03, rustfmt 1.9.0): a formatted `parent.rs` declaring `mod child;` plus an unformatted `child.rs` — running `rustfmt --edition 2024 parent.rs` (only the parent passed, treefmt's exact invocation shape) reformats `child.rs`. Replaying the workflow's git sequence on that tree: `git diff --quiet` reports dirty, `git add -- parent.rs` stages nothing, `git commit` exits 1 with \"no changes added to commit\".\n- Dedupe: issue searches for the auto-format staging / companion-file problem (titles and bodies, all states, 2026-11-03) return no covering issue. #3118/#3198 are the closed workflow-push problem; open #4787 is about scheduled runs not firing and the record_success token scope — a different failure.\n\n## Why it matters\n\nThe auto-format bot is the fleet's formatting safety net: it runs every 15 minutes and keeps main formatted without gating merges. This gap makes it fail loudly and repeatedly for an entire diff range whenever a merged PR leaves an unformatted module child next to a formatted parent (formatting never gates a merge, so drift on main is expected), and in the mixed case it silently throws away formatting it already computed. Either way the bot stops doing the one job it exists for, with no issue on file.\n\n## Acceptance criteria\n\n- [ ] The write pass stages every tracked change treefmt actually made (or equivalently decides \"nothing to commit\" from the staged diff, not the worktree diff), so a companion-file change can neither fail the commit with \"no changes added to commit\" nor be silently discarded.\n- [ ] Workflow files remain pushable under the current REPO_AUTOMATION_TOKEN PAT arrangement (the #3118 regression does not return in another form).\n- [ ] A regression test in `scripts/tests/test_auto_format_workflow.py`, executing the workflow's real run block like the existing tests, covers the companion case: a listed file already formatted whose formatter run changes an unlisted tracked file — the run exits 0 and the companion change is in the pushed commit.\n- [ ] The existing auto-format workflow tests still pass.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-03T16:12:04Z","url":"https://github.com/developing-today/code/issues/5014"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fba0fdae-375b-e68e-afb2-ea509176fc6a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB458:1D2D33:10300F1:1582F96:6B065237
html-safe-nonce939d22c546927f3dc55376b690e3fa8a4a74adbb092129b477815249c38f7437
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDU4OjFEMkQzMzoxMDMwMEYxOjE1ODJGOTY6NkIwNjUyMzciLCJ2aXNpdG9yX2lkIjoiNDgyNjcxNjM3MTEwMDc4MzE1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0e0a58da152127108244e94323664abb16346c85b2d808009d0ca785136545ab
hovercard-subject-tagissue:6186507680
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/5014/issue_layout
twitter:imagehttps://opengraph.githubassets.com/546f3ffcaab7dc904dd04a2471717ac9b2a41505b838f535683795713ab50f54/developing-today/code/issues/5014
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/546f3ffcaab7dc904dd04a2471717ac9b2a41505b838f535683795713ab50f54/developing-today/code/issues/5014
og:image:altFinding The auto-format workflow decides "treefmt changed something" with a whole-worktree check but stages only the files it passed to the formatter. treefmt's rustfmt invocation can change files ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedezren39
hostnamegithub.com
expected-hostnamegithub.com
None772b6997ca4daa0428dd49a25d76052e765555ae560fe9c88517eb828bbd861e
turbo-cache-controlno-preview
go-importgithub.com/developing-today/code git https://github.com/developing-today/code.git
octolytics-dimension-user_id26439447
octolytics-dimension-user_logindeveloping-today
octolytics-dimension-repository_id627308783
octolytics-dimension-repository_nwodeveloping-today/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627308783
octolytics-dimension-repository_network_root_nwodeveloping-today/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef1f9a08f7c769a37f1dfc18ad43d463c222a7eea
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/developing-today/code/issues/5014#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F5014
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F5014
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode
Reloadhttps://github.com/developing-today/code/issues/5014
Reloadhttps://github.com/developing-today/code/issues/5014
Reloadhttps://github.com/developing-today/code/issues/5014
developing-todayhttps://github.com/developing-today
codehttps://github.com/developing-today/code
Codehttps://github.com/developing-today/code
Issues1.1k (1.1k)https://github.com/developing-today/code/issues
Pull requests178 (178)https://github.com/developing-today/code/pulls
Discussionshttps://github.com/developing-today/code/discussions
Actionshttps://github.com/developing-today/code/actions
Projectshttps://github.com/developing-today/code/projects
Wikihttps://github.com/developing-today/code/wiki
Security and qualityhttps://github.com/developing-today/code/security
Insightshttps://github.com/developing-today/code/insights
https://github.com/developing-today/code
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/5014
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/5014
#5304https://github.com/developing-today/code/pull/5304
fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198)https://github.com/developing-today/code/issues/5014#top
#5304https://github.com/developing-today/code/pull/5304
https://github.com/dezren39
area/cihttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22area%2Fci%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
kind/cihttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fci%22
priority/normalhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fnormal%22
source/pr-diff-reviewhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fpr-diff-review%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 3, 2026https://github.com/developing-today/code/issues/5014#issue-6186507680
#3198https://github.com/developing-today/code/pull/3198
#3118https://github.com/developing-today/code/issues/3118
#4797https://github.com/developing-today/code/pull/4797
df09437https://github.com/developing-today/code/commit/df09437df672cf28f9a4c910e5502ea820ea7699
#3198https://github.com/developing-today/code/pull/3198
#3198 (comment)https://github.com/developing-today/code/pull/3198#discussion_r4433106457
fix(ci): prevent workflow format diffs from blocking auto-format push (#3118) #3198https://github.com/developing-today/code/pull/3198
fix(ci): auto-format push is rejected when the format diff touches workflow files (PR #2148) #3118https://github.com/developing-today/code/issues/3118
fix(ci): prevent workflow format diffs from blocking auto-format push (#3118) #3198https://github.com/developing-today/code/pull/3198
auto-format: scheduled runs not firing since the 15-minute redesign; record_success can never work with GITHUB_TOKEN (no variables permission scope) — laptop sync installed as the mechanism #4787https://github.com/developing-today/code/issues/4787
fix(ci): auto-format push is rejected when the format diff touches workflow files (PR #2148) #3118https://github.com/developing-today/code/issues/3118
Nexthttps://github.com/developing-today/code/issues/5014?timeline_page=1
dezren39https://github.com/dezren39
kind/cihttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fci%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
source/pr-diff-reviewhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fpr-diff-review%22
priority/normalhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fnormal%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
area/cihttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22area%2Fci%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
on Nov 3, 2026https://github.com/developing-today/code/issues/5014#event-35039602924
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 3, 2026https://github.com/developing-today/code/issues/5014#issuecomment-6609146467
fix(ci): prevent workflow format diffs from blocking auto-format push (#3118) #3198https://github.com/developing-today/code/pull/3198
0467ae0https://github.com/developing-today/code/commit/0467ae0f98876cef0dfffe9fc75d61c68aeacd67
fix(ci): prevent workflow format diffs from blocking auto-format push (#3118) #3198https://github.com/developing-today/code/pull/3198
1cc7de2https://github.com/developing-today/code/commit/1cc7de210ebac85bbedea2e29ea4379b26a1c3e3
https://github.com/apps/developing-today
developing-todayhttps://github.com/apps/developing-today
on Nov 3, 2026https://github.com/developing-today/code/issues/5014#issuecomment-6610661710
developing.todayhttps://kaneo.security.cab
github-actionshttps://github.com/apps/github-actions
dezren39https://github.com/dezren39
on Nov 3, 2026https://github.com/developing-today/code/issues/5014#event-35069098416
dezren39https://github.com/dezren39
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#event-35085962659
dezren39https://github.com/dezren39
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#event-35086301378
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#issuecomment-6623676349
fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198) #5014https://github.com/developing-today/code/issues/5014
#5014https://github.com/developing-today/code/issues/5014
dezren39https://github.com/dezren39
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#event-35098051225
fix(ci): auto-format stages every tracked treefmt change (#5014)https://github.com/developing-today/code/commit/e5b22cbcbd96d9f436f397a5243638111c18a6de
#5014https://github.com/developing-today/code/issues/5014
e5b22cbhttps://github.com/developing-today/code/commit/e5b22cbcbd96d9f436f397a5243638111c18a6de
Merge pull request #5304 from developing-today/queue/9028-5014-auto-f…https://github.com/developing-today/code/commit/0dab47d5f85ae1ecb1a6641933c01bd3e38bfa9e
#5304https://github.com/developing-today/code/pull/5304
0dab47dhttps://github.com/developing-today/code/commit/0dab47d5f85ae1ecb1a6641933c01bd3e38bfa9e
dezren39https://github.com/dezren39
completedhttps://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#5304https://github.com/developing-today/code/pull/5304
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#event-35098306202
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#issuecomment-6623827222
fix(ci): auto-format stages only the listed files — treefmt companion changes (rustfmt mod children) fail the commit or are silently dropped (#3198) #5014https://github.com/developing-today/code/issues/5014
#5304https://github.com/developing-today/code/pull/5304
0dab47dhttps://github.com/developing-today/code/commit/0dab47d5f85ae1ecb1a6641933c01bd3e38bfa9e
fix(ci): auto-format push is rejected when the format diff touches workflow files (PR #2148) #3118https://github.com/developing-today/code/issues/3118
fix(ci): auto-format stages every tracked treefmt change (#5014) #5304https://github.com/developing-today/code/pull/5304
dezren39https://github.com/dezren39
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Nov 4, 2026https://github.com/developing-today/code/issues/5014#event-35098363816
Sign up for freehttps://github.com/signup?return_to=https://github.com/developing-today/code/issues/5014
Sign in to commenthttps://github.com/login?return_to=https://github.com/developing-today/code/issues/5014
dezren39https://github.com/dezren39
area/cihttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22area%2Fci%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
kind/cihttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fci%22
priority/normalhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fnormal%22
source/pr-diff-reviewhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fpr-diff-review%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.