Repository navigation
refactor: narrow asap-types test-only fields and frontend visibility (#1054 step 8b, part 2) - #1099
Merged
zzylol merged 1 commit intoOct 30, 2026
Conversation
…step 8b, part 2) asap-types: fields and methods that only tests read outside the crate become pub(crate). Tests reach them through accessors and constructors under `test-support` (SummaryCoverage, SelectionBox, ColumnIdentity, MaterializedView, ViewCoverage, MaterializedViewInputs, RawDataWindow, RawDataRetention, PhysicalASAPDAGEdge, FamilyCapability) or through `asap_types::test_support` wrappers for methods the crate itself uses (output_schema, validate_inputs, matches_node, timed, lookback_ms, is_materialized_view). `Schema::has_unique_key` and `compile_physical_asap_dag` are test-only and go under `test-support`. Frontends: the `error`, `histogram`, `promql`, `sql`, `frequency`, `resolve`, `schema_resolver` and `unresolved` modules become private (one public path per item). `SqlLowerer`, `SchemaResolver`, `SchemaCatalog`, `UsageDerivedCatalog` and `resolve_expr` become pub(crate). Single-query MetricsQL entry points and the SQL unresolved lowering move to new `test_support` modules behind `test-support`. Deleted: `HistogramCatalog::is_empty`, `UnresolvedOp::scalar_exprs`. The executor's and integration-tests' fixture code enable `asap-types/test-support` for the test-only DAG helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw
This was referenced Oct 30, 2026
zzylol
added a commit
that referenced
this pull request
Oct 30, 2026
…cal, executor) (#1109) * test(executor): set the semijoin edges' timing through data_state_mut #1099 rewrote `edge.data_state.timing = phase` as `edge.data_state().timing = phase`, which assigns to a copy: the edges kept QueryTime while the nodes moved to IngestionTime, and bind rejected the DAG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw * test(logical): update Pass 1 expectations for memo-group targets (P3c) #1106 (P3c) walks memo groups: structurally equal aggregates and HAVING filters are one group, with one target per (group, measure) and HAVING placed per group; roots are named by workload index, and an inventory matches any DAG built from structurally equal roots. - having_on_one_consumer_of_a_shared_aggregate_stays_above: two equal HAVING filters are one group, so one entry. - memo_cached_rules_preserve_occurrence_specific_having: the two equal aggregates are one target; its HAVING stays above the output because an unfiltered consumer reads the group. - assigned_physical_annotation_asap_input_and_invalid_accuracy_are_rejected: InvalidAccuracy names the root by workload index ("0"); doc comment updated. - population_rejects_an_inventory_from_other_roots: the other roots now differ structurally (the same query text is the same DAG). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw * test(frontend-promql): move planner-facade helpers out of support.rs support.rs is also compiled by the private corpus, which does not depend on asap-planner. run_stage1_to_stage3 and selected_dag (asap-planner since #1107) move to planner_support.rs, used only by this crate's test binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
added a commit
that referenced
this pull request
Oct 30, 2026
…ay public API (#1114) tools/verify_metricsql_external_consumer.sh (CI) treats them as a stable external dependency; #1099 had moved them behind test-support. Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1054 (step 8b, part 2). Merges into the integration branch
refactor/stage-boundaries. Tests run for the whole branch before it merges to main.Why
#1054's rule: an item is
pubonly if another crate's non-test code uses it. #1094 applied it to physical, cost, accuracy and part of asap-types. This PR applies it to the rest of asap-types, the four frontend crates and asap-planner.What
Visibility, accessors, test-only paths and two deletions. There are no behavior changes.
SummaryCoverage.{definition, selection},SelectionBox,ColumnIdentity,MaterializedView.{refresh, coverage, retention_ms},ViewCoverage,MaterializedViewInputs.raw_data_windows,RawDataWindow,RawDataRetention,PhysicalASAPDAGEdgefields,FamilyCapability.readoutspub(crate); addednewand accessorsoutput_schema,validate_inputs,matches_node,NodeToTimedNodeCache::timed,RawDataWindow::lookback_ms,Materialization::is_materialized_viewpub(crate); tests call them through wrappers inasap_types::test_supportNonASAPOp/ASAPOpchildren,map_children,kind_namepub(crate)Operator/OperatorNodeversionsSchema::has_unique_key,compile_physical_asap_dagtest-supportSchemaResolver,SchemaCatalog,UsageDerivedCatalog,resolve_expr,UnresolvedScalarhelpers)pub(crate), no root re-exporterror,histogram,promql,sql,frequency,resolve,schema_resolver,unresolvedSqlLowerer; metricsqlparse_metricsql,canonical_metricsql,lower_metricsql*pub(crate); reached through each crate'stest_supportpubis entry API that the backend usesDeleted:
HistogramCatalog::is_emptyandUnresolvedOp::scalar_exprs; neither has users.Deferred (only logical or plan-selection
src/tests read these; they are handled in P7 or #1095):DemandEstimate.{observed_at, valid_for}SupplierStorageMetrics.logical_connectionsMaintainedPopulation.{max_k, quantiles}CurrentSeriesInput.{metric, matchers}LabelSetDistinctValuesfieldsSchema::liftedPhysicalMemoCandidates::implementation_rootsHow
pubfield and method in the target crates was set topub(crate).pubwas restored on each item whose removal broke the build. In asap-types, 47 items survived.::newconstructors andtest_support::paths.test-support;test-supportenablesasap-types/test-support;asap-types/test-support.Key code interfaces added / modified
The new test-only modules
asap_frontend_sql::test_supportandasap_frontend_metricsql::test_support, plus more wrappers inasap_types::test_support.Usage: a test that needs
lower_metricsqlenablesasap-frontend-metricsql/test-supportin its dev-dependencies and callsasap_frontend_metricsql::test_support::lower_metricsql(..).The private corpus's shared
frontend-promql/tests/support.rsstill compiles with onlyasap-types/test-support.Major algorithm changes
None.
Before / After
Verification
At
87d769181(onrefactor/stage-boundariesafter #1098):cargo clippy --workspace --all-targets -D warningsare clean.cargo build -p asap-devtools --binsandcargo check --workspace --exclude asap-integration-tests --lib --binsbuild with notest-supportfeature.cargo doc: no new warnings.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw