-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Github workflow to populate the persistent source schema #715
Add Github workflow to populate the persistent source schema #715
Conversation
e283ae8
to
b7950bf
Compare
b7950bf
to
a739d97
Compare
a739d97
to
7ba0977
Compare
7ba0977
to
c9d00fe
Compare
c9d00fe
to
9278608
Compare
Makefile
Outdated
.PHONY: test-bigquery | ||
test-bigquery: | ||
hatch -v run bigquery-env:pytest -vv -n $(PARALLELISM) $(ADDITIONAL_PYTEST_OPTIONS) metricflow/test/ | ||
|
||
.PHONY: populate-persistent-source-schema-bigquery | ||
populate-persistent-source-schema: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add -bigquery
suffix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Apparently, if the name it wrong, make
still succeeds with nothing to do
9278608
to
0f6a14c
Compare
7d3b842
to
0977192
Compare
Updated logic to run the workflow when the label is set, and remove the label when workflow finishes. Hopefully Github's concurrency controls work as expected, and this seems good enough for a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, let's give it a go. Please address inline comments before merge.
on: | ||
pull_request: | ||
types: [labeled] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add workflow_dispatch
so we don't have to label random PRs if something gets borked off main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, but iterating on this PR has been a huge pain as it can't be tested locally.
jobs: | ||
snowflake-populate: | ||
environment: DW_INTEGRATION_TESTS | ||
if: github.event.action == 'labeled' && github.event.label.name == 'Reload Test Data in SQL Engines' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may need an update for workflow_dispatch to fire, but it should be simple enough.
Makefile
Outdated
.PHONY: test-bigquery | ||
test-bigquery: | ||
hatch -v run bigquery-env:pytest -vv -n $(PARALLELISM) $(ADDITIONAL_PYTEST_OPTIONS) metricflow/test/ | ||
|
||
.PHONY: populate-persistent-source-schema-bigquery | ||
populate-persistent-source-schema-bigquery: | ||
hatch -v run bigquery-env:pytest -vv $(ADDITIONAL_PYTEST_OPTIONS) $(POPULATE_PERSISTENT_SOURCE_SCHEMA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to define a make command that just works, instead of one that relies on someone knowing that they have to set up the ADDITIONAL_PYTEST_OPTIONS=--use-persistent-source-schema
environment flag.
I just know I'm going to perpetually be in a loop of:
make populate-persistent....databricks
<fail>
make -e "ADDITIONAL_PYTEST_OPTIONS=--use-persistent-source-schema" populate-persistent...databricks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. Updated.
group: POPULATE_PERSISTENT_SOURCE_SCHEMA | ||
cancel-in-progress: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very curious to see how this works.
additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }} | ||
make-target: "populate-persistent-source-schema-databricks" | ||
|
||
remove-label: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh if this works we should TOTALLY add it to the sql engine tests...... I've got some updates I want to make over there so I can do that once this is in.
|
||
name: Reload Test Data in SQL Engines | ||
|
||
# We don't want multiple workflows trying to create the same table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess if this ever happens in different schemas the last one in will be wrong anyway.
0977192
to
dc1ad0d
Compare
dc1ad0d
to
3f88ff4
Compare
3f88ff4
to
609c080
Compare
Description
When the definitions of the tables used in tests change, the persistent source schema needs to be repopulated manually. This PR adds a Github workflow to do this that can be trigged with the
Reload Test Data in SQL Engines
label.