Skip to content

Commit

Permalink
Merge branch 'develop' into 10508-base-image-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Jul 25, 2024
2 parents 146c927 + f7cd9f5 commit 610c184
Show file tree
Hide file tree
Showing 25 changed files with 293 additions and 54 deletions.
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Thank you for contributing to the Dataverse Project through the creation of a bu
WARNING: If this is a security issue it should be reported privately to [email protected]
More information on bug issues and contributions can be found in the "Contributing to Dataverse" page:
https://github.com/IQSS/dataverse/blob/develop/CONTRIBUTING.md#bug-reportsissues
https://guides.dataverse.org/en/latest/contributor/index.html
Please fill out as much of the template as you can.
Start below this comment section.
Expand Down Expand Up @@ -44,7 +44,6 @@ Start below this comment section.
**Any related open or closed issues to this bug report?**



**Screenshots:**

No matter the issue, screenshots are always welcome.
Expand All @@ -53,3 +52,7 @@ To add a screenshot, please use one of the following formats and/or methods desc

* https://help.github.com/en/articles/file-attachments-on-issues-and-pull-requests
*


**Are you thinking about creating a pull request for this issue?**
Help is always welcome, is this bug something you or your organization plan to fix?
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea or new feature for the Dataverse software!
title: 'Feature Request/Idea:'
title: 'Feature Request:'
labels: 'Type: Feature'
assignees: ''

Expand All @@ -11,7 +11,7 @@ assignees: ''
Thank you for contributing to the Dataverse Project through the creation of a feature request!
More information on ideas/feature requests and contributions can be found in the "Contributing to Dataverse" page:
https://github.com/IQSS/dataverse/blob/develop/CONTRIBUTING.md#ideasfeature-requests
https://guides.dataverse.org/en/latest/contributor/index.html
Please fill out as much of the template as you can.
Start below this comment section.
Expand All @@ -34,3 +34,6 @@ Start below this comment section.


**Any open or closed issues related to this feature request?**

**Are you thinking about creating a pull request for this feature?**
Help is always welcome, is this feature something you or your organization plan to implement?
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/idea_proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Idea proposal
about: Propose a new idea for discussion to improve the Dataverse software!
title: 'Suggestion:'
labels: 'Type: Suggestion'
assignees: ''

---

<!--
Thank you for contributing to the Dataverse Project through the creation of a feature request!
More information on ideas/feature requests and contributions can be found in the "Contributing to Dataverse" page:
https://guides.dataverse.org/en/latest/contributor/index.html
Please fill out as much of the template as you can.
Start below this comment section.
-->

**Overview of the Suggestion**


**What kind of user is the suggestion intended for?**
(Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)


**What inspired this idea?**


**What existing behavior do you want changed?**


**Any brand new behavior do you want to add to Dataverse?**


**Any open or closed issues related to this suggestion?**


**Are you thinking about creating a pull request for this issue?**
Help is always welcome, is this idea something you or your organization plan to implement?
1 change: 1 addition & 0 deletions doc/release-notes/8796-fix-license-display-indexing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When datasets have neither a license nor custom terms of use the display will indicate this. Also, these datasets will no longer be indexed as having custom terms.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Shapefile Handling will now ignore files under a hidden directory within the zip file

Directories that are hidden will be ignored when determining if a zip file contains Shapefile files.

For more information, see #8945.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
In an earlier Dataverse release, Datasets with only 'CC0 Waiver' in termsofuse field were converted to 'Custom License' instead of CC0 1.0 licenses during an automated process. A new process was added to correct this. Only Datasets with no terms other than the one create by the previous process will be modified.
- The existing 'Terms of Use' must be equal to 'This dataset is made available under a Creative Commons CC0 license with the following additional/modified terms and conditions: CC0 Waiver'
- The following terms fields must be empty: Confidentiality Declaration, Special Permissions, Restrictions, Citation Requirements, Depositor Requirements, Conditions, and Disclaimer.
- The License ID must not be assigned.

This process will set the License ID to that of the CC0 1.0 license and remove the contents of termsofuse field.
3 changes: 3 additions & 0 deletions doc/release-notes/api-blocking-filter-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* When any `ApiBlockingFilter` policy applies to a request, the JSON in the body of the error response is now valid JSON.
In case an API client did any special processing to allow it to parse the body, that is no longer necessary.
The status code of such responses has not changed.
28 changes: 18 additions & 10 deletions doc/sphinx-guides/source/developers/making-releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Making Releases
Introduction
------------

Note: See :doc:`making-library-releases` for how to publish our libraries to Maven Central.

See :doc:`version-control` for background on our branching strategy.
This document is about releasing the main Dataverse app (https://github.com/IQSS/dataverse). See :doc:`making-library-releases` for how to release our various libraries. Other projects have their own release documentation.

The steps below describe making both regular releases and hotfix releases.

Below you'll see branches like "develop" and "master" mentioned. For more on our branching strategy, see :doc:`version-control`.

.. _write-release-notes:

Write Release Notes
Expand All @@ -24,10 +24,10 @@ Developers express the need for an addition to release notes by creating a "rele
The task at or near release time is to collect these snippets into a single file.

- Create an issue in GitHub to track the work of creating release notes for the upcoming release.
- Create a branch, add a .md file for the release (ex. 5.10.1 Release Notes) in ``/doc/release-notes`` and write the release notes, making sure to pull content from the release note snippets mentioned above.
- Delete the release note snippets as the content is added to the main release notes file.
- Include instructions to describe the steps required to upgrade the application from the previous version. These must be customized for release numbers and special circumstances such as changes to metadata blocks and infrastructure.
- Take the release notes .md through the regular Code Review and QA process.
- Create a branch, add a .md file for the release (ex. 5.10.1 Release Notes) in ``/doc/release-notes`` and write the release notes, making sure to pull content from the release note snippets mentioned above. Snippets may not include any issue number or pull request number in the text so be sure copy the number from the filename of the snippet into the final release note.
- Delete (``git rm``) the release note snippets as the content is added to the main release notes file.
- Include instructions describing the steps required to upgrade the application from the previous version. These must be customized for release numbers and special circumstances such as changes to metadata blocks and infrastructure.
- Take the release notes .md through the regular Code Review and QA process. That is, make a pull request.

Create a GitHub Issue and Branch for the Release
------------------------------------------------
Expand Down Expand Up @@ -70,6 +70,13 @@ Once important tests have passed (compile, unit tests, etc.), merge the pull req

If this is a hotfix release, skip this whole "merge develop to master" step (the "develop" branch is not involved until later).

Add Milestone to Pull Requests and Issues
-----------------------------------------

Often someone is making sure that the proper milestone (e.g. 5.10.1) is being applied to pull requests and issues, but sometimes this falls between the cracks.

Check for merged pull requests that have no milestone by going to https://github.com/IQSS/dataverse/pulls and entering `is:pr is:merged no:milestone <https://github.com/IQSS/dataverse/pulls?q=is%3Apr+is%3Amerged+no%3Amilestone>`_ as a query. If you find any, add the milestone to the pull request and any issues it closes. This includes the "merge develop into master" pull request above.

(Optional) Test Docker Images
-----------------------------

Expand Down Expand Up @@ -106,7 +113,7 @@ Create a Draft Release on GitHub
Go to https://github.com/IQSS/dataverse/releases/new to start creating a draft release.

- Under "Choose a tag" you will be creating a new tag. Have it start with a "v" such as ``v5.10.1``. Click "Create new tag on publish".
- Under "Target" go to "Recent Commits" and select the merge commit from when you merged ``develop`` into ``master`` above. This commit will appear in ``/api/info/version`` from a running installation.
- Under "Target", choose "master". This commit will appear in ``/api/info/version`` from a running installation.
- Under "Release title" use the same name as the tag such as ``v5.10.1``.
- In the description, copy and paste the content from the release notes .md file created in the "Write Release Notes" steps above.
- Click "Save draft" because we do not want to publish the release yet.
Expand Down Expand Up @@ -153,6 +160,7 @@ ssh into the dataverse-internal server and do the following:
- ``mkdir target``
- ``cp /tmp/dataverse-5.10.1.war target``
- ``cd scripts/installer``
- ``make clean``
- ``make``

A zip file called ``dvinstall.zip`` should be produced.
Expand All @@ -175,7 +183,7 @@ Upload the following artifacts to the draft release you created:
Deploy on Demo
--------------

Now that you have the release ready to go, give it one final test by deploying it on https://demo.dataverse.org . Note that this is also an opportunity to re-test the upgrade checklist as described in the release note.
Now that you have the release ready to go, consider giving it one final test by deploying it on https://demo.dataverse.org. Note that this is also an opportunity to re-test the upgrade checklist as described in the release note.

Publish the Release
-------------------
Expand All @@ -194,7 +202,7 @@ ssh into the guides server and update the symlink to point to the latest release
cd /var/www/html/en
ln -s 5.10.1 latest
This step could be done before publishing the release if you'd like to double check that links in the release notes work.

Close Milestone on GitHub and Create a New One
----------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,8 @@ Reported Working S3-Compatible Storage
Note that for direct uploads and downloads, Dataverse redirects to the proxy-url but presigns the urls based on the ``dataverse.files.<id>.custom-endpoint-url``. Also, note that if you choose to enable ``dataverse.files.<id>.download-redirect`` the S3 URLs expire after 60 minutes by default. You can change that minute value to reflect a timeout value that’s more appropriate by using ``dataverse.files.<id>.url-expiration-minutes``.

`Surf Object Store v2019-10-30 <https://www.surf.nl/en>`_
Set ``dataverse.files.<id>.payload-signing=true`` and ``dataverse.files.<id>.chunked-encoding=false`` to use Surf Object
Store.
Set ``dataverse.files.<id>.payload-signing=true``, ``dataverse.files.<id>.chunked-encoding=false`` and ``dataverse.files.<id>.path-style-request=true`` to use Surf Object
Store. You will need the Swift client (documented at <http://doc.swift.surfsara.nl/en/latest/Pages/Clients/s3cred.html>) to create the access key and secret key for the S3 interface.

Note that the ``dataverse.files.<id>.proxy-url`` setting can be used in installations where the object store is proxied, but it should be considered an advanced option that will require significant expertise to properly configure.
For direct uploads and downloads, Dataverse redirects to the proxy-url but presigns the urls based on the ``dataverse.files.<id>.custom-endpoint-url``.
Expand Down
32 changes: 19 additions & 13 deletions src/main/java/edu/harvard/iq/dataverse/DatasetField.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@ public int compare(DatasetField o1, DatasetField o2) {
o2.getDatasetFieldType().getDisplayOrder() );
}};

public static DatasetField createNewEmptyDatasetField(DatasetFieldType dsfType, Object dsv) {
public static DatasetField createNewEmptyDatasetField(DatasetFieldType dsfType, DatasetVersion dsv) {

DatasetField dsfv = createNewEmptyDatasetField(dsfType);
//TODO - a better way to handle this?
if (dsv.getClass().getName().equals("edu.harvard.iq.dataverse.DatasetVersion")){
dsfv.setDatasetVersion((DatasetVersion)dsv);
} else {
dsfv.setTemplate((Template)dsv);
}
dsfv.setDatasetVersion(dsv);

return dsfv;
}

public static DatasetField createNewEmptyDatasetField(DatasetFieldType dsfType, Template dsv) {

DatasetField dsfv = createNewEmptyDatasetField(dsfType);
dsfv.setTemplate(dsv);

return dsfv;
}
Expand Down Expand Up @@ -545,25 +548,28 @@ public String toString() {
return "edu.harvard.iq.dataverse.DatasetField[ id=" + id + " ]";
}

public DatasetField copy(Object version) {
public DatasetField copy(DatasetVersion version) {
return copy(version, null);
}
public DatasetField copy(Template template) {
return copy(template, null);
}

// originally this was an overloaded method, but we renamed it to get around an issue with Bean Validation
// (that looked t overloaded methods, when it meant to look at overriden methods
public DatasetField copyChild(DatasetFieldCompoundValue parent) {
return copy(null, parent);
}

private DatasetField copy(Object version, DatasetFieldCompoundValue parent) {
private DatasetField copy(Object versionOrTemplate, DatasetFieldCompoundValue parent) {
DatasetField dsf = new DatasetField();
dsf.setDatasetFieldType(datasetFieldType);

if (version != null) {
if (version.getClass().getName().equals("edu.harvard.iq.dataverse.DatasetVersion")) {
dsf.setDatasetVersion((DatasetVersion) version);
if (versionOrTemplate != null) {
if (versionOrTemplate instanceof DatasetVersion) {
dsf.setDatasetVersion((DatasetVersion) versionOrTemplate);
} else {
dsf.setTemplate((Template) version);
dsf.setTemplate((Template) versionOrTemplate);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,23 @@ private void msg(String s){
//logger.fine(s);
}

public boolean isVersionDefaultCustomTerms(DatasetVersion datasetVersion) {

if (datasetVersion.getId() != null) {
try {
TermsOfUseAndAccess toua = (TermsOfUseAndAccess) em.createNamedQuery("TermsOfUseAndAccess.findByDatasetVersionIdAndDefaultTerms")
.setParameter("id", datasetVersion.getId()).setParameter("defaultTerms", TermsOfUseAndAccess.DEFAULT_NOTERMS).getSingleResult();
if (toua != null && datasetVersion.getTermsOfUseAndAccess().getLicense() == null) {
return true;
}

} catch (NoResultException e) {
return false;
}
}
return false;
}

/**
* Does the version identifier in the URL ask for a "DRAFT"?
*
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/TermsOfUseAndAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@
import jakarta.persistence.Transient;

import edu.harvard.iq.dataverse.license.License;
import jakarta.persistence.NamedQueries;
import jakarta.persistence.NamedQuery;

@NamedQueries({
// TermsOfUseAndAccess.findByDatasetVersionIdAndDefaultTerms
// is used to determine if the dataset terms were set by the multi license support update
// as part of the 5.10 release.

@NamedQuery(name = "TermsOfUseAndAccess.findByDatasetVersionIdAndDefaultTerms",
query = "SELECT o FROM TermsOfUseAndAccess o, DatasetVersion dv WHERE "
+ "dv.id =:id "
+ "AND dv.termsOfUseAndAccess.id = o.id "
+ "AND o.termsOfUse =:defaultTerms "
+ "AND o.confidentialityDeclaration IS null "
+ "AND o.specialPermissions IS null "
+ "AND o.restrictions IS null "
+ "AND o.citationRequirements IS null "
+ "AND o.depositorRequirements IS null "
+ "AND o.conditions IS null "
+ "AND o.disclaimer IS null "
)
})

/**
*
Expand All @@ -26,6 +48,8 @@
@Entity
@ValidateTermsOfUseAndAccess
public class TermsOfUseAndAccess implements Serializable {

public static final String DEFAULT_NOTERMS = "This dataset is made available without information on how it can be used. You should communicate with the Contact(s) specified before use.";

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void doBlock(ServletRequest sr, ServletResponse sr1, FilterChain fc) thro
@Override
public void doBlock(ServletRequest sr, ServletResponse sr1, FilterChain fc) throws IOException, ServletException {
HttpServletResponse httpResponse = (HttpServletResponse) sr1;
httpResponse.getWriter().println("{ status:\"error\", message:\"Endpoint blocked. Please contact the dataverse administrator\"}" );
httpResponse.getWriter().println("{ \"status\":\"error\", \"message\":\"Endpoint blocked. Please contact the dataverse administrator\"}" );
httpResponse.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
httpResponse.setContentType("application/json");
}
Expand All @@ -67,7 +67,7 @@ public void doBlock(ServletRequest sr, ServletResponse sr1, FilterChain fc) thro
fc.doFilter(sr, sr1);
} else {
HttpServletResponse httpResponse = (HttpServletResponse) sr1;
httpResponse.getWriter().println("{ status:\"error\", message:\"Endpoint available from localhost only. Please contact the dataverse administrator\"}" );
httpResponse.getWriter().println("{ \"status\":\"error\", \"message\":\"Endpoint available from localhost only. Please contact the dataverse administrator\"}" );
httpResponse.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
httpResponse.setContentType("application/json");
}
Expand Down Expand Up @@ -102,7 +102,7 @@ public void doBlock(ServletRequest sr, ServletResponse sr1, FilterChain fc) thro

if ( block ) {
HttpServletResponse httpResponse = (HttpServletResponse) sr1;
httpResponse.getWriter().println("{ status:\"error\", message:\"Endpoint available using API key only. Please contact the dataverse administrator\"}" );
httpResponse.getWriter().println("{ \"status\":\"error\", \"message\":\"Endpoint available using API key only. Please contact the dataverse administrator\"}" );
httpResponse.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
httpResponse.setContentType("application/json");
} else {
Expand Down
Loading

0 comments on commit 610c184

Please sign in to comment.