Skip to content

Conversation

@andrei-toterman
Copy link
Contributor

@andrei-toterman andrei-toterman commented Feb 7, 2025

This PR adds the CLI commands enable-zones and disable-zones which send the gRPC calls for making an AZ available or unavailable.

MULTI-1872

@codecov
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

❌ Patch coverage is 96.07843% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.50%. Comparing base (382dfca) to head (141fe74).
⚠️ Report is 26 commits behind head on availability-zones.

Files with missing lines Patch % Lines
src/client/cli/cmd/disable_zones.cpp 94.02% 4 Missing ⚠️
src/daemon/daemon.cpp 93.33% 2 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           availability-zones    #3926      +/-   ##
======================================================
+ Coverage               89.24%   89.50%   +0.25%     
======================================================
  Files                     265      267       +2     
  Lines                   15050    15177     +127     
======================================================
+ Hits                    13432    13584     +152     
+ Misses                   1618     1593      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@xmkg xmkg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

Hey @andrei-toterman, looks good overall. Only small comments and nitpicks.

@andrei-toterman andrei-toterman force-pushed the az-info-retrieval branch 3 times, most recently from 8b07126 to 78e9b91 Compare April 2, 2025 12:27
@andrei-toterman andrei-toterman force-pushed the az-enable-disable-commands branch from 043edde to d91dc99 Compare April 2, 2025 14:06
@ricab ricab self-requested a review April 4, 2025 15:01
@andrei-toterman andrei-toterman force-pushed the az-enable-disable-commands branch from d91dc99 to 7ec3ba7 Compare April 8, 2025 13:45
@andrei-toterman andrei-toterman force-pushed the az-info-retrieval branch 2 times, most recently from 089be1d to e859b3f Compare April 8, 2025 14:53
@andrei-toterman andrei-toterman force-pushed the az-enable-disable-commands branch from 7ec3ba7 to fa9880f Compare April 8, 2025 14:53
@andrei-toterman andrei-toterman force-pushed the az-enable-disable-commands branch from fa9880f to badabe0 Compare April 9, 2025 10:41
@levkropp levkropp force-pushed the az-info-retrieval branch from 989f543 to 382dfca Compare May 12, 2025 13:19
@levkropp levkropp force-pushed the az-enable-disable-commands branch from 479d1b2 to d22e267 Compare May 12, 2025 13:58
@levkropp levkropp force-pushed the az-enable-disable-commands branch from d22e267 to d3c57b4 Compare May 12, 2025 14:42
@levkropp levkropp force-pushed the az-enable-disable-commands branch from 9cc4b22 to c7e2314 Compare June 2, 2025 18:56
@levkropp levkropp requested a review from ricab June 27, 2025 15:25
Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

I finally managed to get back to this. It is shaping up nicely and getting close, but there are a few things with respect to --all and arguments that need attention.

Also, as discussed elsewhere, there is quite a bit of missing coverage (I thought this was covered by tests in a different branch, but it turns out that is not the case.)

@levkropp levkropp force-pushed the az-enable-disable-commands branch from 506dbd9 to affecab Compare July 11, 2025 20:59
@levkropp levkropp force-pushed the az-enable-disable-commands branch from affecab to e1b367e Compare July 11, 2025 21:42
@levkropp levkropp force-pushed the az-enable-disable-commands branch from 677c275 to 3ecc556 Compare July 14, 2025 17:30
@levkropp levkropp force-pushed the az-enable-disable-commands branch from c623e24 to bf18f23 Compare July 15, 2025 16:34
@levkropp levkropp force-pushed the az-enable-disable-commands branch from bf18f23 to c2a338e Compare July 15, 2025 16:38
@levkropp levkropp force-pushed the az-enable-disable-commands branch from f604edd to 5a32132 Compare July 15, 2025 17:10
@levkropp levkropp requested a review from ricab July 15, 2025 17:47
Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

Looking good @levkropp, good job!

I ended up being a proper primary review and I have a few very small fixes inline, but I am going ahead and pre-approving. You'll need a green stamp from @xmkg when you push again, then feel free to merge.

Missing bash completion, but you can add that in a separate PR.

return ParseCode::Ok;
}

bool DisableZones::confirm()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be const, right?

if (request->zones().empty())
{
config->az_manager->get_zone(zone_name).set_available(request->available());
auto& az_manager = *config->az_manager;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you want to keep this, better extract it outside the if and use it in both branches homogeneously.


QString DisableZones::description() const
{
return QStringLiteral("Makes the given availability zones unavailable. Instances therein are"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return QStringLiteral("Makes the given availability zones unavailable. Instances therein are"
return QStringLiteral("Makes the given availability zones unavailable. Instances therein are "


const auto on_failure = [this, &spinner](const grpc::Status& status) {
spinner.stop();
return standard_failure_handler_for(name(), cerr, status);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I use a bad AZ, I get this error message:

$ multipass enable-zones asdf
enable-zones failed: no AZ with name "asdf" found

Could we have another PR to avoid "AZ" in messages to the user? Let's stick to "zone" as a single nomenclature. "Availability zone" in the help text and docs is fine though IMO.

Base automatically changed from az-info-retrieval to availability-zones August 18, 2025 16:33
@levkropp levkropp merged commit 8b4f5dd into availability-zones Aug 18, 2025
24 of 26 checks passed
@levkropp levkropp deleted the az-enable-disable-commands branch August 18, 2025 16:34
Sploder12 pushed a commit that referenced this pull request Aug 18, 2025
This PR adds the CLI commands `enable-zones` and `disable-zones` which
send the gRPC calls for making an AZ available or unavailable.

MULTI-1872
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