Skip to content

refactor: gate sketches with feature flags #120

Merged
tisonkun merged 16 commits into
mainfrom
feature-flag
May 9, 2026
Merged

refactor: gate sketches with feature flags #120
tisonkun merged 16 commits into
mainfrom
feature-flag

Conversation

@tisonkun
Copy link
Copy Markdown
Member

@tisonkun tisonkun commented May 9, 2026

This closes #32

Some unused warnings and style issues can be fixed later.

tisonkun added 5 commits May 9, 2026 14:15
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun requested review from Copilot and notfilippo May 9, 2026 06:40
@tisonkun tisonkun marked this pull request as draft May 9, 2026 06:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces per-sketch Cargo feature flags in the datasketches crate, gates each sketch module behind its corresponding feature, and updates integration tests (and xtask test) to run conditionally based on those features.

Changes:

  • Add [features] to datasketches and gate sketch modules in src/lib.rs behind #[cfg(feature = "...")].
  • Gate sketch integration tests behind the same feature flags (e.g., #![cfg(feature = "theta")]).
  • Update xtask test to discover and enable sketch features via cargo_metadata, and add cargo_metadata as a workspace dependency.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xtask/src/main.rs Enables running workspace tests with the set of features discovered from datasketches via cargo_metadata.
xtask/Cargo.toml Adds cargo_metadata dependency to support feature discovery.
datasketches/src/lib.rs Gates sketch modules (theta, hll, etc.) behind per-sketch Cargo features.
datasketches/Cargo.toml Introduces per-sketch feature definitions (and sets default = []).
datasketches/tests/theta_sketch_test.rs Gates theta integration tests behind feature = "theta".
datasketches/tests/theta_serialization_test.rs Gates theta serialization tests behind feature = "theta".
datasketches/tests/theta_intersection_test.rs Gates theta intersection tests behind feature = "theta".
datasketches/tests/tdigest_test.rs Gates tdigest integration tests behind feature = "tdigest".
datasketches/tests/tdigest_serialization_test.rs Gates tdigest serialization tests behind feature = "tdigest".
datasketches/tests/hll_update_test.rs Gates HLL integration tests behind feature = "hll".
datasketches/tests/hll_union_test.rs Gates HLL union integration tests behind feature = "hll".
datasketches/tests/hll_serialization_test.rs Gates HLL serialization tests behind feature = "hll".
datasketches/tests/frequencies_update_test.rs Gates frequencies integration tests behind feature = "frequencies".
datasketches/tests/frequencies_serialization_test.rs Gates frequencies serialization tests behind feature = "frequencies".
datasketches/tests/cpc_wrapper_test.rs Gates CPC wrapper integration tests behind feature = "cpc".
datasketches/tests/cpc_update_test.rs Gates CPC update integration tests behind feature = "cpc".
datasketches/tests/cpc_union_test.rs Gates CPC union integration tests behind feature = "cpc".
datasketches/tests/cpc_serialization_test.rs Gates CPC serialization tests behind feature = "cpc".
datasketches/tests/countmin_test.rs Gates count-min integration tests behind feature = "countmin".
datasketches/tests/bloom_serialization_test.rs Gates bloom serialization tests behind feature = "bloom".
Cargo.toml Adds cargo_metadata to workspace dependencies.
Cargo.lock Updates lockfile for the new cargo_metadata dependency set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread datasketches/Cargo.toml
tisonkun added 6 commits May 9, 2026 20:32
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Comment thread Cargo.toml Outdated
tisonkun added 4 commits May 9, 2026 22:47
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun marked this pull request as ready for review May 9, 2026 14:57
@tisonkun tisonkun requested review from PsiACE, ZENOTME and Copilot May 9, 2026 14:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 30 out of 31 changed files in this pull request and generated 3 comments.

Comment thread datasketches/Cargo.toml
Comment thread xtask/src/main.rs Outdated
Comment thread CONTRIBUTING.md
Signed-off-by: tison <wander4096@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 30 out of 31 changed files in this pull request and generated 2 comments.

Comment thread datasketches/Cargo.toml
Comment thread CONTRIBUTING.md
@tisonkun
Copy link
Copy Markdown
Member Author

tisonkun commented May 9, 2026

Thanks for your review @PsiACE!

I'm going to merge this and cut a 0.3.0 release candidate in the next Monday. So I'd appreciate it if @notfilippo @ZENOTME can drop a review so that we don't need to go back for hotfix after the RC is out.

@tisonkun
Copy link
Copy Markdown
Member Author

tisonkun commented May 9, 2026

Well. I think I can merge this now and prepare the changelog and other setups. And feedback can steer in to break the release process :D

@tisonkun tisonkun merged commit 9884dae into main May 9, 2026
13 checks passed
@tisonkun tisonkun deleted the feature-flag branch May 9, 2026 15:32
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.

Create a Cargo feature flag for each sketch

3 participants