-
Notifications
You must be signed in to change notification settings - Fork 10
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
AAP-32688: Support deletion of WCA API_KEY from Admin Portal (Backend) #1342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a draft; but thought I'd take a quick "Friday afternoon" look.
ae0b55e
to
7cd70d3
Compare
7cd70d3
to
8f11483
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I know @jameswnl is concerned about the lack of an atomic transaction around deletion of the two secrets in AWS Secret Manager. I had a read and it does not seem possible to ensure a single transaction around their deletion.
I'm not sure what we can do about this.. other than moving the onus onto Users and having separate support for deleting the API Key and deleting the Model ID. Deleting the API Key but not* the Model ID leaves the system in an inconsistent state.
@jameswnl Thoughts?
@manstis yep. it's a concern. I actually thought about this but somehow missed to call again among all other things. What I would suggest is: we can try deleting model id first, then if it is successfull we can try deleting the key. If the model deletion fails, then we dont delete the key, but if we can delete the model but not the key, at least we will not end up with sth inconsistent but sth possible (an org can have a key but not a model id set). wdyt? |
That seems a reasonable approach. You might need to consider how we can propagate a scenario when deletion of the Model ID was successful but deletion of the API Key resulted in an error. We should be able to send some form of response/error back that we can use to show an information message to Users... it's an edge case; but might be worth considering. |
@manstis my suggestion to decouple the 2 deletions is meant to simply our logic (handling partial success situations etc). since you guys already did the handwork to handle them. I am fine :) |
… delete model id before api key for partial atomocity
@manstis can you recheck when you have time pls? what are the changes:
|
@manstis @jameswnl once this goes to stage I will add a test here to cover deletion as well: https://github.com/ansible/ansible-wisdom-testing/blob/main/tests/ui/test_admin_ui.py Thanks |
My understanding was that if the api_key is missing, we can safely ignore the presence model_id. This because without the api_key, it won't be used and if the user set a new api_key, the model_id will also be overwritten. I don't think we need to do an atomic change. Did I miss something? |
@goneri thanks for the review. We reverted the logic where your comments were about. so hope you dont mind if I dismiss your review to have a fast merge for this one.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 @mabulgu
Nice tests.
Jira Issue: https://issues.redhat.com/browse/AAP-32688
Description
See issue: https://issues.redhat.com/browse/AAP-32688
Testing
ai.api.wca.tests
.Scenarios tested
Production deployment