Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Trigger build workflows for model on sqoop #7

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

dfsnow
Copy link
Member

@dfsnow dfsnow commented Nov 30, 2023

This PR adds triggers to rebuild the main model input views/tables on sqoop. Once ccao-data/data-architecture#255 is merged, this will rebuild the full table every morning once sqoop is finished running.

Comment on lines +3 to +14
GH_API_REPOS=(
"https://api.github.com/repos/ccao-data/data-architecture"
"https://api.github.com/repos/ccao-data/data-architecture"
)
GH_API_WORKFLOWS=(
"test_dbt_models.yaml"
"build_and_test_dbt.yaml"
)
GH_API_WORKFLOW_INPUTS=(
""
"model.vw_card_res_input model.vw_pin_condo_input"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty hideous but works fine. Just iterates through the index of the arrays.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nitpick, non-blocking] I love representing data in shell scripts 🙈 Perhaps a brief comment explaining the data structure would help with readability?

Copy link
Member Author

@dfsnow dfsnow Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 3bee4a2!

@dfsnow dfsnow requested a review from jeancochrane November 30, 2023 19:33
@dfsnow dfsnow marked this pull request as ready for review November 30, 2023 19:33
Copy link

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, just one small nitpick that I think may be a syntax error!

Comment on lines +3 to +14
GH_API_REPOS=(
"https://api.github.com/repos/ccao-data/data-architecture"
"https://api.github.com/repos/ccao-data/data-architecture"
)
GH_API_WORKFLOWS=(
"test_dbt_models.yaml"
"build_and_test_dbt.yaml"
)
GH_API_WORKFLOW_INPUTS=(
""
"model.vw_card_res_input model.vw_pin_condo_input"
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nitpick, non-blocking] I love representing data in shell scripts 🙈 Perhaps a brief comment explaining the data structure would help with readability?

if [ -z "${GH_API_WORKFLOW_INPUTS[$i]}" ]; then
echo '{"ref": "master"}'
else
echo "{\"ref\": \"master\", \"inputs\": {\"models\": \"${GH_API_WORKFLOW_INPUTS[$i]}\"}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nitpick] Hm, I might be reading wrong here but I think we may be missing a closing brace:

Suggested change
echo "{\"ref\": \"master\", \"inputs\": {\"models\": \"${GH_API_WORKFLOW_INPUTS[$i]}\"}"
echo "{\"ref\": \"master\", \"inputs\": {\"models\": \"${GH_API_WORKFLOW_INPUTS[$i]}\"}}"

Copy link
Member Author

@dfsnow dfsnow Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Fixed in 3bee4a2!

@dfsnow dfsnow force-pushed the dfsnow/trigger-multiple-workflows branch from 3e82a43 to 3bee4a2 Compare November 30, 2023 19:51
@dfsnow dfsnow requested a review from jeancochrane November 30, 2023 19:53
Copy link

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go!

@dfsnow dfsnow merged commit bd59645 into master Nov 30, 2023
@dfsnow dfsnow deleted the dfsnow/trigger-multiple-workflows branch November 30, 2023 19:58
dfsnow added a commit that referenced this pull request Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants