Skip to content

Schema Version Bump Workflow #10

Schema Version Bump Workflow

Schema Version Bump Workflow #10

name: Schema Version Bump Workflow
on:
workflow_dispatch:
inputs:
is-major-schema-bump:
description: "Set to 'true' to kickoff major schema update; otherwise trigger a minor schema update"
required: true
default: 'false'
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
ontology-dry-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Python cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r scripts/schema_bump_dry_run_ontologies/requirements.txt
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_PROD_ROLE_TO_ASSUME }}
role-duration-seconds: 2700
- name: Pull AWS Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids:
AUTH0_SECRETS, corpora/backend/prod/auth0-secret
- name: Run Dry-Run Script
run: python3 -m scripts.schema_bump_dry_run_ontologies.ontology_bump_dry_run
env:
corpus_env: "prod"
- name: Store JSON with Replaced By Ontology Term Mappings
uses: actions/cache/save@v4
with:
path: "./replaced-by.json"
key: replaced-by-map
- name: upload dry run to slack
run: |
curl -F [email protected] -F "initial_comment=Ontology Dry Run Report" -F channels=${{secrets.SLACK_CURATOR_REPORTING_CHANNEL}} -H "Authorization: Bearer ${{secrets.SLACK_CURATOR_REPORTING_APP_AUTH}}" https://slack.com/api/files.upload
gencode-dry-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Python cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r scripts/schema_bump_dry_run_genes/requirements.txt
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_PROD_ROLE_TO_ASSUME }}
role-duration-seconds: 2700
- name: Pull AWS Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids:
AUTH0_SECRETS, corpora/backend/prod/auth0-secret
- name: Check if any GENCODE csv files have changed
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: cellxgene_schema_cli/cellxgene_schema/gencode_files/*.csv.gz
- name: Run Dry-Run Script
if: steps.changed-files.outputs.any_changed == 'true'
run: python3 -m scripts.schema_bump_dry_run_genes.gene_bump_dry_run
env:
corpus_env: "prod"
- name: upload to slack
if: steps.changed-files.outputs.any_changed == 'true'
run: |
curl -F [email protected] -F "initial_comment=Gene Dry Run Report" -F channels=${{secrets
.SLACK_CURATOR_REPORTING_CHANNEL}} -H "Authorization: Bearer ${{secrets.SLACK_CURATOR_REPORTING_APP_AUTH}}" https://slack.com/api/files.upload
generate-conversion-script:
runs-on: ubuntu-latest
needs: ontology-dry-run
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }} # checking out the last commit to this branch
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Python cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r scripts/migration_assistant/requirements.txt
- name: Retrieve Replaced By Ontology Term Mapping
uses: actions/cache/restore@v4
with:
path: ./replaced-by.json
key: replaced-by-map
- name: Run Conversion Script Generator
run: |
make generate-conversion-script
- name: setup git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: remove diff files
run: |
git rm --ignore-unmatch ./cellxgene_schema_cli/cellxgene_schema/gencode_files/*_diff.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: 'AUTO: update migrate.py'
title: 'AUTO: update migrate.py'
body: 'This is an automated PR to update migrate.py.'
branch: auto/migrate-script
base: main
reviewers: ${{ vars.MIGRATION_REVIEWERS }}
add-paths: |
cellxgene_schema_cli/setup.py
cellxgene_schema_cli/cellxgene_schema/__init__.py
cellxgene_schema_cli/cellxgene_schema/migrate.py