-
Notifications
You must be signed in to change notification settings - Fork 533
Feature to limit file uploads to datasets #11520
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
Merged
ofahimIQSS
merged 20 commits into
develop
from
11275-add-limit-to-number-of-dataset-files
Jun 24, 2025
Merged
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
61a50ef
add feture to limit filw uploads to datasets
stevenwinship fa29516
fix checkstyle
stevenwinship 144543e
fix for unit testing
stevenwinship 02c6ca0
clean up comments
stevenwinship c1a922c
update docs
stevenwinship e4245b0
renamed sql migration file
stevenwinship e972f80
Merge branch 'develop' into 11275-add-limit-to-number-of-dataset-files
stevenwinship 0a9b30e
move file count limit from dvObject to dvObjectContainer
stevenwinship 41fc637
adding datasetFileUploadsAvailable to response
stevenwinship 723c498
fix replace
stevenwinship 2b7d238
fix null pointer
stevenwinship 380a7aa
fix superuser ignore limits
stevenwinship e0e396b
allow for limit of 0 to make dataset effectivly read only
stevenwinship a2eaa53
fix unit test
stevenwinship 9cfa6be
add ui integration with file count limit
stevenwinship 9ab793c
Merge branch 'develop' into 11275-add-limit-to-number-of-dataset-files
stevenwinship 413d9e6
change flyway script from 6.6.02 to 6.6.01
stevenwinship 5234479
Merge branch 'develop' into 11275-add-limit-to-number-of-dataset-files
stevenwinship 559cf0f
fix typo in doc
stevenwinship 6ef975f
adding limit check on multi file upload
stevenwinship File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
doc/release-notes/11275-add-limit-to-number-of-dataset-files.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ### Files attached to a Dataset can now be limited by count | ||
|
|
||
| Added the ability to set a limit on the number of files that can be uploaded to a Dataset. Limits can be set globally through a JVM setting or set per Collection or Dataset. | ||
|
|
||
| See also [the guides](https://dataverse-guide--11359.org.readthedocs.build/en/11359/api/native-api.html#imposing-a-limit-to-the-number-of-files-allowed-to-be-uploaded-to-a-dataset), #11275, and #11359. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| { | ||
| "datasetVersion": { | ||
| "license": { | ||
| "name": "CC0 1.0", | ||
| "uri": "http://creativecommons.org/publicdomain/zero/1.0" | ||
| }, | ||
| "metadataBlocks": { | ||
| "citation": { | ||
| "fields": [ | ||
| { | ||
| "value": "Darwin's Finches", | ||
| "typeClass": "primitive", | ||
| "multiple": false, | ||
| "typeName": "title" | ||
| }, | ||
| { | ||
| "value": [ | ||
| { | ||
| "authorName": { | ||
| "value": "Finch, Fiona", | ||
| "typeClass": "primitive", | ||
| "multiple": false, | ||
| "typeName": "authorName" | ||
| }, | ||
| "authorAffiliation": { | ||
| "value": "Birds Inc.", | ||
| "typeClass": "primitive", | ||
| "multiple": false, | ||
| "typeName": "authorAffiliation" | ||
| } | ||
| } | ||
| ], | ||
| "typeClass": "compound", | ||
| "multiple": true, | ||
| "typeName": "author" | ||
| }, | ||
| { | ||
| "value": [ | ||
| { "datasetContactEmail" : { | ||
| "typeClass": "primitive", | ||
| "multiple": false, | ||
| "typeName": "datasetContactEmail", | ||
| "value" : "finch@mailinator.com" | ||
| }, | ||
| "datasetContactName" : { | ||
| "typeClass": "primitive", | ||
| "multiple": false, | ||
| "typeName": "datasetContactName", | ||
| "value": "Finch, Fiona" | ||
| } | ||
| }], | ||
| "typeClass": "compound", | ||
| "multiple": true, | ||
| "typeName": "datasetContact" | ||
| }, | ||
| { | ||
| "value": [ { | ||
| "dsDescriptionValue":{ | ||
| "value": "Darwin's finches (also known as the Galápagos finches) are a group of about fifteen species of passerine birds.", | ||
| "multiple":false, | ||
| "typeClass": "primitive", | ||
| "typeName": "dsDescriptionValue" | ||
| }}], | ||
| "typeClass": "compound", | ||
| "multiple": true, | ||
| "typeName": "dsDescription" | ||
| }, | ||
| { | ||
| "value": [ | ||
| "Medicine, Health and Life Sciences" | ||
| ], | ||
| "typeClass": "controlledVocabulary", | ||
| "multiple": true, | ||
| "typeName": "subject" | ||
| } | ||
| ], | ||
| "displayName": "Citation Metadata" | ||
| } | ||
| } | ||
| }, | ||
| "datasetFileCountLimit": 100 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is super important to have this config setting implemented for both collections AND datasets. In real life, I'm guessing it's going to be a somewhat common case where a specific dataset will need to be given a higher limit, because of some respectable reason. It appears to be working consistently when defined on either level.
However - and this may be penny-pinching, admittedly - I'm wondering if we want this column to be in the DvObject table; seeing how most DvObjects are files. Please at least consider making it a DvObjectContainer-only element. (see dvObjectContainer.storageDriver for an example; it ends up being an extra column in the Dataverse and Dataset tables each).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about the penny-pinching comment. Columns in the database that are null take up no space and therefore add no pennies to all the DvObject Datafiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does have to get loaded into the objects though. Further - it's just odd that a file has a datasetFileCountLimit, which wouldn't be the case if it's on DvObjectContainer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I'll move it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, phrasing it in terms of objects makes more sense. I just wanted to emphasize that it was possible, even though there is no dedicated table in the db for DvObjectContainer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it