Skip to content

report resharding enabled flag#7895

Merged
generall merged 2 commits intodevfrom
report-resharding-enabled-flag
Jan 11, 2026
Merged

report resharding enabled flag#7895
generall merged 2 commits intodevfrom
report-resharding-enabled-flag

Conversation

@generall
Copy link
Copy Markdown
Member

Required for implementing resharding up/down buttons in web-ui

@generall generall requested a review from coszio January 11, 2026 15:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 11, 2026

📝 Walkthrough

Walkthrough

This pull request adds a new resharding_enabled boolean field to the ClusterTelemetry struct. The field is propagated across the codebase including: the OpenAPI schema documentation, the struct definition as an Option<bool>, metrics generation bindings, and gRPC conversion functions. The field is populated from cluster settings during telemetry collection and is conditionally serialized only when present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • timvisee
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'report resharding enabled flag' directly matches the main change: adding a resharding_enabled field to ClusterTelemetry for reporting purposes.
Description check ✅ Passed The description clearly relates to the changeset by explaining the purpose: enabling resharding UI buttons requires reporting the resharding enabled state.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb9d36e and 30bb3b4.

📒 Files selected for processing (4)
  • docs/redoc/master/openapi.json
  • src/common/metrics.rs
  • src/common/telemetry_ops/cluster_telemetry.rs
  • src/common/telemetry_ops/conversions.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (.github/review-rules.md)

**/*.rs: Prefer explicit SomeType::from(x) over implicit x.into() in Rust
In new code, don't use transmute_from_u8, transmute_to_u8, transmute_from_u8_to_slice, transmute_from_u8_to_mut_slice, transmute_to_u8_slice - use bytemuck or zerocopy crates instead
Prefer explicit exhaustive matches over catch-all _ arm in Rust match expressions, so we don't miss handling new enum variants when they are added later (exceptions: tests and benchmarks, or when sure new variants won't affect logic)
Prefer explicit field ignoring using : _ over using .. in Rust struct destructuring (exceptions: tests and benchmarks, or when sure new fields won't affect logic)

Files:

  • src/common/telemetry_ops/cluster_telemetry.rs
  • src/common/metrics.rs
  • src/common/telemetry_ops/conversions.rs
🧬 Code graph analysis (1)
src/common/telemetry_ops/cluster_telemetry.rs (1)
src/tonic/mod.rs (1)
  • settings (108-108)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: test-consistency
  • GitHub Check: test-consensus-compose
  • GitHub Check: Test Python bindings
  • GitHub Check: integration-tests-consensus
  • GitHub Check: rust-tests (windows-latest)
  • GitHub Check: rust-tests (macos-latest)
  • GitHub Check: integration-tests
  • GitHub Check: rust-tests (ubuntu-latest)
  • GitHub Check: e2e-tests
  • GitHub Check: lint
🔇 Additional comments (6)
src/common/telemetry_ops/cluster_telemetry.rs (2)

83-84: LGTM!

The new field follows the established pattern for optional fields in ClusterTelemetry. The Option<bool> type with skip_serializing_if annotation provides backward compatibility when the field is not available (e.g., during gRPC conversions).


139-139: LGTM!

The field is correctly populated from cluster settings, following the same pattern as the enabled field (Line 100). Both are configuration flags that are unconditionally available when telemetry is collected, which is appropriate for their use case.

src/common/metrics.rs (1)

512-520: LGTM!

The destructuring correctly acknowledges the new field using explicit field ignoring (: _), which aligns with the coding guidelines. This ensures that any future fields added to ClusterTelemetry will require explicit handling here.

As per coding guidelines, explicit field ignoring is preferred over the catch-all .. pattern.

docs/redoc/master/openapi.json (1)

13420-13428: Schema addition looks correct; consider whether nullable matches actual serialization (null vs omitted).

The JSON structure and optionality (not in required) look good. If the API omits resharding_enabled when unknown/unset (rather than returning null), consider dropping nullable: true (or ensure the server can actually emit null) to avoid a minor spec/behavior mismatch. Optionally add a short description to clarify semantics for clients.

Proposed doc-only tweak (description)
           "resharding_enabled": {
+            "description": "Whether resharding is enabled in the cluster configuration.",
             "type": "boolean",
             "nullable": true
           }
src/common/telemetry_ops/conversions.rs (2)

147-149: LGTM! Consistent field initialization pattern.

The new resharding_enabled field follows the established pattern for fields that exist in the internal representation but not in the gRPC schema. The initialization to None with an explanatory comment is consistent with peer_metadata and metadata.


163-163: LGTM! Correct adherence to coding guidelines.

The explicit field ignoring using resharding_enabled: _ correctly follows the coding guideline preference over using .. in struct destructuring. This is consistent with the pattern for other fields (enabled, config, peer_metadata, metadata) that are not included in the gRPC message schema.

As per coding guidelines, explicit field ignoring is preferred to ensure new fields are consciously handled.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@generall generall merged commit 46e7fc1 into dev Jan 11, 2026
15 checks passed
@generall generall deleted the report-resharding-enabled-flag branch January 11, 2026 22:01
generall added a commit that referenced this pull request Feb 9, 2026
* report if resharding is enabled in telemetry

* fmt
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.

2 participants