Skip to content

Commit

Permalink
change job name. change clone name convention. fix typos. new delete_…
Browse files Browse the repository at this point in the history
…clone job.
  • Loading branch information
jaymedina committed Oct 28, 2024
1 parent 46c8390 commit ca73fb6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/test_with_clone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: read

jobs:
test_with_clone:
create_clone_and_run_schemachange:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'create_clone_and_run_schemachange')
environment: dev
Expand All @@ -20,7 +20,7 @@ jobs:
SNOWSQL_WAREHOUSE: ${{ secrets.SNOWSQL_WAREHOUSE }}
SNOWSQL_CLONE_ROLE: DATA_ENGINEER
#SNOWSQL_SCHEMACHANGE_ROLE: SYSADMIN
SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE: "${{ vars.SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE }}_${{ github.sha }}"
SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE: "${{ vars.SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE }}_${{ github.head_ref }}"
SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE_ORIG: ${{ vars.SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE }}


Expand Down Expand Up @@ -49,16 +49,21 @@ jobs:
- name: Zero-copy clone the database
shell: bash
run: |
~/bin/snowsql -r $SNOWSQL_CLONE_ROLE -q "CREATE DATABASE $SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE CLONE $SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE_ORIG;"
~/bin/snowsql -r $SNOWSQL_CLONE_ROLE -q "CREATE OR REPLACE DATABASE $SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE CLONE $SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE_ORIG;"
# TODO: Do we need SYSADMIN to run schemachange?
- name: Run schemachange on the clone
shell: bash
run: |
schemachange \
-f synapse_data_warehouse \
-a $SNOWFLAKE_ACCOUNT \
-u $SNOWFLAKE_USER \
-a $SNOWSQL_ACCOUNT \
-u $SNOWSQL_USER \
-r $SNOWSQL_CLONE_ROLE \
-w compute_xsmall \
-w $SNOWSQL_WAREHOUSE \
--config-folder synapse_data_warehouse
# delete_clone:
# runs-on: ubuntu-latest
# if: contains(github.event.pull_request.labels.*.name, 'create_clone_and_run_schemachange')
# environment: dev

0 comments on commit ca73fb6

Please sign in to comment.