Skip to content

Add support for historical data sorting #4027

Add support for historical data sorting

Add support for historical data sorting #4027

Workflow file for this run

name: Datastore Migration
# For details on this workflow, refer to build/migration/README.md
env:
VERSION_TAGS: "['4.9.2', '4.10.2', '4.11.1']"
on:
pull_request:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore
paths:
- '.github/workflows/migration.yml'
- 'build/migration/**'
- 'fhir-database-utils/**'
- 'fhir-persistence-schema/**'
- '!fhir-persistence-schema/docs/**'
- '!**.md'
# allows the workflow to be manually executed any time
workflow_dispatch:
inputs:
version_tag:
description: 'Version tag to test migration from (e.g. 4.10.2) or blank for the default matrix'
type: string
jobs:
setup:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'ci-skip')"
steps:
- id: set-matrix
run: |
tag=${{github.event.inputs.version_tag}}
if [ -z ${tag} ]; then
echo "::set-output name=version_tag::${VERSION_TAGS}]"
else
echo "::set-output name=version_tag::['${tag}']"
fi
outputs:
version_tag: ${{ steps.set-matrix.outputs.version_tag }}
migration:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
datastore: [ 'postgres' ]
release: ${{fromJSON(needs.setup.outputs.version_tag)}}
fail-fast: false
steps:
- name: Checkout source code for main
uses: actions/[email protected]
with:
path: fhir/
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch the target branch
run: |
# the target branch of the PR or "main" if its not a PR (e.g. when manually invoked)
TARGET_BRANCH=${GITHUB_BASE_REF:-main}
cd fhir/
git fetch --no-tags --prune --depth=1 origin +refs/heads/${TARGET_BRANCH}:refs/remotes/origin/${TARGET_BRANCH}
- name: Set up java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Gather the environment details
if: always()
run: |
bash fhir/build/common/gather-environment-details.sh
- name: Checkout source code for previous
uses: actions/[email protected]
with:
path: prev/
ref: ${{ matrix.release }}
fetch-depth: 1
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup previous release environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
bash fhir/build/migration/bin/1_previous-setup.sh ${{matrix.datastore}}
- name: Setup docker-compose and database
env:
WORKSPACE: ${{ github.workspace }}
run: |
bash fhir/build/migration/bin/2_compose.sh ${{matrix.datastore}} ${{ matrix.release }}
- name: Run previous release's Integration Tests
env:
WORKSPACE: ${{ github.workspace }}
run: |
bash fhir/build/migration/bin/2_previous-integration-test.sh ${{matrix.datastore}}
bash fhir/build/migration/bin/3_previous-teardown.sh ${{matrix.datastore}}
- name: Migrate to the current release
if: "!contains(env.migration_skip, 'true')"
env:
WORKSPACE: ${{ github.workspace }}
run: |
bash fhir/build/migration/bin/4_current-migrate.sh ${{matrix.datastore}}
- name: Run LATEST Integration Tests
if: "!contains(env.migration_skip, 'true')"
env:
WORKSPACE: ${{ github.workspace }}
run: |
bash fhir/build/migration/bin/5_current-pre-integration-test.sh ${{matrix.datastore}} ${{ matrix.release }}
bash fhir/build/migration/bin/6_current-reindex.sh ${{matrix.datastore}}
bash fhir/build/migration/bin/7_current-integration-test.sh ${{matrix.datastore}}
- name: Teardown and cleanup
if: "!contains(env.migration_skip, 'true')"
env:
WORKSPACE: ${{ github.workspace }}
run: |
bash fhir/build/migration/bin/8_teardown.sh ${{matrix.datastore}}
- name: Gather error logs
if: always()
env:
WORKSPACE: ${{ github.workspace }}/fhir
run: bash fhir/build/common/gather-posttest-logs.sh migration ${{matrix.datastore}}
- name: Upload logs
if: always()
uses: actions/[email protected]
with:
name: integration-test-results-${{ matrix.datastore }}-${{ matrix.release }}
path: fhir/build/migration/integration-test-results
concurrency:
group: migration-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true