Skip to content

fix: feature-gate ledger-core's dependency on ledgerr-gcp-billing (#243) - #247

Merged
elasticdotventures merged 1 commit into
mainfrom
fix/feature-gate-gcp-billing
Sep 7, 2026
Merged

fix: feature-gate ledger-core's dependency on ledgerr-gcp-billing (#243)#247
elasticdotventures merged 1 commit into
mainfrom
fix/feature-gate-gcp-billing

Conversation

@elasticdotventures

Copy link
Copy Markdown
Member

Summary

Makes an optional dependency of , gated behind a new gcp-billing cargo feature. This prevents tokio (with the process feature) from being pulled into the core crate when GCP billing ingestion is not needed.

Changes

  • ****: is now optional = true; new feature gcp-billing = ["dep:ledgerr-gcp-billing"]
  • ****:
    • BigQueryFocusIngestOp struct and its LedgerOperation impl are gated with #[cfg(feature = "gcp-billing")]
    • The IngestBigQueryFocus dispatcher match arm uses a NotImplementedOp fallback when the feature is off
    • The bigquery_focus_ingest_op_is_idempotent test is feature-gated
  • /tmp/fileYUAbIH: Enables gcp-billing feature on its ledger-core dependency (ledgerr-mcp already depends on ledgerr-gcp-billing directly)

What stays the same

  • OperationKind::IngestBigQueryFocus enum variant remains always available (plain data, no dep implications)
  • Without the feature, the dispatcher returns NotImplemented for that kind
  • ledgerr-mcp continues to work exactly as before

Verification

  • 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

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
@elasticdotventures
elasticdotventures merged commit 3e9e3f4 into main Sep 7, 2026
9 checks passed
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.

feat: feature-gate ledger-core dep on ledgerr-gcp-billing

1 participant