dongjoon-hyun commented on code in PR #60670:
URL: https://github.com/apache/spark/pull/60670#discussion_r4658978706


##########
AGENTS.md:
##########
@@ -53,27 +52,23 @@ Before the first code edit or running test in a session, 
ensure a clean working
 
 - Keep source lines within 100 characters; the linters enforce this for Scala, 
Java, and Python.
   Avoid non-ASCII characters in code and comments (string literals may contain 
them when the
-  content requires it). Before committing Scala, Java or Python changes: run 
the spot-checks in
-  `.agents/code-conventions.md`.
+  content requires it). When changing Scala, Java or Python code: read
+  `.agents/code-conventions.md`, and run its spot-checks before committing.
+- Every new file that `dev/.rat-excludes` does not already match needs the 
Apache License header,
+  copied from a neighboring file of the same type and placed after the `#!` 
line of an executable
+  script. If such a file cannot carry one, add it to `dev/.rat-excludes`; the 
license check in CI

Review Comment:
   **[25] RAT already skips binary files, and a `dev/.rat-excludes` entry 
matches a name anywhere in the tree.**
   
   "If such a file cannot carry one, add it to `dev/.rat-excludes`" has two 
gaps. First, binary files need no entry, because RAT does not check them for a 
header. For example, the `.avro` files in `connector/avro/src/test/resources` 
match no entry, and the License test passes. An agent that adds a binary 
fixture would still add an entry that nothing needs. Second, RAT 0.16.1 matches 
each entry against the bare name of every file and directory 
(`Walker.isNotIgnored`), not against a path, and skips a matching directory 
with everything under it. So `stat`, added for the `ProcfsMetrics/*/stat` 
fixtures, also skips every directory named `stat`, and RAT never reads the 45 
tracked files under `mllib/src/main/scala/org/apache/spark/mllib/stat/`, 
`python/pyspark/mllib/stat/` and the other `stat` directories. An agent that 
adds a text fixture with a common name, such as `config.yaml`, opens the same 
hole. Maybe "If a text file cannot carry one, such as test data, add a 
`dev/.rat-excludes` entr
 y that matches no other file or directory name; RAT skips binary files."



##########
.agents/code-conventions.md:
##########
@@ -12,3 +12,5 @@ Keep source lines within 100 characters — the linters enforce 
this for Scala,
           {print FILENAME":"FNR": "length" chars"}'
 
 This is only a hint: it approximates the linters' exemptions (imports, URLs) 
rather than matching them exactly, so it can over- or under-report. The linters 
remain the source of truth.
+
+Keep Scala and Java binary compatibility, including `private[spark]` and other 
package-private members of public classes, which compile to public bytecode. 
Two checks in CI enforce it: `dev/mima`, with exclusions in 
`project/MimaExcludes.scala`, and `dev/connect-jvm-client-mima-check`, which 
compares the Connect Scala client with the `sql` module in both directions and 
keeps its exclusions in `CheckConnectJvmClientCompatibility.scala`. When a 
check flags an intended change, add an exclusion with a `// [SPARK-xxxxx]` 
comment to that check's file.

Review Comment:
   **[26] Java package-private members are not public in bytecode, and MiMa 
skips them.**
   
   The sentence starts with "Scala and Java", so "other package-private members 
of public classes, which compile to public bytecode" reads as covering Java 
too. That holds only for Scala's `private[...]`. A Java member without an 
access modifier has no `ACC_PUBLIC` flag in bytecode, and MiMa 1.1.4, the 
version that `project/plugins.sbt` uses, treats every method and field without 
that flag as inaccessible (`MemberInfo.nonAccessible`), so it never reports a 
change to one. An agent that renames such a method then adds a filter or keeps 
the old method for compatibility, which nothing needs. Maybe "including Scala 
`private[spark]` and other `private[...]` members of public classes, which 
compile to public bytecode".



##########
.agents/pr-workflow.md:
##########
@@ -1,6 +1,9 @@
 # Pull Request Workflow
 
-Infer the PR title from the changes. If no ticket ID is given and the PR is 
not draft, WIP, MINOR, or TRIVIAL, create one using `dev/create_spark_jira.py`, 
using the PR title (without the JIRA ID and component tag) as the ticket title.
+- PR title format is `[SPARK-xxxx][COMPONENT] Title`. Draft, WIP, MINOR, and 
TRIVIAL PRs may omit the JIRA ID. The component tag comes from the `COMPONENTS` 
registry in `dev/merge_spark_pr.py`, the source of truth: each entry pairs a 
PR-title tag with its canonical JIRA component name and accepted aliases (e.g. 
`Documentation` → `[DOC]`, `Pandas API on Spark` → `[PS]`, `SQL` → `[SQL]`). 
Read that registry to pick the right tag.
+- Use `[FOLLOWUP]` only for small PRs that directly modify or correct 
unreleased earlier PRs. For separately planned work, non-trivial changes, or 
work outside the earlier JIRA's scope, create a separate JIRA ticket for each 
PR and use the normal title format without `[FOLLOWUP]`.
+
+Infer the PR title from the changes. When creating a PR whose title needs a 
JIRA ID and none is given, create a ticket using `dev/create_spark_jira.py`, 
with the PR title (without the JIRA ID and component tag) as the ticket title.

Review Comment:
   **[28] A `[FOLLOWUP]` PR whose JIRA ID is not given gets a new ticket.**
   
   L4 gives "a separate JIRA ticket" only to work outside the earlier PR, so a 
`[FOLLOWUP]` PR reuses the earlier PR's JIRA ID, as in 
`[SPARK-xxxxx][SQL][FOLLOWUP]`. L6 does not except it: "When creating a PR 
whose title needs a JIRA ID and none is given, create a ticket". For "open a 
followup PR for #12345", the title needs the earlier ID and the user gave only 
a PR number, so an agent creates a new ticket that duplicates the earlier one 
and puts its ID in the title. This was already the case before this PR, when 
the two rules were in different files, but now they are two lines apart. Maybe 
"When creating a PR whose title needs a JIRA ID and none is given, take it from 
the earlier PR for a `[FOLLOWUP]`; otherwise create a ticket ...".



##########
AGENTS.md:
##########
@@ -42,6 +30,17 @@ Before the first code edit or running test in a session, 
ensure a clean working
   read `.agents/build-and-test.md`. For setup and local troubleshooting: 
`docs/building-spark.md`.
 - Before writing a new Scala or Python test suite: read 
`.agents/test-base-classes.md` and pick
   the lowest base class that provides what the test actually needs.
+- When writing or changing a test, pin the configs its assertions depend on: 
runtime SQL configs
+  with `withSQLConf` (`self.sql_conf` in Python), static SQL and core configs 
in the suite's conf
+  (`sparkConf` in `SharedSparkSession` suites, `conf` in `SharedSparkContext` 
suites, `conf()` in
+  Python). Scheduled jobs rerun the suites with other defaults set through env 
vars, such as the
+  Non-ANSI job (`SPARK_ANSI_SQL_MODE=false`) and the UDS and JDK codegen jobs. 
The RocksDB UI job
+  keeps the live UI store on disk, and no config switches it back to memory, 
so a UI or listener
+  test must pass with either store. When a result differs by ANSI mode and 
both matter, assert
+  both modes instead of pinning one. To check, run the suite with 
`SPARK_ANSI_SQL_MODE=false`.

Review Comment:
   **[27] The local check covers only the Non-ANSI job.**
   
   The bullet now names four scheduled jobs, but "To check, run the suite with 
`SPARK_ANSI_SQL_MODE=false`" covers only one. Each of the other three is also a 
single env var:
   
   - UDS: `PYSPARK_UDS_MODE=true`, the default of 
`spark.python.unix.domain.socket.enabled` (`Python.scala:80`);
   - JDK codegen: `SPARK_CODEGEN_COMPILER=jdk`, read by `SQLConf` 
(`SQLConf.scala:3476`);
   - RocksDB UI: `LIVE_UI_LOCAL_STORE_DIR=<dir>`, the fallback when 
`spark.ui.store.path` is unset (`AppStatusStore.scala:875`).
   
   Without them, an agent learns whether a UI or listener test passes "with 
either store" only from the scheduled run after merge. Naming each job's 
variable, as the Non-ANSI job already does, and ending with "To check, run the 
suite with the job's env var set" would cover all four in about the same length.



-- 
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