Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

PMM-8459 Ability to disable updates.#808

Merged
JiriCtvrtka merged 22 commits intoPMM-2.0from
PMM-8459-disable-updates
Aug 30, 2021
Merged

PMM-8459 Ability to disable updates.#808
JiriCtvrtka merged 22 commits intoPMM-2.0from
PMM-8459-disable-updates

Conversation

@JiriCtvrtka
Copy link
Contributor

@JiriCtvrtka JiriCtvrtka commented Jul 28, 2021

PMM-8459


  • Tests passed.
  • Feature build pass.
  • (Re)requested review.
  • Fix conflicts with target branch.
  • Update API dependency.
  • Update jira ticket description if needed.
  • Attach screenshots/console output to confirm new behavior to jira ticket, if applicable.

@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #808 (99699b7) into PMM-2.0 (59e9610) will increase coverage by 0.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           PMM-2.0     #808      +/-   ##
===========================================
+ Coverage    49.48%   49.50%   +0.01%     
===========================================
  Files          167      167              
  Lines        18808    18818      +10     
===========================================
+ Hits          9308     9316       +8     
- Misses        8484     8485       +1     
- Partials      1016     1017       +1     
Flag Coverage Δ
all 49.10% <83.33%> (+0.01%) ⬆️
cover 48.90% <83.33%> (+0.01%) ⬆️
crosscover 49.50% <83.33%> (+0.01%) ⬆️
update 13.10% <0.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
models/settings.go 100.00% <ø> (ø)
models/settings_helpers.go 70.87% <71.42%> (-0.13%) ⬇️
services/server/server.go 29.91% <100.00%> (+0.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59e9610...99699b7. Read the comment docs.

@JiriCtvrtka
Copy link
Contributor Author

Updates can be disabled only when telemetry is disabled too.

@JiriCtvrtka JiriCtvrtka marked this pull request as ready for review July 28, 2021 09:15
Copy link
Contributor

@BupycHuk BupycHuk left a comment

Choose a reason for hiding this comment

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

Do not forget about API tests.


s.envSettings.DisableTelemetry = true
s.envSettings.EnableUpdates = true
expected = status.New(codes.FailedPrecondition, "Updates are enabled via ENABLE_UPDATES environment variable.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have ENABLE_UPDATES env variable? As far as I know we have only DISABLE_UPDATES

Copy link
Contributor

Choose a reason for hiding this comment

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

let's rewrite test taking into account that we can't enable updates if it's disabled.

Comment on lines +528 to +530
if req.DisableUpdates && s.envSettings.EnableTelemetry {
return status.Error(codes.FailedPrecondition, "Updates cannot be disabled because telemetry is enabled via ENABLE_TELEMETRY environment variable.")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

updates and telemetry is independent, so we can remove this check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here https://perconacorp.slack.com/archives/C03J8FZFU/p1626470324102700 is discussion that they are coupled. Ok I will change everything related to it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please discuss it with Roma, Steve or Denys. But previously users were able to disable updates using env variable without disabling telemetry.

Copy link
Contributor

Choose a reason for hiding this comment

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

that was just assumption from Steve (that disable doesn't work because of telemetry). It is not a requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@denisok Ok thanks for verifying.

Comment on lines +525 to +527
if req.DisableUpdates && !s.envSettings.DisableUpdates {
return status.Error(codes.FailedPrecondition, "Updates are enabled via DISABLE_UPDATES environment variable.")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove it. s.envSettings.DisableUpdates is false by default, so users won't be able to disable updates.

Copy link
Contributor

@percona-csalguero percona-csalguero left a comment

Choose a reason for hiding this comment

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

LGTM, just address the changes requested by Nurlan.

@JiriCtvrtka JiriCtvrtka requested a review from BupycHuk July 29, 2021 07:58
@JiriCtvrtka
Copy link
Contributor Author

@BupycHuk Take a look if I got you right. API tests added in description.

@JiriCtvrtka JiriCtvrtka merged commit 2f3a8d0 into PMM-2.0 Aug 30, 2021
@JiriCtvrtka JiriCtvrtka deleted the PMM-8459-disable-updates branch August 30, 2021 09:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants