fix: feature-gate ledger-core's dependency on ledgerr-gcp-billing (#243) - #247
Merged
Merged
Conversation
ledger-core had a hard (non-optional) dependency on ledgerr-gcp-billing, which pulls tokio with the process feature into the core crate even when GCP billing ingestion is not needed. Changes: - Make ledgerr-gcp-billing optional in ledger-core/Cargo.toml - Add `gcp-billing` cargo feature behind the optional dep - Gate BigQueryFocusIngestOp struct + LedgerOperation impl with #[cfg(feature = "gcp-billing")] - Gate the IngestBigQueryFocus dispatcher match arm; provide a NotImplementedOp fallback when the feature is disabled - Enable the gcp-billing feature in ledgerr-mcp's ledger-core dep (ledgerr-mcp already depends on ledgerr-gcp-billing directly) - Gate the bigquery_focus_ingest_op_is_idempotent test The OperationKind::IngestBigQueryFocus enum variant remains always available (it's plain data with no dep implications). Without the feature, the dispatcher returns NotImplemented for that kind. Closes #243
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
Makes an optional dependency of , gated behind a new
gcp-billingcargo feature. This prevents tokio (with the process feature) from being pulled into the core crate when GCP billing ingestion is not needed.Changes
optional = true; new featuregcp-billing = ["dep:ledgerr-gcp-billing"]BigQueryFocusIngestOpstruct and itsLedgerOperationimpl are gated with#[cfg(feature = "gcp-billing")]IngestBigQueryFocusdispatcher match arm uses aNotImplementedOpfallback when the feature is offbigquery_focus_ingest_op_is_idempotenttest is feature-gatedgcp-billingfeature on itsledger-coredependency (ledgerr-mcp already depends on ledgerr-gcp-billing directly)What stays the same
OperationKind::IngestBigQueryFocusenum variant remains always available (plain data, no dep implications)NotImplementedfor that kindVerification
cargo check -p ledger-core— passes (feature off, no gcp-billing dep)cargo check -p ledger-core --features gcp-billing— passes (feature on)cargo check -p ledgerr-mcp— passes (enables the feature)Closes #243