Skip to content

Commit c70d2c1

Browse files
committed
Merge remote-tracking branch 'upstreamdspace/dspace-8_x' into main-cris
# Conflicts: # profiles.md # statistics-reports.md # suggestions.md # suggestionsources.md # suggestiontargets.md # workspaceitems.md
2 parents e9958e0 + 52cdcc4 commit c70d2c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2872
-312
lines changed

.github/workflows/issue_opened.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
issues:
66
types: [opened]
77

8+
permissions: {}
89
jobs:
910
automation:
1011
runs-on: ubuntu-latest
@@ -15,7 +16,7 @@ jobs:
1516
# Only add to project board if issue is flagged as "needs triage" or has no labels
1617
# NOTE: By default we flag new issues as "needs triage" in our issue template
1718
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
18-
uses: actions/add-to-project@v0.3.0
19+
uses: actions/add-to-project@v0.5.0
1920
# Note, the authentication token below is an ORG level Secret.
2021
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2122
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow checks open PRs for merge conflicts and labels them when conflicts are found
2+
name: Check for merge conflicts
3+
4+
# Run this for all pushes (i.e. merges) to 'main' or maintenance branches
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- 'dspace-**'
10+
# So that the `conflict_label_name` is removed if conflicts are resolved,
11+
# we allow this to run for `pull_request_target` so that github secrets are available.
12+
pull_request_target:
13+
types: [ synchronize ]
14+
15+
permissions: {}
16+
17+
jobs:
18+
triage:
19+
# Ensure this job never runs on forked repos. It's only executed for 'DSpace/RestContract'
20+
if: github.repository == 'dspace/restcontract'
21+
runs-on: ubuntu-latest
22+
permissions:
23+
pull-requests: write
24+
steps:
25+
# See: https://github.com/prince-chrismc/label-merge-conflicts-action
26+
- name: Auto-label PRs with merge conflicts
27+
uses: prince-chrismc/label-merge-conflicts-action@v3
28+
# Ignore any failures -- may occur (randomly?) for older, outdated PRs.
29+
continue-on-error: true
30+
# Add "merge conflict" label if a merge conflict is detected. Remove it when resolved.
31+
# Note, the authentication token is created automatically
32+
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
33+
with:
34+
conflict_label_name: 'merge conflict'
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
conflict_comment: |
37+
Hi @${author},
38+
Conflicts have been detected against the base branch.
39+
Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks!
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will attempt to port a merged pull request to
2+
# the branch specified in a "port to" label (if exists)
3+
name: Port merged Pull Request
4+
5+
# Only run for merged PRs against the "main" or maintenance branches
6+
# We allow this to run for `pull_request_target` so that github secrets are available
7+
# (This is required when the PR comes from a forked repo)
8+
on:
9+
pull_request_target:
10+
types: [ closed ]
11+
branches:
12+
- main
13+
- 'dspace-**'
14+
15+
permissions:
16+
contents: write # so action can add comments
17+
pull-requests: write # so action can create pull requests
18+
19+
jobs:
20+
port_pr:
21+
runs-on: ubuntu-latest
22+
# Don't run on closed *unmerged* pull requests
23+
if: github.event.pull_request.merged
24+
steps:
25+
# Checkout code
26+
- uses: actions/checkout@v4
27+
# Port PR to other branch (ONLY if labeled with "port to")
28+
# See https://github.com/korthout/backport-action
29+
- name: Create backport pull requests
30+
uses: korthout/backport-action@v2
31+
with:
32+
# Trigger based on a "port to [branch]" label on PR
33+
# (This label must specify the branch name to port to)
34+
label_pattern: '^port to ([^ ]+)$'
35+
# Title to add to the (newly created) port PR
36+
pull_title: '[Port ${target_branch}] ${pull_title}'
37+
# Description to add to the (newly created) port PR
38+
pull_description: 'Port of #${pull_number} by @${pull_author} to `${target_branch}`.'
39+
# Copy all labels from original PR to (newly created) port PR
40+
# NOTE: The labels matching 'label_pattern' are automatically excluded
41+
copy_labels_pattern: '.*'
42+
# Skip any merge commits in the ported PR. This means only non-merge commits are cherry-picked to the new PR
43+
merge_commits: 'skip'
44+
# Use a personal access token (PAT) to create PR as 'dspace-bot' user.
45+
# A PAT is required in order for the new PR to trigger its own actions (for CI checks)
46+
github_token: ${{ secrets.PR_PORT_TOKEN }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow runs whenever a new pull request is created
2+
name: Pull Request opened
3+
4+
# Only run for newly opened PRs against the "main" or maintenance branches
5+
# We allow this to run for `pull_request_target` so that github secrets are available
6+
# (This is required to assign a PR back to the creator when the PR comes from a forked repo)
7+
on:
8+
pull_request_target:
9+
types: [ opened ]
10+
branches:
11+
- main
12+
- 'dspace-**'
13+
14+
permissions:
15+
pull-requests: write
16+
17+
jobs:
18+
automation:
19+
runs-on: ubuntu-latest
20+
steps:
21+
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
22+
# See https://github.com/toshimaru/auto-author-assign
23+
- name: Assign PR to creator
24+
uses: toshimaru/[email protected]

authorizations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Return codes:
4242

4343
The supported parameters are:
4444
* page, size [see pagination](README.md#Pagination)
45-
* uri: mandatory, the object to use for the authorization check. The full URI of the rest resource must be specified, i.e. https://{dspace.url}/api/core/community/{uuid}
45+
* uri: mandatory, the object to use for the authorization check. The full URI of the rest resource must be specified, i.e. https://{dspace.url}/api/core/communities/{uuid}
4646
* eperson: optional, the uuid of the eperson to evaluate for authorization. If not specified authorization of anonymous users will be returned
4747
* feature: optional, limit the returned authorization to the specified feature (this provide an alternative to codify the authorization id rule on the client side)
4848

@@ -60,7 +60,7 @@ Return codes:
6060
The supported parameters are:
6161
* page, size [see pagination](README.md#Pagination)
6262
* uuid: mandatory, repeatable. Represents the list of objects to be used for the authorization check. For each of them, the UUID must be specified.2
63-
* type: mandatory. Represents the type of resource(s) (i.e. "core.item", "workflow.workflowitem",...) on which authorizations are checked.
63+
* type: mandatory. Represents the type of resource(s) (i.e. "core.items", "workflow.workflowitems",...) on which authorizations are checked.
6464
* eperson: optional, the uuid of the eperson to evaluate for authorization. If not specified authorization of anonymous users will be returned
6565
* feature: optional, repeatable. Represents the list of features. Limits the returned authorizations to the specified features (this provide an alternative to codify the authorization id rule on the client side)
6666

collections.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,31 +663,31 @@ Status codes:
663663
* 422: if the collection didn't contain an administrator group
664664

665665
#### Collection Submitters
666-
**/api/core/communities/<:uuid>/submittersGroup**
666+
**/api/core/collections/<:uuid>/submittersGroup**
667667

668668
Endpoints for managing the Collection Submitters group
669669

670670
This works identical to the [Collection administrators](#collection-administrators),
671671
except the collection administrators can also create the submitters group.
672672

673673
#### Collection Default item READ rights group
674-
**/api/core/communities/<:uuid>/itemReadGroup**
674+
**/api/core/collections/<:uuid>/itemReadGroup**
675675

676676
Endpoints for managing the Collection Default item READ rights group
677677

678678
This works identical to the [Collection administrators](#collection-administrators),
679679
except the collection administrators can also create the Collection Default item READ rights group.
680680

681681
#### Collection Default bitstream READ rights group
682-
**/api/core/communities/<:uuid>/bitstreamReadGroup**
682+
**/api/core/collections/<:uuid>/bitstreamReadGroup**
683683

684684
Endpoints for managing the Collection Default bitstream READ rights group
685685

686686
This works identical to the [Collection administrators](#collection-administrators),
687687
except the collection administrators can also create the Collection Default bitstream READ rights group
688688

689689
#### Collection Workflow groups
690-
**/api/core/communities/<:uuid>/workflowGroups/<:workflow-role>**
690+
**/api/core/collections/<:uuid>/workflowGroups/<:workflow-role>**
691691

692692
Endpoints for managing the Collection Workflow groups
693693

@@ -703,7 +703,7 @@ The workflow role can be e.g.:
703703
* reviewmanagers
704704

705705
##### Delete a collection workflow group
706-
**DELETE /api/core/communities/<:uuid>/workflowGroups/<:workflow-role>**
706+
**DELETE /api/core/collections/<:uuid>/workflowGroups/<:workflow-role>**
707707

708708
Delete the Group associated with a Workflow role.
709709

@@ -749,7 +749,7 @@ Provide updated metadata information about a specific collection, when the updat
749749
```json
750750
{
751751
"uuid": "20263916-6a3d-4fdc-a44a-4616312f030c",
752-
"name": "test collection",
752+
"handle": "10673/2",
753753
"metadata": {
754754
"dc.title": [
755755
{
@@ -767,7 +767,8 @@ Provide updated metadata information about a specific collection, when the updat
767767
"confidence": -1
768768
}
769769
]
770-
}
770+
},
771+
"type": "collection"
771772
}
772773
```
773774

communities.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,7 @@ Provide updated metadata information about a specific community, when the update
359359

360360
```json
361361
{
362-
"id": "b8872eba-1a79-4b8b-a8f6-55fa8f73197b",
363362
"uuid": "b8872eba-1a79-4b8b-a8f6-55fa8f73197b",
364-
"name": "test new title",
365363
"handle": "123456789/60631",
366364
"metadata": {
367365
"dc.title": [
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Filtered Collections report
2+
[Back to the list of all defined endpoints](endpoints.md)
3+
4+
This endpoint provides aggregated statistics about the number of items per collection according to selected filters.
5+
6+
NOTE: This is currently a beta feature.
7+
8+
9+
**GET /api/contentreport/filteredcollections**
10+
11+
The endpoint takes a `filters` query parameter whose value is a comma-separated list of filters
12+
like the following:
13+
```
14+
?filters=is_discoverable,has_multiple_originals,has_pdf_original
15+
```
16+
17+
Alternatively, the comma-separated list can be replaced by a repetition of the `filters` parameter
18+
for each requested filter:
19+
```
20+
?filters=is_discoverable&filter=has_multiple_originals&filter=has_pdf_original
21+
```
22+
23+
24+
Please see [below](#available-filters) for the list of available filters.
25+
26+
## Report contents
27+
28+
For each collection, the basic report consists of:
29+
* name (label) and handle of the collection
30+
* name (label) and handle of the parent community
31+
* total number of items
32+
* number of items matching all selected filters
33+
34+
In addition, a `summary` element provides the total number of items and the total number of items matching all filters
35+
for the whole repository.
36+
37+
An example JSON response document to `/api/contentreport/filteredcollections`:
38+
```json
39+
{
40+
"id": "filteredcollections",
41+
"collections": [
42+
{
43+
"label": "Collection 1",
44+
"handle": "100/1",
45+
"values": {
46+
"is_discoverable": 23,
47+
"has_multiple_originals": 3,
48+
"has_pdf_original": 14
49+
},
50+
"community_label": "Community 1",
51+
"community_handle": "20.500.11794/1",
52+
"nb_total_items": 23,
53+
"all_filters_value": 3
54+
},
55+
{
56+
"label": "Collection 2",
57+
"handle": "100/2",
58+
"values": {
59+
"is_discoverable": 1,
60+
"has_multiple_originals": 0,
61+
"has_pdf_original": 0
62+
},
63+
"community_label": "Community 1",
64+
"community_handle": "20.500.11794/1",
65+
"nb_total_items": 1,
66+
"all_filters_value": 0
67+
},
68+
{
69+
"label": "Collection 3",
70+
"handle": "100/3",
71+
"values": {
72+
"is_discoverable": 1,
73+
"has_multiple_originals": 0,
74+
"has_pdf_original": 1
75+
},
76+
"community_label": "Community 1",
77+
"community_handle": "20.500.11794/1",
78+
"nb_total_items": 1,
79+
"all_filters_value": 0
80+
}
81+
],
82+
"summary": {
83+
"label": null,
84+
"handle": null,
85+
"values": {
86+
"is_discoverable": 25,
87+
"has_multiple_originals": 3,
88+
"has_pdf_original": 15
89+
},
90+
"community_label": null,
91+
"community_handle": null,
92+
"nb_total_items": 25,
93+
"all_filters_value": 3
94+
},
95+
"type": "filtered-collections",
96+
"_links": {
97+
"self": {
98+
"href": "http://localhost:8080/dspace-server/api/contentreport/filtered-collections"
99+
}
100+
}
101+
}
102+
```
103+
104+
## Available filters
105+
106+
The available filters are as follows:
107+
108+
* Item Property Filters
109+
* `is_item`: Is Item - always true
110+
* `is_withdrawn`: Withdrawn Items
111+
* `is_not_withdrawn`: Available Items - Not Withdrawn
112+
* `is_discoverable`: Discoverable Items - Not Private
113+
* `is_not_discoverable`: Not Discoverable - Private Item
114+
* Basic Bitstream Filters
115+
* `has_multiple_originals`: Item has Multiple Original Bitstreams
116+
* `has_no_originals`: Item has No Original Bitstreams
117+
* `has_one_original`: Item has One Original Bitstream
118+
* Bitstream Filters by MIME Type
119+
* `has_doc_original`: Item has a Doc Original Bitstream (PDF, Office, Text, HTML, XML, etc)
120+
* `has_image_original`: Item has an Image Original Bitstream
121+
* `has_unsupp_type`: Has Other Bitstream Types (not Doc or Image)
122+
* `has_mixed_original`: Item has multiple types of Original Bitstreams (Doc, Image, Other)
123+
* `has_pdf_original`: Item has a PDF Original Bitstream
124+
* `has_jpg_original`: Item has JPG Original Bitstream
125+
* `has_small_pdf`: Has unusually small PDF
126+
* `has_large_pdf`: Has unusually large PDF
127+
* `has_doc_without_text`: Has document bitstream without TEXT item
128+
* Supported MIME Type Filters
129+
* `has_only_supp_image_type`: Item Image Bitstreams are Supported
130+
* `has_unsupp_image_type`: Item has Image Bitstream that is Unsupported
131+
* `has_only_supp_doc_type`: Item Document Bitstreams are Supported
132+
* `has_unsupp_doc_type`: Item has Document Bitstream that is Unsupported
133+
* Bitstream Bundle Filters
134+
* `has_unsupported_bundle`: Has bitstream in an unsupported bundle
135+
* `has_small_thumbnail`: Has unusually small thumbnail
136+
* `has_original_without_thumbnail`: Has original bitstream without thumbnail
137+
* `has_invalid_thumbnail_name`: Has invalid thumbnail name (assumes one thumbnail for each original)
138+
* `has_non_generated_thumb`: Has non-generated thumbnail
139+
* `no_license`: Doesn't have a license
140+
* `has_license_documentation`: Has documentation in the license bundle
141+
* Permission Filters
142+
* `has_restricted_original`: Item has Restricted Original Bitstream
143+
* `has_restricted_thumbnail`: Item has Restricted Thumbnail
144+
* `has_restricted_metadata`: Item has Restricted Metadata
145+
146+
Possible response status:
147+
148+
* 200 OK - The specific report data was found, and the data has been properly returned.
149+
* 403 Forbidden - In case of unauthorized user session.

0 commit comments

Comments
 (0)