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

IQSS/11113 fix file perm doc creation #11114

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Dec 19, 2024

What this PR does / why we need it: This PR adds a check in the indexing code to only create a file permission doc in solr only for the datasetversions the file is in.

Which issue(s) this PR closes:

Special notes for your reviewer: As the note in the code suggests, there are cleaner ways to do this but since this is a relatively rare case (indexing when there is a currently draft version where a file has been added/dropped) I'm not sure refactoring to get more efficiency is worth the effort. (Not to say that adding/removing files is rare, but having two versions to index only occurs while there is a draft and presumably a draft like this doesn't often stay around forever, so I'm guessing this affects only a small number of files per index run. With the bug, the orphan perm docs do accumulate over time though, so fixing the bug somehow is worthwhile.)

Suggestions on how to test this: Create a dataset(s), where the draft version has files not in the original published version or vice versa. Then run /api/admin/index/status and you should see orphaned perm docs (docs in solr but not in the db). After the PR, this should not happen. (If you use the same solr, run /api/admin/index/clear-orphans and either edit the dataset to cause reindexing or just reindex it via the api.)

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?: included

Additional documentation:

@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Dec 19, 2024
@coveralls
Copy link

Coverage Status

coverage: 22.689% (-0.002%) from 22.691%
when pulling e16ff35 on QualitativeDataRepository:IQSS/11113-Fix_file_perm_doc_creation
into 77caada on IQSS:develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: Ready for Triage
Development

Successfully merging this pull request may close these issues.

Indexing creates unused permissions docs
2 participants