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

sql script/flyway to fix file access requests #11061

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

Conversation

stevenwinship
Copy link
Contributor

What this PR does / why we need it: To prevent duplicate keys when user requests access to a file

Which issue(s) this PR closes: #10714

Special notes for your reviewer:

Suggestions on how to test this: Create a database before updating to this code. Add dataset with multiple files (restricted) and publish the dataset. From another user request access multiple times for multiple files. Manually delete the "Created" from the request_state UPDATE fileaccessrequests SET request_state=NULL;
Update Dataverse with this code and re-deploy. You should see any duplicate requests deleted from the database (oldest will remain for each file/user). Once updated the database will have only one request for each file/user and the UI will show "Access Requested"

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

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

Additional documentation:

@stevenwinship stevenwinship self-assigned this Dec 3, 2024
@stevenwinship stevenwinship added FY25 Sprint 11 FY25 Sprint 11 (2024-11-20 - 2024-12-04) Type: Bug a defect Size: 3 A percentage of a sprint. 2.1 hours. labels Dec 3, 2024
@coveralls
Copy link

coveralls commented Dec 3, 2024

Coverage Status

coverage: 22.573% (+0.002%) from 22.571%
when pulling c1a3276 on 10714-access-requests-missing-since-upgrade-v6-0
into e3b5795 on develop.

This comment has been minimized.

@stevenwinship stevenwinship removed their assignment Dec 4, 2024
@cmbz cmbz added the FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) label Dec 5, 2024

This comment has been minimized.

1 similar comment

This comment has been minimized.

@sekmiller sekmiller self-assigned this Dec 16, 2024
Copy link
Contributor

@sekmiller sekmiller left a comment

Choose a reason for hiding this comment

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

The update script looks good. Just wondering if you considered putting on a DB constraint as Jim suggested.

AND far2.authenticated_user_id = fileaccessrequests.authenticated_user_id
AND far2.request_state is NULL);

UPDATE fileaccessrequests SET request_state='CREATED' WHERE request_state is NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you consider putting a DB constraint on as Jim suggested?

Copy link
Contributor Author

@stevenwinship stevenwinship Dec 16, 2024

Choose a reason for hiding this comment

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

@qqmyers Could you add your suggestion here please?

Never mind. I see it in the Issue

Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10714-access-requests-missing-since-upgrade-v6-0
ghcr.io/gdcc/configbaker:10714-access-requests-missing-since-upgrade-v6-0

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 11 FY25 Sprint 11 (2024-11-20 - 2024-12-04) FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect
Projects
Status: Ready for QA ⏩
Development

Successfully merging this pull request may close these issues.

Access requests missing on the File Permission Page since upgrading from 6.0 to 6.2
4 participants