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

PMM-11423: support for updating a service #1590

Merged
merged 27 commits into from
Aug 28, 2023

Conversation

michal-kralik
Copy link
Contributor

@michal-kralik michal-kralik commented Jan 19, 2023

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Merging #1590 (b43a5f6) into main (5d52bd6) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1590      +/-   ##
==========================================
+ Coverage   42.81%   42.85%   +0.03%     
==========================================
  Files         382      382              
  Lines       48101    48085      -16     
==========================================
+ Hits        20595    20607      +12     
+ Misses      25568    25545      -23     
+ Partials     1938     1933       -5     
Flag Coverage Δ
admin 10.41% <ø> (ø)
agent 52.88% <ø> (+0.16%) ⬆️
vmproxy 69.69% <ø> (ø)

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

Files Changed Coverage Δ
managed/cmd/pmm-managed/main.go 0.00% <ø> (ø)
managed/models/service_helpers.go 63.23% <ø> (ø)
managed/models/service_model.go 80.43% <ø> (ø)
managed/services/inventory/grpc/services_server.go 0.00% <ø> (ø)
managed/services/inventory/services.go 63.15% <ø> (+0.44%) ⬆️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@denisok
Copy link
Contributor

denisok commented Jan 30, 2023

@PavelKhripkov @BupycHuk please review.

@BupycHuk BupycHuk requested review from a team, gen1us2k and percona-csalguero and removed request for a team January 30, 2023 09:39
@PavelKhripkov
Copy link
Contributor

PavelKhripkov commented Jan 30, 2023

@michal-kralik we have some functionality related to cluster label. Probably we need some changes in other parts of the code before merging your changes. Let me check it.

upd: We really need changes otherwise our mongo backup logic will be broken.

api/inventorypb/services.proto Outdated Show resolved Hide resolved
api/inventorypb/services.proto Outdated Show resolved Hide resolved
managed/models/service_model.go Outdated Show resolved Hide resolved
managed/services/inventory/grpc/services_server.go Outdated Show resolved Hide resolved
managed/services/inventory/services.go Outdated Show resolved Hide resolved
managed/services/inventory/services.go Outdated Show resolved Hide resolved
managed/models/service_model.go Outdated Show resolved Hide resolved
managed/models/service_model.go Outdated Show resolved Hide resolved
@michal-kralik
Copy link
Contributor Author

@michal-kralik we have some functionality related to cluster label. Probably we need some changes in other parts of the code before merging your changes. Let me check it.

upd: We really need changes otherwise our mongo backup logic will be broken.

Sounds good. What kind of changes do you have in mind?

@PavelKhripkov
Copy link
Contributor

@michal-kralik we have some functionality related to cluster label. Probably we need some changes in other parts of the code before merging your changes. Let me check it.
upd: We really need changes otherwise our mongo backup logic will be broken.

Sounds good. What kind of changes do you have in mind?

I'm waiting response from @rnovikovP regarding this thing. Need to set priority and discuss possible solutions

managed/models/service_model.go Outdated Show resolved Hide resolved
managed/services/inventory/services.go Outdated Show resolved Hide resolved
@PavelKhripkov
Copy link
Contributor

@michal-kralik we have some functionality related to cluster label. Probably we need some changes in other parts of the code before merging your changes. Let me check it.
upd: We really need changes otherwise our mongo backup logic will be broken.

Sounds good. What kind of changes do you have in mind?

I'm waiting response from @rnovikovP regarding this thing. Need to set priority and discuss possible solutions

upd: We decided to not block these changes and we'll prepare fixes to cover cases when cluster is changed.

@@ -434,7 +435,11 @@ func (ss *ServicesService) RemoveCustomLabels(ctx context.Context, req *inventor
}

// ChangeService changes service configuration.
func (ss *ServicesService) ChangeService(ctx context.Context, params *models.ChangeStandardLabelsParams) (*inventorypb.ChangeServiceResponse, error) {
func (ss *ServicesService) ChangeService(ctx context.Context, mgmtServices common.MgmtServices, params *models.ChangeStandardLabelsParams) error {
if err := mgmtServices.RemoveScheduledTasks(ctx, ss.db, params); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PavelKhripkov would it make more sense to execute this in a transaction along with the labels change?
In case the labels change fail, we already removed scheduled tasks and there's no way back.

Copy link
Contributor

Choose a reason for hiding this comment

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

For sure, but the calls made on api-level that doesn't allow to rollback. To implement the same on a deeper level, we need to duplicate alot of code lines. And without proper testing It won't be reliable.

@matejkubinec matejkubinec merged commit 12a3523 into main Aug 28, 2023
32 checks passed
@matejkubinec matejkubinec deleted the PMM-11423-update-standard-labels branch August 28, 2023 11:09
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.

7 participants