Skip to content

Commit

Permalink
Autocreate Zenodo DOIs and create shared access links (#5879)
Browse files Browse the repository at this point in the history
https://ucsc-cgl.atlassian.net/browse/SEAB-5929
https://ucsc-cgl.atlassian.net/browse/SEAB-6371

* Adds DOI autocreation for published, valid, unhidden tags on publish, refresh and GitHub app release
* Creates hoverfly-tests profile for tests that use Hoverfly
* Adds DOI entity to allow for multiple DOIs
* Adds endpoints for creating and deleting shared access links
  • Loading branch information
kathy-t committed Jun 3, 2024
1 parent 2f81db3 commit e6eea04
Show file tree
Hide file tree
Showing 45 changed files with 2,403 additions and 658 deletions.
79 changes: 60 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ workflows:
<<: *common_filters
requires:
- full_build_check
- hoverfly-tests:
<<: *common_filters
requires:
- full_build_check
- tool-integration-tests:
<<: *common_filters
requires:
Expand All @@ -102,6 +106,7 @@ workflows:
- bitbucket-tests
- language-parsing-tests
- localstack-tests
- hoverfly-tests
- tool-integration-tests
- integration-tests
- regression-integration-tests
Expand Down Expand Up @@ -238,6 +243,18 @@ jobs:
- setup_postgres_docker
- setup_integration_test
- save_test_results
hoverfly-tests:
executor: integration_test_exec
environment:
TESTING_PROFILE: hoverfly-tests
DOCKSTORE_DOCKER_DB: true
steps:
- setup_test
- install-postgres
- setup_postgres
- setup_integration_test:
use_hoverfly_cert: true
- save_test_results
build:
docker: # run the steps with Docker
- image: cimg/openjdk:<< pipeline.parameters.java-tag >>
Expand Down Expand Up @@ -388,14 +405,11 @@ jobs:
touch /tmp/non-confidential-tests-to-run.txt
cat temp/test-lists/IT/all.txt | circleci tests run --command="> /tmp/non-confidential-tests-to-run.txt xargs echo" --verbose --split-by=timings --time-default=0.1s
# Adding all "normal" certs into this local one that has the Hoverfly cert (instead of adding Hoverfly cert to the global one so it doesn't potentially affect other tests)
/usr/local/jdk-<< pipeline.parameters.java-tag >>/bin/keytool -importkeystore -srckeystore $JAVA_HOME/lib/security/cacerts -destkeystore LocalTrustStore -srcstorepass changeit -deststorepass changeit
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -Pnon-confidential-tests,coverage -Djavax.net.ssl.trustStore=../LocalTrustStore \
-Dtest=`cat /tmp/non-confidential-tests-to-run.txt | tr ' ' ','` -DfailIfNoTests=false -Djavax.net.ssl.trustStorePassword=changeit -ntp | grep -v "^Running Changeset:"
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -Pnon-confidential-tests,coverage \
-Dtest=`cat /tmp/non-confidential-tests-to-run.txt | tr ' ' ','` -DfailIfNoTests=false -ntp | grep -v "^Running Changeset:"
else
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -Pnon-confidential-tests,coverage -Djavax.net.ssl.trustStore=../LocalTrustStore \
-Djavax.net.ssl.trustStorePassword=changeit -ntp | grep -v "^Running Changeset:"
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -Pnon-confidential-tests,coverage \
-ntp | grep -v "^Running Changeset:"
fi
# The piping grep command is a temporary fix to this issue https://github.com/liquibase/liquibase/issues/2396
- setup_codecov_uploader
Expand Down Expand Up @@ -575,6 +589,10 @@ commands:
- dockstore-web-cache-{{ .Environment.CIRCLE_JOB }}-
- dockstore-web-cache-
setup_integration_test:
parameters:
use_hoverfly_cert:
type: boolean
default: false
steps:
- run:
name: decrypt and expand confidential test data
Expand All @@ -600,18 +618,41 @@ commands:
java -version
./mvnw -v
python3 -V
- run:
name: run integration test
command: | # Runs normally if it is not being run in parallel
export DOCKSTORE_CACHE_MIGRATIONS=true
if [ $CIRCLE_NODE_TOTAL != 1 ]
then
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate -P$TESTING_PROFILE,coverage -ntp \
clean verify -Dit.test=`cat /tmp/tests-to-run.txt | tr ' ' ','` -DfailIfNoTests=false | grep -v "^Running Changeset:"
else
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -P$TESTING_PROFILE,coverage -ntp | grep -v "^Running Changeset:"
fi
# The piping grep command is a temporary fix to this issue https://github.com/liquibase/liquibase/issues/2396
- when:
condition: <<parameters.use_hoverfly_cert>>
steps:
- run:
name: run integration test with hoverfly cert
command: |
# Adding all "normal" certs into this local one that has the Hoverfly cert (instead of adding Hoverfly cert to the global one so it doesn't potentially affect other tests)
/usr/local/jdk-<< pipeline.parameters.java-tag >>/bin/keytool -importkeystore -srckeystore $JAVA_HOME/lib/security/cacerts -destkeystore LocalTrustStore -srcstorepass changeit -deststorepass changeit
if [ $CIRCLE_NODE_TOTAL != 1 ]
then
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate -P$TESTING_PROFILE,coverage -ntp \
clean verify -Dit.test=`cat /tmp/tests-to-run.txt | tr ' ' ','` -DfailIfNoTests=false -Djavax.net.ssl.trustStore=../LocalTrustStore \
-Djavax.net.ssl.trustStorePassword=changeit | grep -v "^Running Changeset:"
else
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -P$TESTING_PROFILE,coverage -ntp -Djavax.net.ssl.trustStore=../LocalTrustStore \
-Djavax.net.ssl.trustStorePassword=changeit | grep -v "^Running Changeset:"
fi
- when:
condition:
not: <<parameters.use_hoverfly_cert>>
steps:
- run:
name: run integration test
command: | # Runs normally if it is not being run in parallel
export DOCKSTORE_CACHE_MIGRATIONS=true
if [ $CIRCLE_NODE_TOTAL != 1 ]
then
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate -P$TESTING_PROFILE,coverage -ntp \
clean verify -Dit.test=`cat /tmp/tests-to-run.txt | tr ' ' ','` -DfailIfNoTests=false | grep -v "^Running Changeset:"
else
./mvnw -B org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-aggregate clean install -P$TESTING_PROFILE,coverage -ntp | grep -v "^Running Changeset:"
fi
# The piping grep command is a temporary fix to this issue https://github.com/liquibase/liquibase/issues/2396
- setup_codecov_uploader
- run:
name: send coverage
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2024 OICR and UCSC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.dockstore.common;

/**
* Setting aside tests that require Hoverfly to mock API responses.
*/
public interface HoverflyTest {
String NAME = "io.dockstore.common.HoverflyTest";

default String getName() {
// silly method to satisfy CheckStyle
return NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ protected static ApiClient getAnonymousWebClient() {
return client;
}

protected static io.dockstore.openapi.client.ApiClient getAnonymousOpenAPIWebClient() {
public static io.dockstore.openapi.client.ApiClient getAnonymousOpenAPIWebClient() {
File configFile = FileUtils.getFile("src", "test", "resources", "config");
INIConfiguration parseConfig = Utilities.parseConfig(configFile.getAbsolutePath());
io.dockstore.openapi.client.ApiClient client = new io.dockstore.openapi.client.ApiClient();
Expand Down
Loading

0 comments on commit e6eea04

Please sign in to comment.