refactor: map structured plan appendices from spannerplan - #1017
Conversation
Adopt github.com/apstndb/spannerplan@195dc13 (PR 65) via a temporary pseudo-version and replace the local appendix formatter with a small mapping to ResultAppendix. Propagate BuildAppendices errors through processPlan, buildQueryPlanAppendix, and buildExplainAnalyzeResult. Keep CLI section resolution, predicate markers, and query-mode output unchanged. Do not enable scalar-variable resolution.
Preserve the historical Result.Appendices nil contract for EXPLAIN output that has no selected appendix lines.
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (7c2ac86) | #1017 (ab5f872) | +/- |
|---------------------|----------------|-----------------|-------|
- | Coverage | 87.4% | 87.4% | -0.1% |
| Files | 132 | 132 | 0 |
| Lines | 13287 | 13235 | -52 |
- | Covered | 11625 | 11579 | -46 |
+ | Code to Test Ratio | 1:2.5 | 1:2.5 | +0.0 |
| Code | 28894 | 28783 | -111 |
- | Test | 72564 | 72561 | -3 |
- | Test Execution Time | 2m38s | 3m10s | +32s |Code coverage of files in pull request scope (88.9% → 89.0%, patch 100.0%)
Reported by octocov |
Replace the temporary pseudo-version with the released github.com/apstndb/spannerplan@v0.3.1 (69dd04e). Assert literal predicate and ordering appendix lines, and require the specific full-section validation error instead of any non-nil error.
|
Reviewed f1749b6: no actionable findings. The final release pin and stronger literal/error-cause assertions are covered by current-head review. Independent |
Resolve explain_print_sections.go by keeping BuildAppendices mapping and dropping the local appendix helpers reintroduced on main. Retain released spannerplan v0.3.1.
|
Reviewed The integration conflict correctly retains the removal of local appendix helpers now supplied by released spannerplan v0.3.1. Explicit empty print sections, raw scalar descriptions, ordered appendix mapping, legacy predicates, and error propagation remain covered. The other integration changes match the automatic main merge. Independent An earlier local run exposed an existing telemetry shutdown diagnostic test failure; that failed log is retained, and the focused rerun, complete rerun, independent check, and hosted checks passed. The telemetry test concern is tracked separately from this appendix change. |
Replace the CLI's duplicated EXPLAIN appendix formatter with
reference.BuildAppendicesfrom releasedspannerplan v0.3.1. The CLI maps structured sections intoResultAppendixand the legacy predicate slice, and propagates builder errors.Existing section overrides, explicit empty/NONE selection, predicate markers, raw scalar descriptions, ordering, whitespace and nil results are preserved. The change does not enable scalar-variable resolution or alter default metadata display.
Tests retain CLI option selection, representative literal output, real-plan integration and the specific invalid-section error cause. Duplicate classification/formatting cases remain covered by the library.
Validation:
make checkwith Go 1.26.8 and golangci-lint 2.13.2, focused appendix tests, independent current-head source review, and all required CI checks including the full race suite. A local race run failed during an existing 30 ms transaction-timeout test's setup; its isolated rerun and the final-head CI race suite passed.Physical line changes against
1b8003f: application production -120, tests -2, fixtures unchanged. Including the library's +56 production / +88 test-example lines gives combined production -64, tests +86, total +22. This consolidates duplicated implementation; it is not a net reduction in total maintained lines.