Skip to content

Conversation

@Li0k
Copy link
Contributor

@Li0k Li0k commented Nov 27, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

as title

image

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

Copy link
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 adds license information to RisingWave's diagnostic output, enabling operators to easily view license status, resource limits, and available features when troubleshooting or monitoring the system.

Key Changes:

  • Adds license status, tier, expiration, and resource limits (RWU, CPU cores, memory) to diagnostic reports
  • Includes formatted list of available features based on license tier
  • Handles both valid and invalid license states with appropriate error messaging

let expires_at = if license.exp == u64::MAX {
"never".to_owned()
} else if license.exp > i64::MAX as u64 {
format!("invalid ({})", license.exp)
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The magic number check i64::MAX for timestamp validation is duplicated. Consider extracting the timestamp formatting logic into a helper function that handles both validation and formatting to improve code reusability and reduce duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +816 to +844
let mut row = Row::new();
row.add_cell("status".into());
row.add_cell("valid".into());
table.add_row(row);

let mut row = Row::new();
row.add_cell("tier".into());
row.add_cell(format!("{:?}", license.tier).into());
table.add_row(row);

let mut row = Row::new();
row.add_cell("expires_at".into());
row.add_cell(expires_at.into());
table.add_row(row);

let mut row = Row::new();
row.add_cell("rwu_limit".into());
row.add_cell(fmt_option(license.rwu_limit.map(|v| v.get())).into());
table.add_row(row);

let mut row = Row::new();
row.add_cell("cpu_core_limit".into());
row.add_cell(fmt_option(license.cpu_core_limit()).into());
table.add_row(row);

let mut row = Row::new();
row.add_cell("memory_limit_bytes".into());
row.add_cell(fmt_option(license.memory_limit()).into());
table.add_row(row);
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The repetitive pattern of creating rows and adding cells can be refactored into a helper function. Consider creating a helper that takes a label and value to reduce code duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

Rest LGTM

Comment on lines +807 to +808
} else if license.exp > i64::MAX as u64 {
format!("invalid ({})", license.exp)
Copy link
Member

Choose a reason for hiding this comment

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

We can also treat this case as "never".


let mut row = Row::new();
row.add_cell("tier".into());
row.add_cell(format!("{:?}", license.tier).into());
Copy link
Member

Choose a reason for hiding this comment

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

Using the debug repr might be verbose. Given that we already have the "feature_summary" row, shall we add a fn name to Tier to only obtain the tier name, like

  • free
  • paid
  • all
  • <custom name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants