rusackas opened a new pull request, #42152:
URL: https://github.com/apache/superset/pull/42152

   ### SUMMARY
   
   The pre-commit workflow's changed-files detection diffs against 
`github.event.pull_request.base.sha`, which GitHub **freezes at PR creation**. 
On a long-lived PR the diff therefore runs from the original branch point to 
the merge ref (which contains *current* master), sweeping in all of master's 
churn since the branch was cut.
   
   This has two failure modes, both observed on #41127 (branched before the 
antd v6 upgrade and the i18n catalog canonicalization landed):
   
   1. Silent over-linting: pre-commit runs on hundreds/thousands of files the 
PR never touched.
   2. Hard failure: once the file list crosses the kernel's per-env-var limit 
(`MAX_ARG_STRLEN`, 128KiB), the runner cannot even start bash for the step — it 
dies with `An error occurred trying to start process '/usr/bin/bash' ... 
Argument list too long` and no hook output. Re-runs replay the same frozen 
payload, so the job can never go green again; the only workaround is closing 
and reopening the PR.
   
   The fix:
   
   - For `pull_request` events, diff against `HEAD^1` instead. The checkout is 
the PR **merge commit**, so its first parent *is* the current base-branch tip, 
and the three-dot diff yields exactly the PR's own files regardless of how old 
the branch is. The existing fail-closed guard (fall back to `--all-files` when 
the base can't be resolved) is kept and covers the no-merge-commit edge.
   - Cap the computed list at 100KB (safely under the 128KiB limit): a PR that 
legitimately touches thousands of files now degrades to an `--all-files` sweep 
instead of an unstartable step.
   
   `push`/`schedule` behavior is unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (CI behavior)
   
   ### TESTING INSTRUCTIONS
   
   - `check-yaml` and `zizmor` pre-commit hooks pass on the workflow file.
   - Behavior is observable on any PR whose branch point predates a large 
master change: previously the changed-files list contained all of master's 
intervening churn; with this change it contains only the PR's files. The 
failing case is reproducible on #41127 prior to its close/reopen.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to