Fix dead-code/unused-import warnings across backend feature matrix#300
Merged
Conversation
The default `cargo build` reported two dead-code warnings in `crates/hfs/src/main.rs` (`build_embedded_job_store`, `composite_ops`): each was compiled unconditionally (or on just `sqlite`) but its only callers live behind backend features not in the default set. Rather than silence with `#[allow(dead_code)]`, gate each item to the feature combination where it is actually reachable. The same class of pre-existing warnings in the non-default `mongodb`/`s3` builds is cleaned up at the same time: - build_embedded_job_store: all(sqlite, any(mongodb, all(s3, elasticsearch))) - composite_ops / build_search_registry (+test): elasticsearch / all(s3, elasticsearch) - validate_shared_sqlite_audit_path (+test): sqlite - standalone_ops, seed_search_parameters: any(sqlite, postgres, mongodb) - wire_reindex: any(sqlite, postgres, mongodb, elasticsearch) - bulk-export + reindex imports: matching gates - helios-persistence default_fhir_version: any(sqlite, postgres, mongodb, elasticsearch) (the S3 config carries no fhir_version field) No functional behavior changes — compile-time gating only. Verified clean across 15 backend feature combinations plus default/postgres/s3+es test compiles. Claude-Session: https://claude.ai/code/session_019rC2FHkrJ7uuiiZHDcYmvM
Resolves conflicts in crates/hfs/src/main.rs: - `SearchParameterExtractor` import dropped (main removed its last use); the feature gate stays on the remaining `ReindexOperation` import. - `seed_search_parameters` renamed to main's `seed_conformance_resources` (now seeds CompartmentDefinitions and every provisioned tenant) while keeping this branch's `any(sqlite, postgres, mongodb)` gate; its new helper `provisioned_tenants` gets the same gate, since the seeder is its only caller. Claude-Session: https://claude.ai/code/session_019oB9RGbkGJoBzjWQErD4kh
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
aacruzgon
added a commit
that referenced
this pull request
Jul 20, 2026
) Conflict in crates/hfs/src/main.rs: main gated wire_reindex behind any(sqlite, postgres, mongodb, elasticsearch) to fix dead-code warnings in the S3-only build (#300), while this branch had extended it with the cluster job store (reindex_cluster_store + worker spawning). Resolution keeps the cluster-capable wire_reindex and applies main's feature gate to both it and reindex_cluster_store — neither is reachable in an S3-only build, since every call site lives in a standalone (sqlite/postgres/mongodb) or composite (*-elasticsearch) serve path. Tests: hfs cluster unit tests pass; cargo check clean (0 warnings) on default, R4+s3, R4+s3+es, and R4+sqlite+es+ui; CI-style clippy clean with --all-features. Claude-Session: https://claude.ai/code/session_01Xu9e637x8LFsRmvSbLACZv
aacruzgon
added a commit
that referenced
this pull request
Jul 20, 2026
The E1 durability warning helper's only non-test caller sits behind cfg(feature = "elasticsearch") (composite modes only exist there), so the default sqlite build reported it as dead code — the same class of warning main just cleaned up in #300. Gate it any(test, elasticsearch) so its unit tests still compile in every feature combination. Tests: hfs cluster unit tests pass on default features. Claude-Session: https://claude.ai/code/session_01Xu9e637x8LFsRmvSbLACZv
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.
Summary
cargo build(default featuresR4, sqlite, ui) reported two dead-code warnings incrates/hfs/src/main.rs—build_embedded_job_storeandcomposite_ops— each compiled unconditionally (or on justsqlite) while its only callers live behind backend features not in the default set.Rather than silence with
#[allow(dead_code)], this gates each item to the feature combination where it is actually reachable. Verifying across the backend feature matrix surfaced the same class of pre-existing warnings in the non-defaultmongodb/s3builds, which are cleaned up in the same pass.Changes
crates/hfs/src/main.rsbuild_embedded_job_store→all(sqlite, any(mongodb, all(s3, elasticsearch)))— standalone S3 deliberately doesn't wire bulk exportcomposite_ops,build_search_registry(+ its test) →elasticsearch/all(s3, elasticsearch)validate_shared_sqlite_audit_path(+ its test) →sqlitestandalone_ops,seed_search_parameters→any(sqlite, postgres, mongodb)wire_reindex→any(sqlite, postgres, mongodb, elasticsearch)ReindexOperation/SearchParameterExtractorimports → matching gatescrates/persistence/src/lib.rsdefault_fhir_version→any(sqlite, postgres, mongodb, elasticsearch)(the S3 config carries nofhir_versionfield)No functional behavior changes — compile-time gating only.
Verification
cargo build(full workspace): cleanpostgres-only, ands3,elasticsearch: cleanhttps://claude.ai/code/session_019rC2FHkrJ7uuiiZHDcYmvM