Skip to content

Commit

Permalink
Merge branch 'update_v6.1' into workflow_rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
bjosel committed Jan 17, 2024
2 parents 4731cd9 + 1f9e10c commit 5585114
Show file tree
Hide file tree
Showing 1,057 changed files with 27,687 additions and 21,538 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_IMAGE=gdcc/dataverse:unstable
POSTGRES_VERSION=13
DATAVERSE_DB_USER=dataverse
SOLR_VERSION=8.11.1
SOLR_VERSION=9.3.0
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://www.git-scm.com/docs/gitattributes

# This set mandatory LF line endings for .sh files preventing from windows users to having to change the value of their git config --global core.autocrlf to 'false' or 'input'
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Bug report
about: Did you encounter something unexpected or incorrect in the Dataverse software?
We'd like to hear about it!
title: ''
labels: ''
labels: 'Type: Bug'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea or new feature for the Dataverse software!
title: 'Feature Request/Idea:'
labels: ''
labels: 'Type: Feature'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container_app_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
- uses: actions/setup-java@v3
with:
java-version: "11"
java-version: "17"
distribution: 'adopt'
- uses: actions/cache@v3
with:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/container_app_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "11"
java-version: "17"
distribution: temurin
cache: maven

Expand Down Expand Up @@ -99,17 +99,21 @@ jobs:
name: "Package & Publish"
runs-on: ubuntu-latest
# Only run this job if we have access to secrets. This is true for events like push/schedule which run in
# context of main repo, but for PRs only true if coming from the main repo! Forks have no secret access.
if: needs.check-secrets.outputs.available == 'true'
# context of the main repo, but for PRs only true if coming from the main repo! Forks have no secret access.
#
# Note: The team's decision was to not auto-deploy an image on any git push where no PR exists (yet).
# Accordingly, only run for push events on branches develop and master.
if: needs.check-secrets.outputs.available == 'true' &&
( github.event_name != 'push' || ( github.event_name == 'push' && contains(fromJSON('["develop", "master"]'), github.ref_name)))
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: "11"
java-version: "17"
distribution: temurin

# Depending on context, we push to different targets. Login accordingly.
- if: ${{ github.event_name != 'pull_request' }}
- if: github.event_name != 'pull_request'
name: Log in to Docker Hub registry
uses: docker/login-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container_base_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
packages: read
strategy:
matrix:
jdk: [ '11' ]
jdk: [ '17' ]
# Only run in upstream repo - avoid unnecessary runs in forks
if: ${{ github.repository_owner == 'IQSS' }}

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/cypress_ui.yml.future
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# THIS IS AN OLD TRAVIS-CI.ORG JOB FILE
# To be used with Github Actions, it would be necessary to refactor it.
# In addition, it needs to be rewritten to use our modern containers.
# Keeping it as the future example it has been before.
# See also #5846
#
Expand Down Expand Up @@ -30,8 +31,6 @@ jobs:
directories:
# we also need to cache folder with Cypress binary
- ~/.cache
# we want to cache the Glassfish and Solr dependencies as well
- conf/docker-aio/dv/deps
before_install:
- cd tests
install:
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/deploy_beta_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: beta-testing

steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

- name: Enable API Session Auth feature flag
working-directory: src/main/resources/META-INF
run: echo -e "dataverse.feature.api-session-auth=true" >> microprofile-config.properties

- name: Set build number
run: scripts/installer/custom-build-number

- name: Build application war
run: mvn package
Expand All @@ -34,7 +40,6 @@ jobs:
deploy-to-payara:
needs: build
runs-on: ubuntu-latest
environment: beta-testing

steps:
- uses: actions/checkout@v3
Expand All @@ -51,29 +56,29 @@ jobs:
- name: Copy war file to remote instance
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PAYARA_INSTANCE_HOST }}
username: ${{ secrets.PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
host: ${{ secrets.BETA_PAYARA_INSTANCE_HOST }}
username: ${{ secrets.BETA_PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.BETA_PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
source: './${{ env.war_file }}'
target: '/home/${{ secrets.PAYARA_INSTANCE_USERNAME }}'
target: '/home/${{ secrets.BETA_PAYARA_INSTANCE_USERNAME }}'
overwrite: true

- name: Execute payara war deployment remotely
uses: appleboy/[email protected]
env:
INPUT_WAR_FILE: ${{ env.war_file }}
with:
host: ${{ secrets.PAYARA_INSTANCE_HOST }}
username: ${{ secrets.PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
host: ${{ secrets.BETA_PAYARA_INSTANCE_HOST }}
username: ${{ secrets.BETA_PAYARA_INSTANCE_USERNAME }}
key: ${{ secrets.BETA_PAYARA_INSTANCE_SSH_PRIVATE_KEY }}
envs: INPUT_WAR_FILE
script: |
APPLICATION_NAME=dataverse-backend
ASADMIN='/usr/local/payara5/bin/asadmin --user admin'
ASADMIN='/usr/local/payara6/bin/asadmin --user admin'
$ASADMIN undeploy $APPLICATION_NAME
$ASADMIN stop-domain
rm -rf /usr/local/payara5/glassfish/domains/domain1/generated
rm -rf /usr/local/payara5/glassfish/domains/domain1/osgi-cache
rm -rf /usr/local/payara6/glassfish/domains/domain1/generated
rm -rf /usr/local/payara6/glassfish/domains/domain1/osgi-cache
$ASADMIN start-domain
$ASADMIN deploy --name $APPLICATION_NAME $INPUT_WAR_FILE
$ASADMIN stop-domain
Expand Down
120 changes: 103 additions & 17 deletions .github/workflows/maven_unit_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Maven Unit Tests
name: Maven Tests

on:
push:
Expand All @@ -22,21 +22,13 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [ '11' ]
jdk: [ '17' ]
experimental: [false]
status: ["Stable"]
#
# JDK 17 builds disabled due to non-essential fails marking CI jobs as completely failed within
# Github Projects, PR lists etc. This was consensus on Slack #dv-tech. See issue #8094
# (This is a limitation of how Github is currently handling these things.)
#
#include:
# - jdk: '17'
# experimental: true
# status: "Experimental"
continue-on-error: ${{ matrix.experimental }}
runs-on: ubuntu-latest
steps:
# Basic setup chores
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
Expand All @@ -46,16 +38,110 @@ jobs:
cache: maven

# The reason why we use "install" here is that we want the submodules to be available in the next step.
# Also, we can cache them this way for jobs triggered by this one.
- name: Build with Maven
# Also, we can cache them this way for jobs triggered by this one. We need to skip ITs here, as we run
# them in the next job - but install usually runs through verify phase.
- name: Build with Maven and run unit tests
run: >
mvn -B -f modules/dataverse-parent
-Dtarget.java.version=${{ matrix.jdk }}
-DcompilerArgument=-Xlint:unchecked -P all-unit-tests
-DskipIntegrationTests
-pl edu.harvard.iq:dataverse -am
install
- name: Maven Code Coverage
# We don't want to cache the WAR file, so delete it
- run: rm -rf ~/.m2/repository/edu/harvard/iq/dataverse

# Upload the built war file. For download, it will be wrapped in a ZIP by GitHub.
# See also https://github.com/actions/upload-artifact#zipped-artifact-downloads
- uses: actions/upload-artifact@v3
with:
name: dataverse-java${{ matrix.jdk }}.war
path: target/dataverse*.war
retention-days: 7

# Store the build for the next step (integration test) to avoid recompilation and to transfer coverage reports
- run: |
tar -cvf java-builddir.tar target
tar -cvf java-m2-selection.tar ~/.m2/repository/io/gdcc/dataverse-*
- uses: actions/upload-artifact@v3
with:
name: java-artifacts
path: |
java-builddir.tar
java-m2-selection.tar
retention-days: 3

integration-test:
runs-on: ubuntu-latest
needs: unittest
name: (${{ matrix.status}} / JDK ${{ matrix.jdk }}) Integration Tests
strategy:
fail-fast: false
matrix:
jdk: [ '17' ]
experimental: [ false ]
status: [ "Stable" ]
#
# JDK 17 builds disabled due to non-essential fails marking CI jobs as completely failed within
# Github Projects, PR lists etc. This was consensus on Slack #dv-tech. See issue #8094
# (This is a limitation of how Github is currently handling these things.)
#
#include:
# - jdk: '17'
# experimental: true
# status: "Experimental"
continue-on-error: ${{ matrix.experimental }}
steps:
# Basic setup chores
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
cache: maven

# Get the build output from the unit test job
- uses: actions/download-artifact@v3
with:
name: java-artifacts
- run: |
tar -xvf java-builddir.tar
tar -xvf java-m2-selection.tar -C /
# Run integration tests (but not unit tests again)
- run: mvn -DskipUnitTests -Dtarget.java.version=${{ matrix.jdk }} verify

# Wrap up and send to coverage job
- run: tar -cvf java-reportdir.tar target/site
- uses: actions/upload-artifact@v3
with:
name: java-reportdir
path: java-reportdir.tar
retention-days: 3

coverage-report:
runs-on: ubuntu-latest
needs: integration-test
name: Coverage Report Submission
steps:
# Basic setup chores
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
cache: maven

# Get the build output from the integration test job
- uses: actions/download-artifact@v3
with:
name: java-reportdir
- run: tar -xvf java-reportdir.tar

# Deposit Code Coverage
- name: Deposit Code Coverage
env:
CI_NAME: github
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -66,14 +152,14 @@ jobs:
-DrepoToken=${COVERALLS_SECRET} -DpullRequest=${{ github.event.number }}
jacoco:report coveralls:report
# We don't want to cache the WAR file, so delete it
- run: rm -rf ~/.m2/repository/edu/harvard/iq/dataverse
# NOTE: this may be extended with adding a report to the build output, leave a comment, send to Sonarcloud, ...

push-app-img:
name: Publish App Image
permissions:
contents: read
packages: write
pull-requests: write
needs: unittest
needs: integration-test
uses: ./.github/workflows/container_app_push.yml
secrets: inherit
2 changes: 0 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
# Exclude old scripts
exclude: |
*/.git/*
conf/docker-aio/*
doc/*
downloads/*
scripts/database/*
Expand All @@ -43,5 +42,4 @@ jobs:
scripts/issues/*
scripts/r/*
scripts/tests/*
scripts/vagrant/*
tests/*
2 changes: 1 addition & 1 deletion .github/workflows/shellspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
shellspec
shellspec-macos:
name: "MacOS"
runs-on: macos-10.15
runs-on: macos-latest
steps:
- name: Install shellspec
run: curl -fsSL https://git.io/shellspec | sh -s 0.28.1 --yes
Expand Down
Loading

0 comments on commit 5585114

Please sign in to comment.