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

[RHCLOUD-37156] Make reset import tenants admin endpoint use ready=false query instead of looking up all related objects #1454

Merged
merged 9 commits into from
Jan 28, 2025

Conversation

petracihalova
Copy link
Contributor

@petracihalova petracihalova commented Jan 22, 2025

Link(s) to Jira

Description of Intent of Change(s)

we have internal endpoint for reseting imported tenants here

and for tenants identification we are looking up all related objects

this PR introduces the simplification of the query = instead of checking all related objects we can use ready=false flag

but because it could be useful to keep the old behavior I added new query parameter only_ready_false_flag (with default value true)

  • only_ready_false_flag=true => use query with ready=false flag and get all tenants with ready=false flag
  • only_ready_false_flag=false => use query that is looking up all related objects and get all tenants without related objects

in the perfect world (tenant with ready=false does not have related objects) both queries should return same data/result

Local Testing

you can test it locally with internal endpoint

GET / DELETE http://localhost:8000/_private/api/utils/reset_imported_tenants/
GET / DELETE http://localhost:8000/_private/api/utils/reset_imported_tenants/?only_ready_false_flag=true
GET / DELETE http://localhost:8000/_private/api/utils/reset_imported_tenants/?only_ready_false_flag=false

TODO

  • update open api spec for internal endpoints
  • add ACs in RHCLOUD-37156
  • unit tests

rbac/internal/views.py Outdated Show resolved Hide resolved
@petracihalova
Copy link
Contributor Author

rebased and conflicts solved

@lpichler
Copy link
Contributor

/retest

2 similar comments
@lpichler
Copy link
Contributor

/retest

@vbelchio
Copy link
Contributor

/retest

@petracihalova petracihalova merged commit 1b74db8 into RedHatInsights:master Jan 28, 2025
11 checks passed
@petracihalova petracihalova deleted the query_variation branch January 28, 2025 21:14
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.

4 participants