-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 10104-get-dataset-citation-deaccessioned #…
- Loading branch information
Showing
7 changed files
with
84 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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,3 @@ | ||
We have started maintaining an API changelog: https://dataverse-guide--10127.org.readthedocs.build/en/10127/api/changelog.html | ||
|
||
See also #10060. |
This file contains 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,13 @@ | ||
API Changelog | ||
============= | ||
|
||
.. contents:: |toctitle| | ||
:local: | ||
:depth: 1 | ||
|
||
6.0 | ||
----- | ||
|
||
Changes | ||
~~~~~~~ | ||
- **/api/access/datafile**: When a null or invalid API token is provided to download a public (non-restricted) file with this API call, it will result on a ``401`` error response. Previously, the download was allowed (``200`` response). Please note that we noticed this change sometime between 5.9 and 6.0. If you can help us pinpoint the exact version (or commit!), please get in touch. |
This file contains 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 |
---|---|---|
|
@@ -24,3 +24,4 @@ API Guide | |
linkeddatanotification | ||
apps | ||
faq | ||
changelog |
This file was deleted.
Oops, something went wrong.
This file contains 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
34 changes: 34 additions & 0 deletions
34
src/main/resources/db/migration/V6.0.0.3__10095-guestbook-at-request2.sql
This file contains 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,34 @@ | ||
-- This creates a function that ESTIMATES the size of the | ||
-- GuestbookResponse table (for the metrics display), instead | ||
-- of relying on straight "SELECT COUNT(*) ..." | ||
-- It uses statistics to estimate the number of guestbook entries | ||
-- and the fraction of them related to downloads, | ||
-- i.e. those that weren't created for 'AccessRequest' events. | ||
-- Significant potential savings for an active installation. | ||
-- See https://github.com/IQSS/dataverse/issues/8840 and | ||
-- https://github.com/IQSS/dataverse/pull/8972 for more details | ||
|
||
CREATE OR REPLACE FUNCTION estimateGuestBookResponseTableSize() | ||
RETURNS bigint AS $$ | ||
DECLARE | ||
estimatedsize bigint; | ||
BEGIN | ||
SELECT CASE WHEN relpages<10 THEN 0 | ||
ELSE ((reltuples / relpages) | ||
* (pg_relation_size('public.guestbookresponse') / current_setting('block_size')::int))::bigint | ||
* (SELECT CASE WHEN ((select count(*) from pg_stats where tablename='guestbookresponse') = 0 | ||
OR (select array_position(most_common_vals::text::text[], 'AccessRequest') | ||
FROM pg_stats WHERE tablename='guestbookresponse' AND attname='eventtype') IS NULL) THEN 1 | ||
ELSE 1 - (SELECT (most_common_freqs::text::text[])[array_position(most_common_vals::text::text[], 'AccessRequest')]::float | ||
FROM pg_stats WHERE tablename='guestbookresponse' and attname='eventtype') END) | ||
END | ||
FROM pg_class | ||
WHERE oid = 'public.guestbookresponse'::regclass INTO estimatedsize; | ||
|
||
if estimatedsize = 0 then | ||
SELECT COUNT(id) FROM guestbookresponse WHERE eventtype!= 'AccessRequest' INTO estimatedsize; | ||
END if; | ||
|
||
RETURN estimatedsize; | ||
END; | ||
$$ LANGUAGE plpgsql IMMUTABLE; |
This file contains 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