Skip to content

Fix restart not showing new version #3686

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

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Conversation

Sploder12
Copy link
Contributor

Partial fix for #3672, unable to reproduce start behavior.

When running restart with a new version of Multipass available, no notification would be shown but the field is present in the gRPC reply.

This PR makes it so the daemon properly populates that field for restart and has the CLI respond to it.

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.92%. Comparing base (5f4dfe2) to head (acdd14c).
Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
src/client/cli/cmd/restart.cpp 83.33% 1 Missing ⚠️
src/daemon/daemon.cpp 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3686      +/-   ##
==========================================
+ Coverage   88.85%   88.92%   +0.07%     
==========================================
  Files         254      254              
  Lines       14269    14269              
==========================================
+ Hits        12679    12689      +10     
+ Misses       1590     1580      -10     
Flag Coverage Δ
88.92% <81.81%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

sharder996
sharder996 previously approved these changes Sep 24, 2024
Copy link
Collaborator

@sharder996 sharder996 left a comment

Choose a reason for hiding this comment

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

This looks good to me as is and as such I'm going to approve.

However, I think some of the logic can be improved.

  • write_reply is unnecessary since writing an empty reply is idempotent
  • The config->update_prompt->is_time_to_show() check and config->update_prompt->populate() can be simplified with a single call to populate_if_time_to_show(). populate() displays the new version info every time the command is called, which is probably a bit too spammy. populate_if_time_to_show() will only display new version info every notify_user_frequency which is inline with what the other commands do.

@ricab
Copy link
Collaborator

ricab commented Sep 24, 2024

Hmm, I would rather avoid being too naggy. @Sploder12 WDYT?

@Sploder12
Copy link
Contributor Author

Hmm, I would rather avoid being too naggy. @Sploder12 WDYT?

I agree, I'd want to avoid that too @ricab.

@ricab
Copy link
Collaborator

ricab commented Sep 24, 2024

Alright, let's wait for it then, thanks.

Copy link
Collaborator

@sharder996 sharder996 left a comment

Choose a reason for hiding this comment

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

LGTM! Will wait for CI before merging.

BTW, if you use one of these keywords along with the issue number, the issue will be closed automatically when the PR gets merged.

@sharder996 sharder996 added this pull request to the merge queue Sep 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 24, 2024
@sharder996 sharder996 added this pull request to the merge queue Sep 24, 2024
Merged via the queue into main with commit a8725ac Sep 24, 2024
13 of 14 checks passed
@sharder996 sharder996 deleted the fix-new-version-unused-restart branch September 24, 2024 18:36
@sharder996
Copy link
Collaborator

Fixes #3672

ricab pushed a commit that referenced this pull request Sep 27, 2024
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.

3 participants