Skip to content

refactor(server): modularize the test monolith and lib.rs — pure code movement#192

Merged
aaltshuler merged 3 commits into
mainfrom
refactor/server-modularize
Jun 11, 2026
Merged

refactor(server): modularize the test monolith and lib.rs — pure code movement#192
aaltshuler merged 3 commits into
mainfrom
refactor/server-modularize

Conversation

@aaltshuler

Copy link
Copy Markdown
Collaborator

Second modularization PR (same pattern as #188): verbatim moves + visibility bumps, zero behavior change, suite green per commit. Prepares the server for PR 3 of the object-storage arc (bucket-backed --cluster serving), which lands as focused diffs against settings.rs/handlers.rs instead of a 3.8k-line monolith.

tests/server.rs (6,517 lines, 110 tests) → seven area suites

File Tests Area
data_routes.rs 27 read/query/change/ingest/branches/snapshot/export
boot_settings.rs 27 settings loading + mode inference (the multi_graph_startup mod)
auth_policy.rs 21 bearer auth, actor resolution, Cedar decisions, admission
schema_routes.rs 19 schema read/apply over HTTP, drift, gating
stored_queries.rs 11 registry boot, /queries listing, invocation
multi_graph.rs 4 cluster boot + the concurrent branch-ops matrix
s3.rs 1 gated S3 single-graph serving

Shared helpers (app builders, policy YAML fixtures, the matrix harness, EnvGuard) live in tests/support/mod.rs.

src/lib.rs (3,793) → lib 1,158 + handlers 1,666 + settings 988

handlers.rs: route handlers, auth middleware, per-request authorization, the cluster-prefix OpenAPI rewrite. settings.rs: omnigraph.yaml/CLI/env resolution, mode inference, bearer-token sources, runtime-state classification + its in-source tests. lib.rs keeps public types, router assembly, serve(). Public API unchanged (pub use re-exports preserved).

Guarantees

289 crate tests green (including the OpenAPI drift check — no spec change); full cargo test --workspace --locked green (52 suites). One-time git blame discontinuity, as with #188.

🤖 Generated with Claude Code

aaltshuler and others added 2 commits June 11, 2026 15:03
tests/server.rs (6,517 lines, 110 tests) becomes seven area files —
auth_policy, data_routes, schema_routes, stored_queries, multi_graph,
boot_settings, s3 — with shared helpers in tests/support/mod.rs. Verbatim
moves + visibility bumps (pub on helpers, pub(super)->pub inside the
matrix harness); cargo fix stripped the per-file unused imports. All 110
tests pass in their new homes (289 across the crate including lib and
openapi).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Verbatim moves: route handlers + bearer-auth middleware + per-request
authorization + the cluster-prefix OpenAPI rewrite go to handlers.rs;
settings resolution (omnigraph.yaml/CLI/env, mode inference, bearer-token
sources, runtime-state classification) and its in-source test mod go to
settings.rs. lib.rs (1,158 lines) keeps the public types, app/router
assembly, and serve(). The ApiDoc derive references handlers::-qualified
paths; the one multi-line utoipa attribute the cut orphaned was relocated
with its handler. 289 crate tests green, OpenAPI drift check included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

aaltshuler has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

The test-split renamed tests/server.rs away; the job now targets --test
s3. Also fixes a stale name filter (s3_repo vs the actual s3_graph test):
a substring filter matching nothing passes vacuously, so this step had
been running zero tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

aaltshuler has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@aaltshuler aaltshuler merged commit c116a12 into main Jun 11, 2026
8 checks passed
@aaltshuler aaltshuler deleted the refactor/server-modularize branch June 11, 2026 12:37
aaltshuler added a commit that referenced this pull request Jun 12, 2026
Lands an orphaned-but-accurate working-tree edit (the engine table rows
for forbidden_apis.rs, lance_surface_guards.rs, traversal_indexed,
proptest_equivalence, ordering, literal_filters, policy_engine_chassis —
all real files; 21 -> 28 count) and replaces the stale pre-modularization
crate rows: the CLI and server entries now describe the per-area suites
(#192/#193 splits) plus this cycle's additions (RFC-008 deprecation
coverage, keyed-credential auth, hermetic OMNIGRAPH_HOME harness, the
bucket-gated s3 suites).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aaltshuler added a commit that referenced this pull request Jun 12, 2026
Lands an orphaned-but-accurate working-tree edit (the engine table rows
for forbidden_apis.rs, lance_surface_guards.rs, traversal_indexed,
proptest_equivalence, ordering, literal_filters, policy_engine_chassis —
all real files; 21 -> 28 count) and replaces the stale pre-modularization
crate rows: the CLI and server entries now describe the per-area suites
(#192/#193 splits) plus this cycle's additions (RFC-008 deprecation
coverage, keyed-credential auth, hermetic OMNIGRAPH_HOME harness, the
bucket-gated s3 suites).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant