cloud-fan opened a new pull request, #60670: URL: https://github.com/apache/spark/pull/60670
### What changes were proposed in this pull request? This PR adds four rules to the agent docs, placed by the rule the root `AGENTS.md` states: keep a rule inline if most tasks need it, or if an agent could break it without noticing it is in that situation; otherwise put it in `.agents/` behind a pointer. In the root `AGENTS.md`, "Build and Test" section (writing or fixing a test is part of most changes, and nothing in the code tells an agent about either rule): - **Pin the configs a test's assertions depend on** (`withSQLConf`, or `self.sql_conf` in Python). Suites also run in the scheduled Non-ANSI job, `build_non_ansi.yml`, which sets `SPARK_ANSI_SQL_MODE=false`, so `spark.sql.ansi.enabled` defaults to `false` there. - **Never remove a failing test or mock the code under test unless asked**, and document why any mock is needed. In `.agents/code-conventions.md` (read before committing Scala, Java or Python changes): - **New source files need the Apache License header**, copied from a neighboring file of the same type. - **Keep public Scala and Java APIs binary compatible.** When MiMa flags an intended change, add an exclusion with a `// [SPARK-xxxxx]` comment to the `vNNexcludes` section of `project/MimaExcludes.scala` for the version the change first ships in (see `.agents/versioning.md`). The root pointer to `.agents/code-conventions.md` now says "read `.agents/code-conventions.md` and run its spot-checks" instead of "run the spot-checks in", since the file holds rules and not only commands. The rules say what to write. They do not ask agents to run the license check or MiMa locally, which are slow; CI runs them. ### Why are the changes needed? Each rule prevents a failure that shows up only after the agent's work is done: - A test that relies on the ANSI default passes in PR CI and fails later in the scheduled Non-ANSI job, after the PR has merged. - Removing a failing test or mocking the code under test makes CI green without fixing anything, and reviewers have to catch it. - A new file without the license header fails the license check in the Linters job. - An intended API change without a `MimaExcludes` entry fails the MiMa check in CI. ### Does this PR introduce _any_ user-facing change? No. Only agent documentation changes. ### How was this patch tested? - `dev/agent_docs_lint.py --strict` passes with no errors or warnings. The root `AGENTS.md` grows from 6637 to 7006 bytes, under the 8 KiB target. - Checked the facts the rules rely on: `build_non_ansi.yml` sets `SPARK_ANSI_SQL_MODE=false`, `SQLConf` derives the `spark.sql.ansi.enabled` default from it, `SQLTestUtils.sql_conf` and `withSQLConf` exist, and `project/MimaExcludes.scala` has one `vNNexcludes` section per release. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) This pull request and its description were written by Isaac. -- 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]
