From 7a679dc5308459f57d88e4c18131495f9b352ed6 Mon Sep 17 00:00:00 2001 From: Ralf Peschke Date: Wed, 3 Nov 2021 13:30:24 +0100 Subject: [PATCH] Remove omitted workflows --- .github/workflows/md5_check_initial-data.yml | 24 ---- .github/workflows/models.yml | 138 ------------------- 2 files changed, 162 deletions(-) delete mode 100644 .github/workflows/md5_check_initial-data.yml delete mode 100644 .github/workflows/models.yml diff --git a/.github/workflows/md5_check_initial-data.yml b/.github/workflows/md5_check_initial-data.yml deleted file mode 100644 index d69bef33b..000000000 --- a/.github/workflows/md5_check_initial-data.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Prevent manual changes of initial-data.json without md5 hash -# The file initial-data.json has a migration-index (MI) set to an active migration, -# In consequence setting up a new system triggers migrations beginning at this MI. -# That's the reason this file is protected against unwanted/unintended edits. -# -# If one is sure to change the initial-data.json file it is allowed! -# 1. Change the file -# 2. Get the md5sum for changed initial-dta.json -# 3. Change the md5-check-literal in this workflow-file -on: pull_request -jobs: - validate-data: - name: Validate example-data.json and initial-data.json - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Show hash for initial-data.json - run: md5sum docker/initial-data.json - - - name: Validate and protect initial-data.json - run: echo "8e8a248fcda1224244f61ea8079afad4 docker/initial-data.json" | md5sum -c - diff --git a/.github/workflows/models.yml b/.github/workflows/models.yml deleted file mode 100644 index dc6d74591..000000000 --- a/.github/workflows/models.yml +++ /dev/null @@ -1,138 +0,0 @@ ---- -name: Validate models.yml, initial-data.json and example-data.json -on: [push, pull_request] -env: - PYTHON_VERSION: 3.9.6 -jobs: - validate-models: - name: Validate models.yml - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install requirements - run: pip install -U -r docs/modelsvalidator/requirements.txt - - - name: Validate models.yml - working-directory: docs/modelsvalidator - run: python validate.py - - validate-example-data: - name: Validate example-data.json - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Checkout backend submodule - run: git submodule update --init openslides-backend/ - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install requirements - run: pip install -U -r openslides-backend/cli/requirements.txt - - - name: set pythonpath - run: echo "PYTHONPATH=openslides-backend" >> $GITHUB_ENV - - - name: generate models.py for next step - run: python openslides-backend/cli/generate_models.py docs/models.yml - - - name: Validate example-data.json - run: python openslides-backend/cli/check_json.py docs/example-data.json - - validate-initial-data-1: - name: Validate initial-data.json without migration check - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Checkout backend submodule - run: git submodule update --init openslides-backend/ - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install requirements - run: pip install -U -r openslides-backend/cli/requirements.txt - - - name: set pythonpath - run: echo "PYTHONPATH=openslides-backend" >> $GITHUB_ENV - - - name: generate models.py for next step - run: python openslides-backend/cli/generate_models.py docs/models.yml - - - name: Validate example-data.json - run: python openslides-backend/cli/check_json.py docker/initial-data.json - - validate-initial-data-2: - name: Validate initial-data.json with migration check - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Checkout backend and datastore - run: git submodule update --init openslides-backend/ openslides-datastore-service/ - - - name: set pythonpath - run: echo "PYTHONPATH=openslides-backend" >> $GITHUB_ENV - - - name: Install requirements - run: pip install -U -r openslides-backend/cli/requirements.txt - - - name: build backend - working-directory: openslides-backend/ - run: make build-prod # creates openslides-backend image - - - name: build datastore - working-directory: openslides-datastore-service/ - run: make build # creates openslides-datatore-reader and openslides-datastore-writer images - - - name: run setup - working-directory: .github/initial-data-migrations/ - run: docker-compose up -d - - - name: Wait for action service # The datastore is started, too - working-directory: .github/initial-data-migrations/ - run: docker-compose exec -T backend ./wait.sh backend 9002 - - - name: Inject initial data into the datastore - working-directory: .github/initial-data-migrations/ - run: docker-compose exec -T writer bash -c "source export-database-variables.sh; echo '$(cat ../../docker/initial-data.json)' > /data.json; export DATASTORE_INITIAL_DATA_FILE=/data.json; python cli/create_initial_data.py" - - #- name: Export unmigrated data from the datastore - # run: "curl --header 'Content-Type: application/json' -d '{}' http://localhost:9010/internal/datastore/reader/get_everything 2> /dev/null | python3 dev-commands/strip-meta-fields.py > export.json" - - #- name: Validate initial-data.json. It must fail since it is unmigrated - # run: if python openslides-backend/cli/check_json.py --partial export.json > /dev/null; then false; else true; fi - - - name: Migrate (but there should be nothing to do) - working-directory: .github/initial-data-migrations/ - run: docker-compose exec -T backend bash -c "source ./entrypoint.sh; cd migrations; python migrate.py finalize" - - - name: Export migrated data from the datastore - run: "curl --header 'Content-Type: application/json' -d '{}' http://localhost:9010/internal/datastore/reader/get_everything 2> /dev/null | python3 dev-commands/strip-meta-fields.py > export.json" - - - name: generate models.py for next step - run: python openslides-backend/cli/generate_models.py docs/models.yml - - - name: Validate exported initial-data.json - run: python openslides-backend/cli/check_json.py --partial export.json