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

feat: support initializing license key from env var #17906

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

BugenZhao
Copy link
Member

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

What's changed and what's your intention?

As title. Since license_key is a system parameter, we reuse the code path for initializing system parameters with env var.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

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.

@@ -143,7 +143,6 @@ impl SystemParamsController {
let params = SystemParameter::find().all(&db).await?;
let params = merge_params(system_params_from_db(params)?, init_params);

info!("system parameters: {:?}", params);
Copy link
Member Author

Choose a reason for hiding this comment

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

We're going to set a key for integration tests in CI. Removing these log lines to prevent any information leaks. 🥵

Copy link
Member Author

@BugenZhao BugenZhao Aug 6, 2024

Choose a reason for hiding this comment

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

A thorough solution is to not impl Debug for the SystemParams message with https://docs.rs/prost-build/latest/prost_build/struct.Config.html#method.skip_debug. However it's not possible in tonic-build now.

Copy link
Member

Choose a reason for hiding this comment

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

As you have redacted the license key in #17936 here, shall we put back the info! log?

Copy link
Member Author

Choose a reason for hiding this comment

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

@BugenZhao BugenZhao force-pushed the bz/license-key-init branch from 1ed0430 to 96590bf Compare August 2, 2024 09:42
@BugenZhao BugenZhao requested a review from huangjw806 August 2, 2024 09:46
Copy link
Member Author

@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.

Will base on #17936 instead

@@ -152,6 +152,7 @@ async fn handle_show_system_params(handler_args: HandlerArgs) -> Result<RwPgResp
.meta_client()
.get_system_params()
.await?;
// TODO: for secret params (like `license_key`), redact the value in the response.
Copy link
Member Author

Choose a reason for hiding this comment

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

Address in #17936

@@ -143,7 +143,6 @@ impl SystemParamsController {
let params = SystemParameter::find().all(&db).await?;
let params = merge_params(system_params_from_db(params)?, init_params);

info!("system parameters: {:?}", params);
Copy link
Member Author

@BugenZhao BugenZhao Aug 6, 2024

Choose a reason for hiding this comment

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

A thorough solution is to not impl Debug for the SystemParams message with https://docs.rs/prost-build/latest/prost_build/struct.Config.html#method.skip_debug. However it's not possible in tonic-build now.

@BugenZhao BugenZhao marked this pull request as draft August 6, 2024 07:37
@BugenZhao BugenZhao force-pushed the bz/license-key-init branch from 96590bf to bc79397 Compare August 6, 2024 07:39
@BugenZhao BugenZhao changed the base branch from main to bz/redact-license-key August 6, 2024 07:39
Copy link
Member Author

BugenZhao commented Aug 6, 2024

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

Join @BugenZhao and the rest of your teammates on Graphite Graphite

@BugenZhao BugenZhao marked this pull request as ready for review August 6, 2024 08:03
@BugenZhao BugenZhao force-pushed the bz/license-key-init branch from 54a0a54 to 5045523 Compare August 6, 2024 08:44
Copy link
Contributor

@huangjw806 huangjw806 left a comment

Choose a reason for hiding this comment

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

LGTM!

@StrikeW
Copy link
Contributor

StrikeW commented Aug 7, 2024

Can we get this merge? @BugenZhao

Base automatically changed from bz/redact-license-key to main August 12, 2024 03:30
@buildkite buildkite bot requested a review from a team as a code owner August 12, 2024 03:30
@buildkite buildkite bot requested a review from stdrc August 12, 2024 03:30
@graphite-app graphite-app bot requested a review from a team August 12, 2024 03:30
@BugenZhao BugenZhao force-pushed the bz/license-key-init branch from 4453593 to 365172f Compare August 12, 2024 03:49
@BugenZhao BugenZhao enabled auto-merge August 12, 2024 03:50
@BugenZhao BugenZhao added this pull request to the merge queue Aug 12, 2024
Merged via the queue into main with commit fbb30ad Aug 12, 2024
31 of 32 checks passed
@BugenZhao BugenZhao deleted the bz/license-key-init branch August 12, 2024 05:11
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.

7 participants