Repository navigation
feat(operator-reference): add a generator for the operator reference pages - #9032
Conversation
…pages Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9032 +/- ##
=========================================
Coverage 91.60% 91.60%
Complexity 5038 5038
=========================================
Files 1283 1283
Lines 57004 57004
Branches 7419 7419
=========================================
Hits 52221 52221
Misses 2915 2915
Partials 1868 1868
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…he existing pages Column-picker properties show their field type again, long cells wrap with <br> as before, properties follow the JSON schema order the property panel uses, and code templates are copied verbatim. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ence-generator Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 518 | 0.316 | 19,104/24,617/24,617 us | 🔴 +16.8% / 🔴 +74.7% |
| 🔴 | bs=100 sw=10 sl=64 | 1,217 | 0.743 | 79,968/105,175/105,175 us | 🔴 +22.5% / 🔴 +12.8% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,457 | 0.889 | 684,645/738,232/738,232 us | ⚪ within ±5% / 🟢 -20.0% |
Baseline details
Latest main 52093b4 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 518 tuples/sec | 580 tuples/sec | 927.28 tuples/sec | -10.7% | -44.1% |
| bs=10 sw=10 sl=64 | MB/s | 0.316 MB/s | 0.354 MB/s | 0.566 MB/s | -10.7% | -44.2% |
| bs=10 sw=10 sl=64 | p50 | 19,104 us | 16,351 us | 10,932 us | +16.8% | +74.7% |
| bs=10 sw=10 sl=64 | p95 | 24,617 us | 23,857 us | 14,458 us | +3.2% | +70.3% |
| bs=10 sw=10 sl=64 | p99 | 24,617 us | 23,857 us | 17,274 us | +3.2% | +42.5% |
| bs=100 sw=10 sl=64 | throughput | 1,217 tuples/sec | 1,318 tuples/sec | 1,240 tuples/sec | -7.7% | -1.8% |
| bs=100 sw=10 sl=64 | MB/s | 0.743 MB/s | 0.805 MB/s | 0.757 MB/s | -7.7% | -1.8% |
| bs=100 sw=10 sl=64 | p50 | 79,968 us | 75,420 us | 85,781 us | +6.0% | -6.8% |
| bs=100 sw=10 sl=64 | p95 | 105,175 us | 85,891 us | 93,231 us | +22.5% | +12.8% |
| bs=100 sw=10 sl=64 | p99 | 105,175 us | 85,891 us | 116,160 us | +22.5% | -9.5% |
| bs=1000 sw=10 sl=64 | throughput | 1,457 tuples/sec | 1,463 tuples/sec | 1,278 tuples/sec | -0.4% | +14.0% |
| bs=1000 sw=10 sl=64 | MB/s | 0.889 MB/s | 0.893 MB/s | 0.78 MB/s | -0.4% | +14.0% |
| bs=1000 sw=10 sl=64 | p50 | 684,645 us | 680,896 us | 835,630 us | +0.6% | -18.1% |
| bs=1000 sw=10 sl=64 | p95 | 738,232 us | 724,992 us | 877,570 us | +1.8% | -15.9% |
| bs=1000 sw=10 sl=64 | p99 | 738,232 us | 724,992 us | 922,624 us | +1.8% | -20.0% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,386.17,200,128000,518,0.316,19103.82,24617.22,24617.22
1,100,10,64,20,1643.89,2000,1280000,1217,0.743,79967.69,105175.29,105175.29
2,1000,10,64,20,13730.06,20000,12800000,1457,0.889,684645.35,738232.39,738232.39Co-Authored-By: Claude Opus 5.5 <[email protected]>
carloea2
left a comment
There was a problem hiding this comment.
Local testing confirmed the generated-reference issues below. Please address the enum default, rendered types, schema coverage and CI mapping before merge. I also noted the existing guide content and three nonblocking suggestions.
Enum defaults go through @jsonvalue, List element types are escaped so Hugo does not drop them, String dropdowns injected with JsonSchemaInject list their options, conditional and relative attributeTypeRules become description notes, numeric bound annotations are appended like @SiZe, slugs lowercase with Locale.ROOT, the parameter page column is named Example, and docs/operator-reference maps to the common label so its tests run. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…olumn types A property whose type is a config class (not only a List of one) now lists that class's fields as sub-rows, and a table whose rows show accepted column types in parentheses gets a one-line footnote saying what they mean. Co-Authored-By: Claude Fable 5.1 <[email protected]>
carloea2
left a comment
There was a problem hiding this comment.
Rechecked the fixes locally. All 19 tests, lint and formatting pass after merging with fresh main. Please resolve the addressed threads.
A descriptor's class-level allOf/if/then/else rules make a property required depending on another property's value. The Requirement column now says so, for example "✓ unless `Aggregate Func` is count". Co-Authored-By: Claude Fable 5.1 <[email protected]>
mengw15
left a comment
There was a problem hiding this comment.
LGTM. The comment is for the follow-up that regenerates the pages, not a blocker here.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
6 open issues
toSingleLinewill throw ifscontains only whitespace/newlines (becausejoinedbecomes empty… · New Sorting byschemaOrder.indexOf(...)will rank fields missing from the schema at-1, which… · NewgetDeclaredConstructor().newInstance()can fail for non-public no-arg constructors (common in… · NewFiles.walk(...)returns ajava.util.stream.Streamthat should be closed. As written, the stream… · New Same resource-management issue as production code:Files.walk(outputDir)should be closed.… · New The exception message referencesOperatorGroupConstants.OperatorGroupOrderList, but this code is… · New
What changed in this PR
Adds a Scala-based generator module to regenerate operator reference docs from operator descriptor annotations, reducing manual edits under docs/reference/operators/.
Changes:
- Introduces
OperatorDocScannerto generate operator pages, group indexes, root index, and parameter pages. - Adds
JsonPropertyReflectionUtilsto reflect operator classes and render property tables, output ports, and hyperparameter enums. - Wires the new sbt module into the root build and CI, while excluding it from docs-to-website sync.
| File | Description |
|---|---|
| docs/operator-reference/src/main/scala/org/apache/texera/operatorreference/OperatorDocScanner.scala | Implements the doc generation entrypoint and markdown page/index rendering. |
| docs/operator-reference/src/main/scala/org/apache/texera/operatorreference/JsonPropertyReflectionUtils.scala | Adds reflection utilities to extract property metadata and render markdown sections. |
| docs/operator-reference/src/test/scala/org/apache/texera/operatorreference/OperatorDocScannerSpec.scala | Adds integration-style tests validating generated file structure and locale-independent slugs. |
| docs/operator-reference/src/test/scala/org/apache/texera/operatorreference/JsonPropertyReflectionUtilsSpec.scala | Adds unit tests for table/output/enum rendering behaviors. |
| docs/operator-reference/build.sbt | Defines the new sbt sub-build, deps, and Jackson overrides. |
| build.sbt | Registers OperatorReferenceGenerator project and aggregates it into the root build. |
| .github/workflows/sync-docs-to-site.yml | Excludes the generator module from website syncing (tooling-only). |
| .github/workflows/build.yml | Adds the new module to CI build/test selection. |
| .github/labeler.yml | Updates labeler to include generator changes under the common Scala label set. |
Review effort: Lite
…pages (apache#9032) ### What changes were proposed in this PR? This PR adds a generator that builds the operator reference pages under `docs/reference/operators/` from the annotations on each operator class, so the pages can be regenerated from the source code instead of edited by hand. Changes: - A new `OperatorReferenceGenerator` sbt module at `docs/operator-reference/`, depending only on `WorkflowOperator`. - `JsonPropertyReflectionUtils` reads an operator class and renders its property table (title, requirement, type, default, description, with nested config classes and switch-dependent properties indented under their parent), the UDF code template, the output ports, and the sklearn hyperparameter enums. - `OperatorDocScanner` writes one page per operator in its group directory, an index per group, the root index, and the parameter pages. It regenerates everything under the output directory except the hand-written `output-modes.md`. Run it from the repository root with `sbt "OperatorReferenceGenerator/runMain org.apache.texera.operatorreference.OperatorDocScanner"`. - The module runs its tests in the amber CI job and is excluded from the docs-to-website sync, since it is build tooling rather than docs content. No page is changed in this PR. The regenerated pages follow in a separate PR so their diff can be reviewed on its own. ### Any related issues, documentation, discussions? Closes apache#9031 ### How was this PR tested? `sbt OperatorReferenceGenerator/test` (14 tests), `scalafmtCheck` and `scalafix --check` pass. Running the generator on current main produces the pages submitted in the follow-up PR. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Fable 5.1) --------- Co-authored-by: Claude Fable 5.1 <[email protected]>



What changes were proposed in this PR?
This PR adds a generator that builds the operator reference pages under
docs/reference/operators/from the annotations on each operator class, so the pages can be regenerated from the source code instead of edited by hand.Changes:
OperatorReferenceGeneratorsbt module atdocs/operator-reference/, depending only onWorkflowOperator.JsonPropertyReflectionUtilsreads an operator class and renders its property table (title, requirement, type, default, description, with nested config classes and switch-dependent properties indented under their parent), the UDF code template, the output ports, and the sklearn hyperparameter enums.OperatorDocScannerwrites one page per operator in its group directory, an index per group, the root index, and the parameter pages. It regenerates everything under the output directory except the hand-writtenoutput-modes.md. Run it from the repository root withsbt "OperatorReferenceGenerator/runMain org.apache.texera.operatorreference.OperatorDocScanner".No page is changed in this PR. The regenerated pages follow in a separate PR so their diff can be reviewed on its own.
Any related issues, documentation, discussions?
Closes #9031
How was this PR tested?
sbt OperatorReferenceGenerator/test(14 tests),scalafmtCheckandscalafix --checkpass. Running the generator on current main produces the pages submitted in the follow-up PR.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5.1)