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

Document how to run the rake task to attach a file to a user #1333

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,20 @@ Workers must be running on each server in order for mail to be sent and backgrou
To demonstrate the look and feel of elements defined as part of the style guide, this application includes a "styles preview" page, visible at the path `/styles_preview`. It is intended as a place to make CSS and HTML attributes available for review by users either before they are implemented in the UI, or are difficult to access within the UI of the rest of the application, but the look and feel must be reviewed. See [this ticket](https://github.com/pulibrary/tigerdata-app/issues/1000) as an example of CSS that is also added to the Styles Preview page as part of development.

All elements on the Styles Preview page are added manually during feature development, and only need to be added if they match the criteria described above (either not yet in the UI or difficult to access otherwise within the UI). It can be edited at [`app/views/welcome/styles_preview.html.erb`](https://github.com/pulibrary/tigerdata-app/blob/main/app/views/welcome/styles_preview.html.erb).


## Manually attaching a File Inventory Job
To attach the output of an existing File Inventory Job to a user we can run the rake task `file_inventory:attach_file`.

1. Log into one of the production machines
1. Find the `job_id` of the job that you want to attach the file to. You can do this via the Rails console (for example finding the last job for the user that is having problems)
1. Find the file that you want to attach to the job. Files are under `/mnt/nfs/tigerdata` and each file is named after their `job_id`. Copy this file to a file named after the `job_id` that you will attach it to.
1. Run the rake task giving it the `job_id` and the name of the file that you want to attach to it.

For example if the `job_id` is "xxxx-yyyy-zzzz" you'll run the Rake task as follows:

```
bundle exec rake file_inventory:attach_file[xxxx-yyyy-zzzz,/mnt/nfs/tigerdata/xxxx-yyyy-zzzz.csv]
```

Technically you don't need to copy the source file to a new file named after the `job_id` that you are interested but keeping each file named after the job that they belong keeps things tiddy. Plus since each file will be cleaned up on their own schedule having them separate also prevents the file from dissapearing for one user then it's cleaned up for another user.
Copy link
Member

Choose a reason for hiding this comment

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

❤️