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: move metrics, resource_util out of common #15647

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Mar 12, 2024

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

What's changed and what's your intention?

Because their implementation is self-contained (so it's possible to move out, unlike array stuff). To avoid common's code being bloated.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@xxchan xxchan requested review from TennyZhuang and BugenZhao March 12, 2024 14:37
@xxchan xxchan requested a review from a team as a code owner March 12, 2024 14:37
Copy link
Member

@stdrc stdrc left a comment

Choose a reason for hiding this comment

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

Generally LGTM. Please add some PR description

Comment on lines +25 to +32
pub use rw_iter_util as iter_util;
pub mod memcmp_encoding;
pub mod meta_addr;
pub mod panic;
pub mod pretty_bytes;
pub mod prost;
pub mod query_log;
pub mod resource_util;
pub use rw_resource_util as resource_util;
Copy link
Member

Choose a reason for hiding this comment

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

Why not changing all the usage? IMO later if we have two ways to import the same module, things can be messy

Copy link
Member Author

Choose a reason for hiding this comment

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

Why not changing all the usage?

Because it's widely used in many places. This is kind of "prelude" style. And I now think it's both OK whether or not to change it (but I'm lazy).

IMO later if we have two ways to import the same module, things can be messy

I don't think this may cause any trouble. 👀

Copy link
Member

Choose a reason for hiding this comment

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

Just perfectionism🤡

Comment on lines +18 to +36
bytes = "1"
clap = { version = "4", features = ["derive"] }
easy-ext = "1"
futures = { version = "0.3", default-features = false, features = ["alloc"] }
http = "0.2"
hyper = { version = "0.14", features = ["client"] }
hytra = { workspace = true }
itertools = "0.12"
parking_lot = "0.12"
pin-project-lite = "0.2"
prometheus = { version = "0.13" }
rw_iter_util = { workspace = true }
rw_resource_util = { workspace = true }
serde = { version = "1", features = ["derive"] }
thiserror-ext = { workspace = true }
tokio = { version = "0.2", package = "madsim-tokio" }
tonic = { workspace = true }
tracing = "0.1"
tracing-subscriber = "0.3.17"
Copy link
Member

Choose a reason for hiding this comment

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

Is there any principle for us to decide whether a dependency should be set { workspace = true }?

Copy link
Member Author

Choose a reason for hiding this comment

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

For this PR, it's just copied from common/Cargo.toml.
For the general question, I think it won't do any harm to put one in workspace dependency. For widely used dependencies among our crates, it's preferred to put there, so we can manage version in one place.

@xxchan xxchan added this pull request to the merge queue Mar 15, 2024
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

Copy link
Member

Choose a reason for hiding this comment

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

Should we delete src/common/src/metrics.rs?

@xxchan xxchan removed this pull request from the merge queue due to a manual request Mar 15, 2024
@xxchan xxchan enabled auto-merge March 15, 2024 06:32
@xxchan xxchan added this pull request to the merge queue Mar 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 15, 2024
@BugenZhao BugenZhao added this pull request to the merge queue Mar 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 15, 2024
@xxchan xxchan added this pull request to the merge queue Mar 15, 2024
Merged via the queue into main with commit e2a17d2 Mar 15, 2024
27 of 28 checks passed
@xxchan xxchan deleted the xxchan/typical-spoonbill branch March 15, 2024 10:00
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.

3 participants