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

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

stevenwinship
Copy link
Contributor

@stevenwinship stevenwinship commented Dec 3, 2024

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: Delete docker-dev-volumes directory.
Check out develop branch first, build and deploy in docker.
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;
Checkout this PR, build and 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.751%. remained the same
when pulling f56dc6b on 10714-access-requests-missing-since-upgrade-v6-0
into a6e36f6 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

This comment has been minimized.

@cmbz cmbz added the FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) label Jan 2, 2025
@cmbz cmbz added the FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) label Jan 15, 2025
@ofahimIQSS ofahimIQSS self-assigned this Jan 16, 2025
@ofahimIQSS
Copy link
Contributor

Before PR in local
image

After PR in local
image

Merging PR no issues found

@ofahimIQSS ofahimIQSS merged commit 69ebed2 into develop Jan 17, 2025
19 of 20 checks passed
@ofahimIQSS ofahimIQSS deleted the 10714-access-requests-missing-since-upgrade-v6-0 branch January 17, 2025 20:40
@ofahimIQSS ofahimIQSS removed their assignment Jan 17, 2025
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.

@pdurbin pdurbin added this to the 6.6 milestone Jan 18, 2025
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) FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect
Projects
None yet
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
6 participants