EAI-8032: Modularize crates/e2e-report/src/lib.rs - #433
Conversation
A code review of PR #433 caught that several types/fields/methods that are only ever used within a single file were still marked pub(crate) from the split, inconsistent with sibling types (Grid, GridColumn, ReconciledTally) that correctly stayed private: Descriptor, parse_descriptor, PlatformReport (struct, fields, and its load/ok/ status_text/display_counts methods), CommandRecord, PlatformVersions (struct, os field, and platform_stack), and CellOutcome all live and die within consolidated.rs. scenario_block, step_row, and format_utc are likewise only called within components.rs. No behavior change: cargo build/clippy/test all pass identically before and after (46/46 tests). Signed-off-by: Jussi Elo <jussi.elo@amd.com>
|
🔴 Automated review · pr-review-watcher · 8cc878a This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer. SummarySplits the 3,228-line 🚫 Blocking (must fix before merge)None. Non-blocking
|
siloteemu
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · 8cc878a
This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer.
Summary
Splits the 3,228-line crates/e2e-report/src/lib.rs into parse.rs, single_report.rs, consolidated.rs and components.rs, leaving lib.rs as module declarations plus re-exports, and updates the architecture doc; a second commit narrows visibility that the split had over-widened. The refactor is behaviour-preserving as claimed — the only defect found is a factual error in the documentation the PR itself adds. Verified: I diffed against both the base tip and the true merge base (they differ — merge base 738690d, base tip 8788394 — but the changed-file set is identical; findings below use the merge base); a per-item body comparison of all 121 top-level items showed every moved body byte-identical to its original modulo added visibility modifiers, the derive/attribute multiset is unchanged, the public API surface is item-for-item identical, all 46 test function names and bodies are unchanged, and the one targeted check I ran (building and testing this crate alone) produced zero warnings and 46/46 passing — the full test suite and the workspace-wide build were not run here. Because this is a pure move, reverting it would leave all 46 tests passing unchanged; that is the correct shape for a refactor — the tests are the control proving equivalence, not a detector of the move — and single-symbol mutation is covered by the compiler, since narrowing any genuinely cross-module item to private fails to build. The second commit changes visibility only, no bodies, and restores these items to exactly the privacy they had before the split. Leak scan clean; no prompt-injection content found. Checks at review start: 23 success, 2 failure, 1 pending, 1 skipped — I did not attribute those failures to any job and cannot confirm their cause. Blocking: 0 · Non-blocking: 5.
🚫 Blocking (must fix before merge)
None.
Non-blocking
docs/architecture.md:60— the new text says lib.rs is "just pub mod + pub use re-exports of the crate's public API", but the four module declarations atcrates/e2e-report/src/lib.rs:11-14are privatemod. A reader would conclude paths through the module names are reachable by consumers; they are not. The same file at line 17 states the convention for library crates as public modules plus a re-export, so the PR both misdescribes its own code and quietly departs from the convention stated just above — in the one document whose job is describing module structure. Either reword the sentence to say the modules are private with public re-exports and say why, or make the declarations public to match the convention; the first is smaller and the better encapsulation. The same wording is in the first commit's message, so it is worth fixing there too if the branch is amended. Raised as non-blocking because nothing in the code is wrong and a reader acting on the mistaken reading is corrected by the compiler immediately — but it is the most substantial item here, and this is the document people will reach for later.- The test helpers
feature_jsonandwrite_reportare now duplicated byte-identically intocrates/e2e-report/src/parse.rsandcrates/e2e-report/src/consolidated.rs; nothing catches a future divergence at compile time, so a change to the fixture JSON shape must be remembered in both places. crates/e2e-report/src/single_report.rs:15-17inlines file read plus JSON deserialization rather than callingparse::parse_features. This is byte-identical to the original and predates the PR, but the split makesparse.rsthe designated owner of parsing, so it now reads as a boundary violation worth a follow-up.crates/e2e-report/src/consolidated.rsis still 2,524 lines and carries 34 of the 46 tests; the split's stated seam is parsing-versus-rendering, and the consolidated module holds both a data model and two generators. Reasonable for a first phase, but the module is not yet at a size the convention would call settled.- On what invited the wrong conclusion here: the misstatement appears in both the doc and the commit message, so a reader checking either surface is told the modules are public. Correcting the architecture doc sentence is the cheap fix that stops this recurring, since that doc is the reference future readers will reach for.
lib.rs uses private mod + pub use, not pub mod + pub use as the prior wording said (per siloteemu's review on PR #433) — correct the doc to describe the actual visibility and why it's tighter than the full-domain-extraction convention's default. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
|
Re @siloteemu's review (#pullrequestreview-5302435744): Fixed — Left as-is — the other three non-blocking points each ask for a change that would override a rule this PR is deliberately following, per parent epic EAI-7768:
|
|
🔴 Automated review · pr-review-watcher · f292b13 This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer. SummaryPure module split: 🚫 Blocking (must fix before merge)None. Note on what is not blocking: an automated check of the visibility narrowing initially flagged Non-blocking
|
siloteemu
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · f292b13
This is a formal review recording our position on the record. It is deliberately non-gating: this automation files no approval, so no approving review will appear here whatever the outcome, and the merge decision stays with a human reviewer.
Blocking: 0 · Non-blocking: 5. This round reviewed a pure module split of the reporting crate, verified item by item against the merge base: every top-level item accounted for, test count unchanged at 46 with byte-identical bodies, public surface unchanged, module graph acyclic. Behaviour-preserving as claimed.
Check conclusions this review worked from, read at this exact head immediately before publishing: 24 success, 1 skipped, 1 pending, 1 failure.
The full findings, including the non-blocking items, are in the review comment posted alongside this one.
|
Re @siloteemu's second review (#pullrequestreview-5303647961): Fixed — Left as-is — the remaining four non-blocking points:
|
juhovainio
left a comment
There was a problem hiding this comment.
Checked this out and ran it rather than just reading the diff. Public API is byte-identical to what main's lib.rs exported (XfailReport, evaluate_xfail, scenario_results_by_id, generate, RunMeta, generate_consolidated, consolidated_summary_markdown), the module split matches what the description claims (stats_bar in components.rs, matrix_table/legend/platform_section/Descriptor/RunMeta in consolidated.rs, components.rs importing only from parse.rs so the module graph stays acyclic), and cargo test -p e2e-report gives 46/46 passing with clippy clean on the actual head commit. xtask and tests/e2e-cucumber build against the refactored crate with no source changes, as claimed. docs/architecture.md's updated entry matches the real file layout.
The two failing E2E lanes (Strix Halo Ubuntu, Strix Halo WSL2) are unrelated infra flakes, not this PR: one is the known VRAM-preflight timeout, the other is a silent crash after a lemonade backend download failure from GitHub releases mid-run. Neither touches anything in this report-formatting crate.
This reads like exactly what it claims to be: pure code motion, no behavior change. Approving.
|
🔴 Automated review · pr-review-watcher · d1cd42c This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer. SummarySplits 🚫 Blocking (must fix before merge)None. Non-blocking
|
siloteemu
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · d1cd42c
Blocking: 0. This is a formal review record, not an approval — this account files no GitHub approvals.
Verified as a genuine pure move: 75 non-test items relocated with identical bodies, 46 tests before and after with identical names and bodies, no attribute changes, and the crate's exported surface unchanged. The visibility-narrowing asked for in the previous round is fully answered.
Three non-blocking items and the full verification detail are in the review comment posted alongside this one.
|
Reviewed the current head ( The split preserves all 75 production items and the same seven-item public API; all 46 tests retain identical bodies, and CI caveat: workflow run #1550 still has two failing self-hosted E2E lanes. Ubuntu failed GPU preflight because no VRAM was free; WSL2 stopped during an unrelated E2E scenario after compiling this crate successfully, without a diagnostic tying the failure to this refactor. I recommend merging once those red checks are rerun or otherwise dispositioned. This comment is a diff-review result, not a formal approval. |
Split the 3,228-line lib.rs (Phase 1 of the EAI-7768 modularization epic) along the parsing-vs-rendering seam: parse.rs (cucumber JSON data model, parsing, xfail evaluation), single_report.rs (single-platform HTML report), consolidated.rs (PlatformReport/ manifest/expectation model, the reconciled scenario x platform Grid, and multi-platform HTML/markdown generation), and components.rs (shared maud HTML fragments plus the CSS/timestamp helpers both generators use). lib.rs is now pub mod + pub use re-exports only. Cluster boundaries were re-verified against current main rather than the ticket's stored line ranges (already stale at authoring time), which surfaced three placements that diverge from the ticket's line-range estimate: stats_bar into components.rs (renders Markup, not data), Descriptor/RunMeta into consolidated.rs (neither is used by the single-platform generate()), and matrix_table/legend/ platform_section into consolidated.rs rather than components.rs (they render PlatformReport, a consolidated-only type, so keeping them in components.rs would have required a dependency back on consolidated.rs). Pure code motion, no behavior change: same 46 unit tests, moved and colocated with the code they exercise, all passing; xtask and tests/e2e-cucumber build against the crate with zero call-site changes. Also updates docs/architecture.md's crates/e2e-report entry to describe the new module map, per EAI-7768's rule that documentation lands in the same PR as the code it documents. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
A code review of PR #433 caught that several types/fields/methods that are only ever used within a single file were still marked pub(crate) from the split, inconsistent with sibling types (Grid, GridColumn, ReconciledTally) that correctly stayed private: Descriptor, parse_descriptor, PlatformReport (struct, fields, and its load/ok/ status_text/display_counts methods), CommandRecord, PlatformVersions (struct, os field, and platform_stack), and CellOutcome all live and die within consolidated.rs. scenario_block, step_row, and format_utc are likewise only called within components.rs. No behavior change: cargo build/clippy/test all pass identically before and after (46/46 tests). Signed-off-by: Jussi Elo <jussi.elo@amd.com>
lib.rs uses private mod + pub use, not pub mod + pub use as the prior wording said (per siloteemu's review on PR #433) — correct the doc to describe the actual visibility and why it's tighter than the full-domain-extraction convention's default. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Match the single-long-line style every neighboring crate entry uses; the hard-wrapped paragraph was the only outlier in the file. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
d1cd42c to
0b6d110
Compare
Summary
Phase 1 of the rocm-cli modularization epic (EAI-7768): splits
crates/e2e-report/src/lib.rs(3,228 lines) along the parsing-vs-rendering seam. Picked first because it's a leaf crate (onlyxtaskandtests/e2e-cucumberdepend on it) — lowest blast radius, good place to validate the phased-modularization workflow before touching riskier files.parse.rs— cucumberreport.jsondata model, parsing,@expected-failurexfail evaluationsingle_report.rs— single-platform HTML report generation (generate())consolidated.rs— thePlatformReport/manifest/expectation model, the reconciled scenario × platformGrid, and the multi-platform HTML/markdown generation built on top (the largest module)components.rs— shared maud HTML fragment rendering, plus the CSS and timestamp helpers both generators use; depends only onparse.rstypes to keep the module graph acycliclib.rsis now justpub mod+pub usere-exports of the crate's existing public surface (XfailReport,evaluate_xfail,scenario_results_by_id,generate,RunMeta,generate_consolidated,consolidated_summary_markdown) — zero call-site changes needed inxtaskortests/e2e-cucumberdocs/architecture.md'scrates/e2e-reportentry to describe the new module map, in the same PR per EAI-7768's rule against deferring documentationPure code motion — no behavior change.
Boundary deviations from the ticket's stated line ranges
EAI-7768 requires re-verifying cluster boundaries against current
mainby function/module name rather than trusting a child ticket's stored line ranges (historical estimates that drift). Doing that surfaced three placements that diverge from EAI-8032's line-range estimate:stats_bar→components.rs, notparse.rs— it rendersMarkup, not data.Descriptor/RunMeta→consolidated.rs, notsingle_report.rs— neither is used by the single-platformgenerate().matrix_table/legend/platform_section→consolidated.rs, notcomponents.rs— they renderPlatformReport(a consolidated-only type); keeping them incomponents.rswould have forced a dependency back onconsolidated.rs.Also: two small test helpers (
feature_json,write_report) are intentionally duplicated betweenparse.rs's andconsolidated.rs's test modules, since both need them and there's no shared test-utils module in this crate.Test plan
cargo build -p e2e-report,cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --check— all cleancargo test -p e2e-report: 46/46 pass — same count asmain's original#[test]total, confirmed independently by grep-counting#[test]and by diffing the full set of item declarations (fn/struct/enum/impl/const names) betweenmain'slib.rsand the concatenated new filesxtaskandtests/e2e-cucumberbuild cleanly against the refactored crate with no source changescargo xtask manifest --check— cleanprek run --no-group local-tools(matching CI's own invocation) — cleancargo nextest(not installed here;cargo testexercises the same test binary) and the Windows CI job (nothing in this crate is platform-conditional, so no local Windows-specific check applies)Checklist
Task);grep -n "EAI-8032" tests/e2e-cucumber/expectations.tomlreturns no match, so there are no xfail rows tied to this ticket to narrowgit diff main --stattouches onlycrates/e2e-report/**anddocs/architecture.md, noapps/rocm/apps/rocmdclap/dispatch changes. This PR reorganizes an existing subsystem rather than adding one, but the result follows the same full-domain-extraction conventiondocs/architecture.mddescribes (each new module owns its own types), and that doc'scrates/e2e-reportentry is updated in this PR to reflect it.