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

Update MZ CLI to use new Region API version 1 semantics #21871

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

rjobanp
Copy link
Contributor

@rjobanp rjobanp commented Sep 21, 2023

Motivation

Tips for reviewer

I tested the mz region list, mz region enable, and mz region disable commands against staging. Let me know if there are other tests to include. I wasn't able to test using the e2e test which looks like it's currently disabled.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • This PR includes the following user-facing behavior changes:

@@ -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.
Copy link
Contributor Author

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

Err(Error::NotReadyRegion)
}
RegionState::DeletionPending | RegionState::SoftDeleted => Err(
Error::CommandExecutionError("Error enabling region".to_string()),
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

@RobinClowers RobinClowers left a 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.

Copy link
Member

@ParkMyCar ParkMyCar left a 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>,
Copy link
Member

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?

Copy link
Contributor

@joacoc joacoc left a 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.

/// may not be set if the region is in the process
/// of being created
/// of being created (see RegionState for details)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// of being created (see RegionState for details)
/// of being created (see [RegionState] for details)

@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
version = "0.2.2"
version = "0.2.1"

@@ -3,6 +3,14 @@
All notable changes to the `mz` CLI will be documented in this file.


## [0.2.2] - 2023-09-21
Copy link
Contributor

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

Enabled,

/// Enablement Pending
/// regionInfo field will be null while the region is in this state
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 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

EnablementPending,

/// Deletion Pending
/// regionInfo field will be null while the region is in this state
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 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

DeletionPending,

/// Soft deleted; Pending hard deletion
/// regionInfo field will be null while the region is in this state
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 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

Err(Error::NotReadyRegion)
}
RegionState::DeletionPending | RegionState::SoftDeleted => Err(
Error::CommandExecutionError("Error enabling region".to_string()),
Copy link
Contributor

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.

@rjobanp
Copy link
Contributor Author

rjobanp commented Sep 22, 2023

Thank you all for the comments! I believe I've addressed them all now

@joacoc
Copy link
Contributor

joacoc commented Sep 25, 2023

@rjobanp LGTM!

@rjobanp rjobanp merged commit 630c7c9 into main Sep 25, 2023
@rjobanp rjobanp deleted the roshan/request-headers branch September 25, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants