Skip to content

Commit 258746d

Browse files
Merge pull request #1538 from ral-facilities/feature/dls-data-publications-#1532-#1533
DLS data publications views #1532 #1533
2 parents be8105a + 914f29b commit 258746d

File tree

73 files changed

+7722
-1728
lines changed

Some content is hidden

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

73 files changed

+7722
-1728
lines changed

.github/workflows/ci-build.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,42 @@ jobs:
125125
ansible-playbook icat-ansible/icat_test_hosts.yml -i icat-ansible/hosts --vault-password-file icat-ansible/vault_pass.txt -vv
126126
127127
# Fixes on ICAT components needed for e2e tests
128-
- name: Add anon user to rootUserNames
128+
- name: Removing authenticator prefix for simple auth
129129
run: |
130-
awk -F" =" '/rootUserNames/{$2="= simple/root anon/anon";print;next}1' /home/runner/install/icat.server/run.properties > /home/runner/install/icat.server/run.properties.tmp
130+
sed -i 's/mechanism = simple/!mechanism = simple/' /home/runner/install/authn.simple/run.properties
131+
- name: Adding Chris481 user
132+
run: |
133+
sed -i '/user\.list/ s/$/ Chris481/' /home/runner/install/authn.simple/run.properties
134+
- name: Adding Chris481 user password
135+
run: |
136+
echo "user.Chris481.password = pw" >> /home/runner/install/authn.simple/run.properties
137+
- name: Reinstall authn.simple
138+
run: |
139+
cd /home/runner/install/authn.simple/ && ./setup -vv install
140+
- name: Add anon, root (simple without prefix) and Chris481 users to rootUserNames
141+
run: |
142+
awk -F" =" '/rootUserNames/{$2="= root Chris481 anon/anon";print;next}1' /home/runner/install/icat.server/run.properties > /home/runner/install/icat.server/run.properties.tmp
131143
- name: Apply rootUserNames change
132144
run: |
133145
mv -f /home/runner/install/icat.server/run.properties.tmp /home/runner/install/icat.server/run.properties
134146
- name: Reinstall ICAT Server
135147
run: |
136148
cd /home/runner/install/icat.server/ && ./setup -vv install
149+
- name: Add root (simple without prefix) to datagateway-download-api adminUserNames
150+
run: |
151+
awk -F" =" '/adminUserNames/{$2="= root";print;next}1' /home/runner/install/datagateway-download-api/run.properties > /home/runner/install/datagateway-download-api/run.properties.tmp
152+
- name: Apply adminUserNames change
153+
run: |
154+
mv -f /home/runner/install/datagateway-download-api/run.properties.tmp /home/runner/install/datagateway-download-api/run.properties
155+
- name: Add root (simple without prefix) to datagateway-download-api queue.priority.user
156+
run: |
157+
awk -F" =" '/queue.priority.user/{sub(/}/,", \"root\": 1}");print;next}1' /home/runner/install/datagateway-download-api/run.properties > /home/runner/install/datagateway-download-api/run.properties.tmp
158+
- name: Apply queue.priority.user change
159+
run: |
160+
mv -f /home/runner/install/datagateway-download-api/run.properties.tmp /home/runner/install/datagateway-download-api/run.properties
161+
- name: Reinstall datagateway-download-api
162+
run: |
163+
cd /home/runner/install/datagateway-download-api/ && python ./setup -vv install
137164
138165
- name: Checkout datagateway-api
139166
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
@@ -163,6 +190,16 @@ jobs:
163190
- name: Start API
164191
run: cd datagateway-api/; nohup poetry run python -m datagateway_api.src.main > api-output.txt &
165192

193+
# DOI minter setup
194+
- name: Adding 'User-defined' DataPublicationType (needed for DOI minting api)
195+
run: cd datagateway-api/; poetry run python ../.github/add_doi_datapublicationtype.py
196+
197+
- name: 'Add password to env file'
198+
run: echo DATACITE_PASSWORD=${{ secrets.DATACITE_PASSWORD }} >> ./.github/config.env
199+
200+
- name: Run minting api
201+
run: docker run --env-file ./.github/config.env -p 8000:8000 --add-host host.docker.internal:host-gateway -d harbor.stfc.ac.uk/icat/doi-mint-api
202+
166203
# E2E tests
167204
- name: Setup Node.js
168205
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ ENV API_URL="/datagateway-api"
6868
ENV DOWNLOAD_API_URL="http://localhost/topcat"
6969
ENV ICAT_URL="http://localhost/icat"
7070
ENV IDS_URL="http://localhost/ids"
71+
ENV DOI_MINTER_URL="http://localhost/doi-minter"
72+
ENV DATACITE_URL="https://api.test.datacite.org"
7173

7274
COPY docker/docker-entrypoint.sh /usr/local/bin/
7375
ENTRYPOINT ["docker-entrypoint.sh"]

docker/docker-entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ sed -e "s|\"facilityName\": \".*\"|\"facilityName\": \"$FACILITY_NAME\"|" \
88
-e "s|\"idsUrl\": \".*\"|\"idsUrl\": \"$IDS_URL\"|" \
99
-e "s|\"apiUrl\": \".*\"|\"apiUrl\": \"$API_URL\"|" \
1010
-e "s|\"downloadApiUrl\": \".*\"|\"downloadApiUrl\": \"$DOWNLOAD_API_URL\"|" \
11+
-e "s|\"doiMinterUrl\": \".*\"|\"apiUrl\": \"$DOI_MINTER_URL\"|" \
12+
-e "s|\"dataCiteUrl\": \".*\"|\"apiUrl\": \"$DATACITE_URL\"|" \
1113
-e "s|\"pluginHost\": \".*\"|\"pluginHost\": \"/datagateway-dataview\"|" \
1214
/usr/local/apache2/htdocs/datagateway-dataview/datagateway-dataview-settings.json > "$TEMPFILE"
1315

@@ -18,6 +20,8 @@ sed -e "s|\"facilityName\": \".*\"|\"facilityName\": \"$FACILITY_NAME\"|" \
1820
-e "s|\"idsUrl\": \".*\"|\"idsUrl\": \"$IDS_URL\"|" \
1921
-e "s|\"apiUrl\": \".*\"|\"apiUrl\": \"$API_URL\"|" \
2022
-e "s|\"downloadApiUrl\": \".*\"|\"downloadApiUrl\": \"$DOWNLOAD_API_URL\"|" \
23+
-e "s|\"doiMinterUrl\": \".*\"|\"apiUrl\": \"$DOI_MINTER_URL\"|" \
24+
-e "s|\"dataCiteUrl\": \".*\"|\"apiUrl\": \"$DATACITE_URL\"|" \
2125
-e "s|\"pluginHost\": \".*\"|\"pluginHost\": \"/datagateway-download\"|" \
2226
/usr/local/apache2/htdocs/datagateway-download/datagateway-download-settings.json > "$TEMPFILE"
2327

packages/datagateway-common/__mocks__/axios.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import axios from 'axios';
22

33
const requests = {
44
get: vi.fn(() => Promise.resolve({ data: {} })),
5+
put: vi.fn(() => Promise.resolve({ data: {} })),
56
post: vi.fn(() => Promise.resolve({ data: {} })),
67
delete: vi.fn(() => Promise.resolve({ data: {} })),
78
CancelToken: axios.CancelToken,

packages/datagateway-common/src/downloadConfirmation/__snapshots__/dialogTitle.component.test.tsx.snap renamed to packages/datagateway-common/src/__snapshots__/dialogTitle.component.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`DialogTitle > should render correctly 1`] = `
1212
Title
1313
</p>
1414
<button
15-
aria-label="downloadConfirmDialog.close_arialabel"
15+
aria-label="close_aria_label"
1616
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeLarge css-1f5482o-MuiButtonBase-root-MuiIconButton-root"
1717
tabindex="0"
1818
type="button"

0 commit comments

Comments
 (0)