kumarUjjawal opened a new pull request, #25466:
URL: https://github.com/apache/datafusion/pull/25466

   ## Which issue does this PR close?
   
   - Part of #21048.
   
   ## Rationale for this change
   
   `dev/rust_lint.sh` does not run the examples README check from the 
`examples-docs-check` job. A contributor finds a stale 
`datafusion-examples/README.md` only in CI. The script also writes to a fixed 
`README-NEW.md` and a shared file under `/tmp`, and its update hint is a 
pipeline that does not work.
   
   ## What changes are included in this PR?
   
   - `ci/scripts/check_examples_docs.sh` writes its generated README and diff 
into a scratch directory created per run and removes it on exit, including on 
interruption. A `diff` error is reported as a comparison failure, not as a 
stale README.
   - The script gets `--write` and `--allow-dirty`, with the same clean-tree 
rule as `rust_fmt.sh`. `--write` replaces the README with the generated one. 
Without it, the script only reports and tells the contributor to rerun with 
`--write`.
   - `dev/rust_lint.sh` runs the script as a write step, so `./dev/rust_lint.sh 
--write` updates the README with the other formatters.
   - `docs/source/contributor-guide/testing.md` documents the check and the 
update command.
   
   The generator command, the Prettier version, and the comparison do not 
change. CI calls the script the same way as before.
   
   ## What is the testing strategy for this PR?
   
   - In a clean clone: a fresh README passes, a committed stale README fails 
with the diff, `--write` restores it byte for byte, `--write` on a dirty tree 
is refused, and `--write --allow-dirty` runs. No lockfile changed.
   - A fixture with stub `cargo` and `npx` covered generator and formatter 
failures in both modes, a `diff` error, a missing `npx`, SIGINT and SIGTERM 
cleanup, concurrent runs, and a run from a subdirectory. The README was 
untouched in every failure case.
   - A fixture with stubbed steps covered the runner: flags are forwarded in 
both write modes and absent in check mode, and a failure stops later steps. The 
full `./dev/rust_lint.sh` passes.
   
   ## Are there any user-facing changes?
   
   No.
   
   🤖 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