Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/DSpace/RestContract into CS…
Browse files Browse the repository at this point in the history
…T-12107_cdl_request_withdrawal
  • Loading branch information
abollini committed Feb 19, 2024
2 parents b994965 + e304c05 commit fdede36
Show file tree
Hide file tree
Showing 37 changed files with 426 additions and 278 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/issue_opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
issues:
types: [opened]

permissions: {}
jobs:
automation:
runs-on: ubuntu-latest
Expand All @@ -15,7 +16,7 @@ jobs:
# Only add to project board if issue is flagged as "needs triage" or has no labels
# NOTE: By default we flag new issues as "needs triage" in our issue template
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
uses: actions/add-to-project@v0.3.0
uses: actions/add-to-project@v0.5.0
# Note, the authentication token below is an ORG level Secret.
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/label_merge_conflicts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow checks open PRs for merge conflicts and labels them when conflicts are found
name: Check for merge conflicts

# Run this for all pushes (i.e. merges) to 'main' or maintenance branches
on:
push:
branches:
- main
- 'dspace-**'
# So that the `conflict_label_name` is removed if conflicts are resolved,
# we allow this to run for `pull_request_target` so that github secrets are available.
pull_request_target:
types: [ synchronize ]

permissions: {}

jobs:
triage:
# Ensure this job never runs on forked repos. It's only executed for 'DSpace/RestContract'
if: github.repository == 'dspace/restcontract'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
# See: https://github.com/prince-chrismc/label-merge-conflicts-action
- name: Auto-label PRs with merge conflicts
uses: prince-chrismc/label-merge-conflicts-action@v3
# Ignore any failures -- may occur (randomly?) for older, outdated PRs.
continue-on-error: true
# Add "merge conflict" label if a merge conflict is detected. Remove it when resolved.
# Note, the authentication token is created automatically
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
with:
conflict_label_name: 'merge conflict'
github_token: ${{ secrets.GITHUB_TOKEN }}
conflict_comment: |
Hi @${author},
Conflicts have been detected against the base branch.
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!
46 changes: 46 additions & 0 deletions .github/workflows/port_merged_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will attempt to port a merged pull request to
# the branch specified in a "port to" label (if exists)
name: Port merged Pull Request

# Only run for merged PRs against the "main" or maintenance branches
# We allow this to run for `pull_request_target` so that github secrets are available
# (This is required when the PR comes from a forked repo)
on:
pull_request_target:
types: [ closed ]
branches:
- main
- 'dspace-**'

permissions:
contents: write # so action can add comments
pull-requests: write # so action can create pull requests

jobs:
port_pr:
runs-on: ubuntu-latest
# Don't run on closed *unmerged* pull requests
if: github.event.pull_request.merged
steps:
# Checkout code
- uses: actions/checkout@v4
# Port PR to other branch (ONLY if labeled with "port to")
# See https://github.com/korthout/backport-action
- name: Create backport pull requests
uses: korthout/backport-action@v2
with:
# Trigger based on a "port to [branch]" label on PR
# (This label must specify the branch name to port to)
label_pattern: '^port to ([^ ]+)$'
# Title to add to the (newly created) port PR
pull_title: '[Port ${target_branch}] ${pull_title}'
# Description to add to the (newly created) port PR
pull_description: 'Port of #${pull_number} by @${pull_author} to `${target_branch}`.'
# Copy all labels from original PR to (newly created) port PR
# NOTE: The labels matching 'label_pattern' are automatically excluded
copy_labels_pattern: '.*'
# Skip any merge commits in the ported PR. This means only non-merge commits are cherry-picked to the new PR
merge_commits: 'skip'
# Use a personal access token (PAT) to create PR as 'dspace-bot' user.
# A PAT is required in order for the new PR to trigger its own actions (for CI checks)
github_token: ${{ secrets.PR_PORT_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/pull_request_opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow runs whenever a new pull request is created
name: Pull Request opened

# Only run for newly opened PRs against the "main" or maintenance branches
# We allow this to run for `pull_request_target` so that github secrets are available
# (This is required to assign a PR back to the creator when the PR comes from a forked repo)
on:
pull_request_target:
types: [ opened ]
branches:
- main
- 'dspace-**'

permissions:
pull-requests: write

jobs:
automation:
runs-on: ubuntu-latest
steps:
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
# See https://github.com/toshimaru/auto-author-assign
- name: Assign PR to creator
uses: toshimaru/[email protected]
2 changes: 1 addition & 1 deletion authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This endpoint only accepts the `POST` method. Parameters and body structure depe

A `WWW-Authenticate` header is returned listing the different authentication method supported by the system.
Below an example listing the password and shibboleth authentication:
`WWW-Authenticate: shibboleth realm="DSpace REST API", location="https://api7.dspace.org/Shibboleth.sso/Login?target=https%3A%2F%2Fapi7.dspace.org", password realm="DSpace REST API"`
`WWW-Authenticate: shibboleth realm="DSpace REST API", location="https://demo.dspace.org/Shibboleth.sso/Login?target=https%3A%2F%2Fdemo.dspace.org", password realm="DSpace REST API"`

Return codes
- 200 Ok. If the authentication succeed. The JWT will be returned in the response Header Authorization.
Expand Down
2 changes: 1 addition & 1 deletion bitstreamformats.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Provide access to the bitstream formats defined in the registry (DBMS based). It returns the list of existent metadata fields.

Example: <https://api7.dspace.org/server/#https://api7.dspace.org/server/api/core/bitstreamformats>
Example: <https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/bitstreamformats>

**POST /api/core/bitstreamformats**

Expand Down
10 changes: 5 additions & 5 deletions bitstreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Bitstream metadata can be modified as described in [Modifying metadata via Patch
### Format
**GET /api/core/bitstreams/<:uuid>/format**

Example: <https://api7.dspace.org/server/#https://api7.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/format>
Example: <https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/format>

It returns the format of the bitstream

Expand All @@ -51,7 +51,7 @@ Update the bitstream format of the bitstream

Sample CURL command:
```
curl -i -X PUT 'https://api7.dspace.org/server/api/core/bitstreams/6ba01288-8a5a-4acf-96f1-fd0730424a1f/format' -H 'Authorization: Bearer eyJhbGciO…' -H "Content-Type:text/uri-list" --data 'https://api7.dspace.org/server/api/core/bitstreamformats/6'
curl -i -X PUT 'https://demo.dspace.org/server/api/core/bitstreams/6ba01288-8a5a-4acf-96f1-fd0730424a1f/format' -H 'Authorization: Bearer eyJhbGciO…' -H "Content-Type:text/uri-list" --data 'https://demo.dspace.org/server/api/core/bitstreamformats/6'
```

The uri-list should always contain exactly 1 bitstream format. This bitstream format will be assigned to the bitstream
Expand All @@ -73,7 +73,7 @@ Keep in mind that there's a change to dc.format in the API related to bitstream
### Bundle
**GET /api/core/bitstreams/<:uuid>/bundle**

Example: <https://api7.dspace.org/server/#https://api7.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/bundle>
Example: <https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/bundle>

It returns the bundle of the bitstream

Expand All @@ -83,7 +83,7 @@ Move the bitstream to another bundle

Sample CURL command:
```
curl -i -X PUT 'https://api7.dspace.org/server/api/core/bitstreams/6ba01288-8a5a-4acf-96f1-fd0730424a1f/bundle' -H 'Authorization: Bearer eyJhbGciO…' -H "Content-Type:text/uri-list" --data 'https://api7.dspace.org/server/api/core/bundles/0b3c0ebf-83bc-4017-afa1-9df37a1a065c'
curl -i -X PUT 'https://demo.dspace.org/server/api/core/bitstreams/6ba01288-8a5a-4acf-96f1-fd0730424a1f/bundle' -H 'Authorization: Bearer eyJhbGciO…' -H "Content-Type:text/uri-list" --data 'https://demo.dspace.org/server/api/core/bundles/0b3c0ebf-83bc-4017-afa1-9df37a1a065c'
```

The uri-list should always contain exactly 1 bitstream format. This bitstream format will be assigned to the bitstream
Expand All @@ -98,7 +98,7 @@ Error codes:
### Content
**/api/core/bitstreams/<:uuid>/content**

Example: <https://api7.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/content>
Example: <https://demo.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/content>

It returns the actual content (bits) described by the bitstream

Expand Down
2 changes: 1 addition & 1 deletion browses.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ It returns a collection of BrowseEntryResource the JSON document looks like
"count": 1,
"_links": {
"items": {
"href": "https://api7.dspace.org/server/api/discover/browses/author/items?filterValue=Arulmozhiyal, Ramaswamy"
"href": "https://demo.dspace.org/server/api/discover/browses/author/items?filterValue=Arulmozhiyal, Ramaswamy"
}
}
},
Expand Down
34 changes: 17 additions & 17 deletions bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Provide detailed information about a specific bundle. A sample JSON response doc
"type": "bundle",
"_links" : {
"primarybitstream" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/ac49f361-4ffd-47a4-8eb2-e6c73c3f3e76"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/ac49f361-4ffd-47a4-8eb2-e6c73c3f3e76"
},
"bitstreams" : {
"href" : "https://api7.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams"
"href" : "https://demo.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams"
},
"item" : {
"href" : "https://api7.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/item"
"href" : "https://demo.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/item"
},
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb"
"href" : "https://demo.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb"
}
},
"_embedded" : {
Expand Down Expand Up @@ -79,13 +79,13 @@ Provide detailed information about a specific bundle. A sample JSON response doc
"type" : "bitstream",
"_links" : {
"content" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14/content"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14/content"
},
"format" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14/format"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14/format"
},
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14"
}
}
}, {
Expand Down Expand Up @@ -125,13 +125,13 @@ Provide detailed information about a specific bundle. A sample JSON response doc
"type" : "bitstream",
"_links" : {
"content" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc/content"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc/content"
},
"format" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc/format"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc/format"
},
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc"
}
}
}
Expand All @@ -157,7 +157,7 @@ Deleting a bundle will delete all bitstreams in the bundle

**GET /api/core/bundles/<:uuid>/bitstreams**

Example: <https://api7.dspace.org/server/#https://api7.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams>
Example: <https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams>

It returns the bitstreams within this bundle. See the [bitstream endpoint](bitstreams.md#Single-Bitstream) for more info

Expand All @@ -168,11 +168,11 @@ The supported parameters are:

TODO: the item has to be known as well when creating a new bitstream. See https://jira.duraspace.org/browse/DS-4317?focusedCommentId=63099&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-63099

Example: <https://api7.dspace.org/server/#https://api7.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams>
Example: <https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams>

Curl example:
```
curl 'https://api7.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams' \
curl 'https://demo.dspace.org/server/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams' \
-XPOST -H 'Content-Type: multipart/form-data' \
-H 'Authorization: Bearer eyJhbGciOiJI...' \
-F "file=@Downloads/test.html" \
Expand Down Expand Up @@ -231,15 +231,15 @@ Current list of bitstreams:
"uuid" : "1ce6db0e-662f-4a13-ba87-c371ad664b14",
"_links" : {
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14"
}
}
}, {
"id" : "4dd9621f-a464-4192-bc17-d70f68845bdc",
"uuid" : "4dd9621f-a464-4192-bc17-d70f68845bdc",
"_links" : {
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc"
}
}
}
Expand Down Expand Up @@ -269,7 +269,7 @@ New list of bitstreams:
"uuid" : "4dd9621f-a464-4192-bc17-d70f68845bdc",
"_links" : {
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/4dd9621f-a464-4192-bc17-d70f68845bdc"
}
}
},
Expand All @@ -278,7 +278,7 @@ New list of bitstreams:
"uuid" : "1ce6db0e-662f-4a13-ba87-c371ad664b14",
"_links" : {
"self" : {
"href" : "https://api7.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14"
"href" : "https://demo.dspace.org/server/api/core/bitstreams/1ce6db0e-662f-4a13-ba87-c371ad664b14"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions claimedtasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ If successful a 201 code will be returned along with the new claimedtask. The po

An example curl call:
```
curl -i -X POST https://api7.dspace.org/server/api/workflow/claimedtasks
curl -i -X POST https://demo.dspace.org/server/api/workflow/claimedtasks
\ -H "Content-Type:text/uri-list" \
--data "https://api7.dspace.org/server/api/workflow/pooltasks/1"
--data "https://demo.dspace.org/server/api/workflow/pooltasks/1"
```

Return codes:
Expand Down
Loading

0 comments on commit fdede36

Please sign in to comment.