Copilot commented on code in PR #8403:
URL: https://github.com/apache/texera/pull/8403#discussion_r3939607914
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/DatasetSearchQueryBuilderSpec.scala:
##########
@@ -111,16 +111,21 @@ import scala.jdk.CollectionConverters._
* `WorkflowExecutionService` a test->test dependency on `DAO` and `Auth`
only, so workflow-core's
* test tree is not on this module's test classpath.
*
- * The keyword tests RENDER a full-text predicate (they do not fetch one),
which does read the
- * JVM-global `FulltextSearchQueryUtils.usePgroonga` and emits whichever arm
it currently selects:
- * `pgroonga_condition(...)` when this suite runs alone, the
`to_tsvector`/`to_tsquery` arm if
- * `DatasetResourceSpec` or `WorkflowResourceSpec` ran earlier in this JVM
and left the global
- * `false` (both set it and neither restores it; amber has no `Test / fork`).
This suite therefore
- * neither touches nor restores that global, and every keyword assertion here
is deliberately
- * branch-independent: the tokens themselves and the `coalesce(...) || ' ' ||
coalesce(...)`
- * expression are built at `FulltextSearchQueryUtils:49-51`, *before* the `if
(usePgroonga)`.
- * Anything added here must keep that property — an assertion on
`pgroonga_condition` would pass
- * solo and fail in a full-module run.
+ * The keyword tests RENDER a full-text predicate (they do not fetch one),
and rendering reads the
+ * JVM-global `FulltextSearchQueryUtils.usePgroonga`: the
`pgroonga_condition(...)` arm while it
+ * holds `true`, the `to_tsvector`/`to_tsquery` arm while it holds `false`.
That flag is a plain
+ * mutable `var` and amber has no `Test / fork`, so its value here is
whatever the suites sharing
+ * this JVM have left it at — not something this spec controls or should
assume. This suite
+ * therefore neither touches nor restores it, and every keyword assertion
here is deliberately
+ * branch-independent. Two things reach both arms: the `coalesce(...) || ' '
|| coalesce(...)`
+ * expression, built at `FulltextSearchQueryUtils:49-51` *before* the `if
(usePgroonga)` and then
+ * embedded verbatim by either arm, and each INDIVIDUAL keyword token. Their
JOINING does not —
+ * the `true` arm space-joins the whole list into one literal (`:56`,
rendering
+ * `pgroonga_condition('alpha beta', ...)`), while the `false` arm emits one
predicate per keyword
+ * and joins the words *inside* a keyword with ` & ` (`:62-65`, rendering
Review Comment:
These Scaladoc notes hard-code external line numbers (e.g.,
`FulltextSearchQueryUtils:49-51`, `:56`, `:62-65`). Those references will
become stale as soon as the target file changes, which can mislead future
edits. Prefer stable references (variable/method names) instead of line numbers.
--
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]