-
Notifications
You must be signed in to change notification settings - Fork 468
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
Update MZ CLI to use new Region API version 1 semantics #21871
Conversation
08058b7
to
02f52ac
Compare
@@ -134,7 +134,7 @@ Field | Type | Description | |||
`app-password` | string | *Secret.* The app password to use for this profile. | |||
`region` | string | The default region to use for this profile. | |||
`vault` | string | The vault to use for this profile. See [Global parameters](#global-parameters) above. | |||
`api-endpoint` | string | *Internal use only.* The Materialize API endpoint to use. | |||
`cloud-endpoint` | string | *Internal use only.* The Materialize API endpoint to use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a typo I found when making a profile that used staging
src/mz/src/command/region.rs
Outdated
Err(Error::NotReadyRegion) | ||
} | ||
RegionState::DeletionPending | RegionState::SoftDeleted => Err( | ||
Error::CommandExecutionError("Error enabling region".to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to be more explicit for these cases? "This region has been scheduled for deletion," or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. We should. It helps to debug faster and provide more context/value to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense conceptually, but I didn't try to test it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -70,13 +71,23 @@ impl Client { | |||
method: Method, | |||
path: P, | |||
cloud_provider: &CloudProvider, | |||
api_version: Option<u16>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document the behavior of what happens if we don't specify an api_version
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just a few comments about the release process/rust docs.
src/cloud-api/src/client/region.rs
Outdated
/// may not be set if the region is in the process | ||
/// of being created | ||
/// of being created (see RegionState for details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// of being created (see RegionState for details) | |
/// of being created (see [RegionState] for details) |
src/mz/Cargo.toml
Outdated
@@ -2,7 +2,7 @@ | |||
name = "mz" | |||
description = "The Materialize command-line interface (CLI)." | |||
license = "Apache-2.0" | |||
version = "0.2.1" | |||
version = "0.2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.2.2" | |
version = "0.2.1" |
src/mz/CHANGELOG.md
Outdated
@@ -3,6 +3,14 @@ | |||
All notable changes to the `mz` CLI will be documented in this file. | |||
|
|||
|
|||
## [0.2.2] - 2023-09-21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for writing this 🙏 - We should remove the comments in the changelog for this PR. To keep the release process as is. (I will re-add them in the release PR. I have to add other changes, and trigger the release process. We can do it as soon as we merge this.)
src/cloud-api/src/client/region.rs
Outdated
Enabled, | ||
|
||
/// Enablement Pending | ||
/// regionInfo field will be null while the region is in this state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// regionInfo field will be null while the region is in this state | |
/// [region_info][Region::region_info] field will be `null` while the region is in this state |
src/cloud-api/src/client/region.rs
Outdated
EnablementPending, | ||
|
||
/// Deletion Pending | ||
/// regionInfo field will be null while the region is in this state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// regionInfo field will be null while the region is in this state | |
/// [region_info][Region::region_info] field will be null while the region is in this state |
src/cloud-api/src/client/region.rs
Outdated
DeletionPending, | ||
|
||
/// Soft deleted; Pending hard deletion | ||
/// regionInfo field will be null while the region is in this state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// regionInfo field will be null while the region is in this state | |
/// [region_info][Region::region_info] field will be null while the region is in this state |
src/mz/src/command/region.rs
Outdated
Err(Error::NotReadyRegion) | ||
} | ||
RegionState::DeletionPending | RegionState::SoftDeleted => Err( | ||
Error::CommandExecutionError("Error enabling region".to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. We should. It helps to debug faster and provide more context/value to the user.
02f52ac
to
5034fae
Compare
Thank you all for the comments! I believe I've addressed them all now |
@rjobanp LGTM! |
Motivation
mz
cli to use the new Region API response semantics introduced with api version1
.Tips for reviewer
I tested the
mz region list
,mz region enable
, andmz region disable
commands against staging. Let me know if there are other tests to include. I wasn't able to test using thee2e
test which looks like it's currently disabled.Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.