-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add endpoint to clear the cdm_cache and achilles_cache #2406
base: master
Are you sure you want to change the base?
Conversation
Hi @amarsan . Excellent work, and I appreciate you following the existing patterns in the codebase (such as creating jobs and tasklets) to perform this activity in background. Some comments:
Great work, tho, it was a lot of effort to follow the patterns in code, so that was a good effort. I think in this case we just don't need to disable the ability to clear a cache nor make the clear action async. As far as writing a test case where you want to test a person is admin, I think I have a unit test for wildcard permissions that I had to 'inject' a user context into the test case that had the necessary permissions that I was testing...I think you can do the same thing by injecting a user context that has the admin role. Let me dig it up and i'll reference it here when I find it. |
.editorconfig
Outdated
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 |
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.
if we're doing this let's do 2 space indent.
Would the tests that we used to test wildcard permissions serve as a good model for doing your own permission test: I believe you would just set up a JSON file to insert records into user-role to assign the user to the admin role. |
@chrisknoll this is ready for review now. This PR has been a crash course for me in Spring Boot, Shiro, and async in Java. Some issues I ran into:
|
supports OHDSI/Atlas#2847
This adds an endpoint to clear the cdm_cache and achilles_cache tables for sources that the caller has access to. The caller must be an admin.
I followed the pattern for warming a cache, wrapping the operation in a Job.
I wanted to write an integration test for this, but ran into the issue that since the user needs to be an admin, security roles and users need to be set up as part of the integration tests. I haven't tackled figuring that out yet. Guidance here would be much appreciated.