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

8092 timestamp of data access request #9257

Merged

Conversation

ericdevries
Copy link
Contributor

@ericdevries ericdevries commented Jan 4, 2023

What this PR does / why we need it:

This adds a date column to the restricted file access request overview, indicating when the earliest request by that user was made.

It also fixes an issue where the request list was not updated when a request was approved or rejected.

To reproduce this bug (outside this branch) perform the following steps:

  • create a dataset with one or more restricted files
  • sign in with a different user that does not have permissions already to download the files
  • request access on the files
  • sign back in as the owner of the dataset
  • go to Edit Dataset > Permissions > Files
  • approve or reject the request
  • notice how the data table with the approve and reject options does not disappear or update when clicked.

Which issue(s) this PR closes:

Special notes for your reviewer:

Suggestions on how to test this:

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

Yes, it adds a date column to the restricted file access request overview. See screenshot below:

Screenshot 2023-01-04 at 18-27-26 Restricted File Permissions - gasdf

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

Yes, added.

Additional documentation:

None.

@pdurbin pdurbin added Feature: Request Access Workflow Size: 10 A percentage of a sprint. 7 hours. labels Jan 4, 2023
@coveralls
Copy link

coveralls commented Jan 4, 2023

Coverage Status

Coverage: 20.167% (-0.02%) from 20.184% when pulling e2ddfd8 on ericdevries:8092-timestamp-of-data-access-request into 4903e9f on IQSS:develop.

@pdurbin
Copy link
Member

pdurbin commented Jan 4, 2023

@ericdevries thanks for the pull request! I added a release note, which you are welcome to tweak.

I took a quick look at the docs and I don't think we need any changes there.

API tests are passing. That's good.

You mentioned fixing a related bug. Can you please provide steps for reproducing that bug?

Finally, if you have a screenshot to share, you can put it under "Does this PR introduce a user interface change?" above.

I gave this a size of 10 because it involves a database update and a fair amount of code was changed. I put it in the community backlog. Thanks again!

@ericdevries
Copy link
Contributor Author

I added the screenshot and the description on how to reproduce the bug. Let me know if you need anything else.

@janvanmansum
Copy link
Contributor

@npoppelier: this PR should address your request for a date in file access request table.

@pdurbin : we cannot access the Jenkins build. Can you give more information about why it failed so @ericdevries can address it?

Thanks!

@pdurbin
Copy link
Member

pdurbin commented Jan 6, 2023

we cannot access the Jenkins build.

Yes, I'm sorry about this. It used to be open to the public but it's hard to do this securely. We can poke an hole in the firewall for an IP for you if you'd like.

Can you give more information about why it failed so @ericdevries can address it?

Please don't worry about it. The test that failed is simply flaky. I opened this issue so that we can address it separately:

@mreekie
Copy link

mreekie commented Jan 10, 2023

Prio meeting with Stefano.

  • Moved from Community Backlog to ordered backlog

@sekmiller sekmiller self-assigned this Mar 20, 2023
file.getFileAccessRequesters().remove(au);
boolean actionPerformed = false;
for (DataFile file : files) {
file.removeFileAccessRequester(au);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we test here to make sure that the removeFileAccessRequest was successful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, we do this on another place as well. I'll update it.

@@ -0,0 +1,2 @@
ALTER TABLE fileaccessrequests
ADD COLUMN IF NOT EXISTS creation_time TIMESTAMP WITHOUT TIME ZONE DEFAULT now();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to add a composite key to the table - though it might be problematic for upgrades, if there are any datafiles with multiple open requests from a given user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was indeed the problem I faced while building this. If the migration scripts support queries as well, we could do some kind of group by trick and table renaming to remove duplicate rows and create a fresh table with only unique rows.

This will also require some changes in the code however.

So the question is, would something like this:

-- note this is pseudo-sql
create table tmp_fileaccessrequests (user_id, file_id);

insert into tmp_fileaccessrequests 
select distinct user_id, file_id from fileaccessrequests;

drop table fileaccessrequests;
rename table tmp_fileaccessrequests to fileaccessrequests;

be an acceptable solution?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. That would work and ensure that we don't lose any data. Just modify the script to add this to the top then add the key at the end. Thanks!

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.

Looks good overall. Just a couple of comments/questions.

Also, please update with the latest from the develop branch.

Thanks for the contribution!

@sekmiller
Copy link
Contributor

@ericdevries , thanks for the PR. Just wanted to make sure you saw my questions/comments.

@sekmiller
Copy link
Contributor

Hi @ericdevries just wanted to ask if you've had a chance to consider my questions/suggestions for this PR. Thanks!

@mreekie mreekie added Size: 3 A percentage of a sprint. 2.1 hours. and removed Size: 10 A percentage of a sprint. 7 hours. labels Mar 29, 2023
@mreekie
Copy link

mreekie commented Mar 29, 2023

next sprint:

  • Review is done.
  • Waiting on input from originator of the pull request.
  • 10 to 3 for this sprint

@ericdevries
Copy link
Contributor Author

My apologies for the late reply, I did not see your questions. See my comments on your comments so we can further discuss what to do here

@qqmyers qqmyers added the GDCC: DANS related to GDCC work for DANS label Apr 6, 2023
@qqmyers qqmyers added this to the 5.14 milestone Apr 6, 2023
@sekmiller
Copy link
Contributor

@ericdevries please make the update to the migration script that we discussed last week. Also make sure that you've updated this branch with the latest from our dev branch. Once those are done we can get this PR into QA. Thanks!

@sekmiller
Copy link
Contributor

@ericdevries are you able to make the update I suggested for the migration script? If not, I can take it over.

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.

Changes as discussed have been made. I updated the migration script

@kcondon kcondon self-assigned this Apr 26, 2023
@kcondon kcondon merged commit cd54e8b into IQSS:develop Apr 26, 2023
@qqmyers qqmyers mentioned this pull request May 19, 2023
qqmyers added a commit to GlobalDataverseCommunityConsortium/dataverse that referenced this pull request Jul 7, 2023
seen in the Edit Permissions/File dialog when clicking the link with the
# of files listed. In that dialog, things explode trying to get the
directoryLabel of a FileAccessRequest (seen in log) and the popup dialog
incorrectly shows the input to select a user, only has a grant button
(no reject), and doesn't work (the last could be an issue with this
branch only).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Request Access Workflow GDCC: DANS related to GDCC work for DANS Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

timestamp of data access request
8 participants