Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(proto): add LATEST const value for proto message version enums #20359

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

stdrc
Copy link
Member

@stdrc stdrc commented Feb 3, 2025

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

What's changed and what's your intention?

By adding a LATEST const value to version enums like risingwave_pb::plan_common::ColumnDescVersion, we can directly use this value when constructing new proto messages, avoiding updating all occurrence everytime we add a new version.

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.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

Copy link
Member Author

stdrc commented Feb 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@stdrc stdrc changed the title add PbAggNodeVersion::LATEST refactor(proto): add LATEST const value for proto message version enums Feb 3, 2025
@stdrc stdrc marked this pull request as ready for review February 3, 2025 06:19
// in case DEFAULT_KEY_COLUMN_NAME changes
COLUMN_DESC_VERSION_PR_13707 = 1;

// for test only
COLUMN_DESC_VERSION_MAX = 2147483647;
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing MAX doesn't matter because this should only be used in unit tests before.

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.

Shall we consider deriving it? (like https://docs.rs/strum/latest/strum/derive.EnumIter.html)

Signed-off-by: Richard Chien <[email protected]>
@stdrc
Copy link
Member Author

stdrc commented Feb 3, 2025

Shall we consider deriving it? (like docs.rs/strum/latest/strum/derive.EnumIter.html)

Done

@stdrc stdrc added the ci/run-backwards-compat-tests Run backwards compatibility tests in your PR. label Feb 3, 2025
@stdrc stdrc requested a review from BugenZhao February 3, 2025 09:11
@stdrc stdrc enabled auto-merge February 3, 2025 09:11
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.

LGTM

@stdrc stdrc added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit 3ee72eb Feb 3, 2025
38 of 40 checks passed
@stdrc stdrc deleted the rc/const-latest-for-proto-version-enum branch February 3, 2025 10:31
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.

2 participants