-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve logging in project deletes #171
Improve logging in project deletes #171
Conversation
Add new tests for the updated function
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.
See comments
R/delete_project.R
Outdated
|
||
# Define logging parameters | ||
ts <- format(Sys.time(), "%Y%m%d%H%M%S") # Time stamp | ||
user <- "admin" # Placeholder for user |
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.
Test this with an invalid username to see how REDCap's UI will behave.
Then, revise the code to default it first to, the value in sys.getenv("API_USER"), then--if invalid usernames are allowed--the script name.
R/delete_project.R
Outdated
# Define logging parameters | ||
ts <- format(Sys.time(), "%Y%m%d%H%M%S") # Time stamp | ||
user <- "admin" # Placeholder for user | ||
ip <- "192.168.65.1" # Placeholder for IP address |
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.
Use getip::getip("local") to get the local IP address. Make getip a required package for redcapcustodian.
use getip package to log the ip address
Add getip package to requirements
@saipavan10-git, note that the checks are failing. If you drill in on that error you will see the error is pretty obvious: redcapcustodian now needs Could you document this procedure in addition to fixing it? The procedure doesn't seem clear unless you've already set up GitHub actions to perform automated testing. Any thoughts on where to put this procedure? Could we add a vignette for developers? You can see the configuration for the action that failed at run-tests.yaml. It uses an image at ghcr.io/ctsit/rstudio-ci. The Dockerfile that defines that is at Dockerfile. Historically, we have added required packages in this Dockerfile. That should work quickly and easily, but I think you can install packages in |
I updated this dockerfile thinking this will fix the issue. Adding a guide vignette for developers is a great idea. I can create one to document the fix for this issue. If we add new dependencies more frequently, we could add a step to setup dependencies in run-tests.yaml like in pkgdown.yaml. This will reduce the need to update the rstudio-Dockerfile. Also, setup r dependencies has an option to cache the packages that might help with the speed of the gh action. |
That's necessary, but not sufficient to make CI-tests work
Right! I knew we had done this before, but I couldn't locate it.
That minimizes the downside of the more local management of dependencies. I like it :-) |
This pull request includes significant changes to the
delete_project
function and its associated tests. The changes enhance logging, and update the test cases to reflect the new logging structure. Addresses #169I tested the new delete function and now the project delete is visible on REDCap UI.
Enhancements to
delete_project
function:ts
,user
,ip
,page
,event
,object_type
,sql_log
,pk
,event_id
,data_values
,description
,legacy
, andchange_reason
.