Skip to content

feat(operator-reference): add a generator for the operator reference pages - #9032

Merged
mengw15 merged 14 commits into
apache:mainfrom
xuang7:feat/operator-reference-generator
Nov 19, 2026
Merged

mengw15 merged 14 commits into
apache:mainfrom
xuang7:feat/operator-reference-generator

Conversation

@xuang7

@xuang7 xuang7 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added feature dependencies Pull requests that update a dependency file ci changes related to CI docs Changes related to documentations common labels Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan, @Xiao-zhen-Liu
    You can notify them by mentioning @aglinxinyuan, @Xiao-zhen-Liu in a comment.

@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.60%. Comparing base (52093b4) to head (c79cb90).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø)
amber 85.33% <ø> (ø) Carriedforward from 52093b4
computing-unit-managing-service 64.05% <ø> (ø)
config-service 87.73% <ø> (ø)
file-service 82.31% <ø> (ø)
frontend 96.42% <ø> (ø) Carriedforward from 52093b4
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.50% <ø> (ø)
workflow-compiling-service 78.30% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

xuang7 and others added 4 commits October 20, 2026 22:57
…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]>
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 8 worse · ⚪ 7 noise (<±5%) · 0 without baseline

Compared against main 52093b4 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

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

@carloea2 carloea2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/build.yml Resolved
xuang7 and others added 3 commits November 1, 2026 19:12
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]>
@xuang7
xuang7 requested a review from carloea2 November 2, 2026 01:43

@carloea2 carloea2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
mengw15 requested a balanced review from Copilot November 13, 2026 19:04

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The comment is for the follow-up that regenerates the pages, not a blocker here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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 OperatorDocScanner to generate operator pages, group indexes, root index, and parameter pages.
  • Adds JsonPropertyReflectionUtils to 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

@mengw15
mengw15 enabled auto-merge November 19, 2026 00:09
@mengw15
mengw15 added this pull request to the merge queue Nov 19, 2026
Merged via the queue into apache:main with commit f1a6bed Nov 19, 2026
64 of 66 checks passed
Ma77Ball pushed a commit to Ma77Ball/texera that referenced this pull request Nov 21, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI common dependencies Pull requests that update a dependency file docs Changes related to documentations feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate the operator reference pages from the operator source code

5 participants