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

api: fix account deletion event description #3483

Merged

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Jul 11, 2019

Description

Fixes #3109

This change fixes wrong event description with incorrect user and account IDs on account deletion.
While deleting an account, existing code was using accountID to query User from cloud.user. This resulted in the wrong user and account details in the event description. This has been fixed by listing all users for the given account and then using the first user(this will be the user with lowest ID value and will correspond to default user for the account) for details.

As per #3483 (review), show only account details and nothing for user.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

Events on account delete,
Screenshot from 2019-07-11 14-47-58

How Has This Been Tested?

UI, cmk, DB validation

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-112

@shwstppr
Copy link
Contributor Author

ping for review @rhtyd @anuragaw @borisstoyanov

@rohityadavcloud rohityadavcloud added this to the 4.13.0.0 milestone Jul 11, 2019
@apache apache deleted a comment from blueorangutan Jul 11, 2019
Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

LGTM, please rectify the event description to (a) use UUIDs instead of internal DB integer ids, (b) write id as ID in the string, (c) write accountId as account ID (you may also provide the name), (d) consider rewriting the description to say that the account with name and ID is being removed.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

LGTM, please rectify the event description to (a) use UUIDs instead of internal DB integer ids, (b) write id as ID in the string, (c) write accountId as account ID (you may also provide the name), (d) consider rewriting the desdeletcription to say that the account with name and ID is being removed.

@rhtyd is it better now?

@rohityadavcloud
Copy link
Member

Good work @shwstppr thanks!
@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@rohityadavcloud rohityadavcloud changed the title api: fix account delete event description, wrong user api: fix account deletion event description Jul 11, 2019
@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-115

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-147)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32014 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3483-t147-kvm-centos7.zip
Smoke tests completed. 72 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@rohityadavcloud
Copy link
Member

cc @anuragaw @borisstoyanov can you review this? Thanks.

Copy link
Contributor

@anuragaw anuragaw left a comment

Choose a reason for hiding this comment

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

LGTM from code. Haven't tested.

@rohityadavcloud rohityadavcloud merged commit b40fdbb into apache:master Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants