fal-ai / dbt-cloud-action Goto Github PK
View Code? Open in Web Editor NEWThis action lets you trigger a job run on dbt Cloud.
License: Apache License 2.0
This action lets you trigger a job run on dbt Cloud.
License: Apache License 2.0
The job appears to run perfectly with but then just randomly errors with Error: There has been a problem with running your dbt cloud job: undefined
due to fatal: not a git repository (or any of the parent directories): .git
(see first screenshot)
Let me know if any other details / logs / info would be useful.
Hello!
Was setting up the dbt-cloud-action to kick off our dbt cloud ci/cd job which builds modified artifacts.
However, we noticed that the dbt native integration has the ability of using the schema_override
key to set the schema for each PR.
Was wondering if it was possible to include some of those optional keys in the "trigger job" request that this action sends.
Example would just be a string for any / all of the following:
{
"cause": "Kicked off from Airflow",
"git_branch": "staging",
"schema_override": "dbt_cloud_pr_123",
"dbt_version_override": "0.18.0",
"target_name_override": "staging",
"timeout_seconds_override": 3000,
"generate_docs_override": true,
"threads_override": 8
}
I see you already send the cause so I'm assuming you'd just have to add some optional inputs for the other keys?
Maybe even always, not just for errors.
Hi,
It is my first time trying to use this github-action. So far, I have successfully used the following step specification.
- id: dbt_cloud_run
name: Run dbt job on target environment
run: |
RESPONSE=$(curl -v -H "Authorization:Token ${{ secrets.DBT_CLOUD_API_TOKEN }}" -H "Content-Type:application/json" \
-d '{"cause":"Triggered by Github Action"}' \
https://emea.dbt.com/api/v2/accounts/${{ vars.DBT_CLOUD_ACCOUNT_ID }}/jobs/${{ vars.DBT_CLOUD_JOB_ID }}/run/)
STATUSCODE=$(echo "$RESPONSE" | jq '.status.code')
echo "$RESPONSE" | jq '.status.user_message'
if [[ $STATUSCODE != 200 ]]; then
echo "$RESPONSE"
bash -c "exit 1"
fi
However, I'd be interested in replacing it with this github action as a mean to get the actual job outputs status. So I have tried amending my step as follows:
- id: dbt_cloud_run
name: Run dbt job on target environment
uses: fal-ai/[email protected]
with:
dbt_cloud_token: ${{ secrets.DBT_CLOUD_API_TOKEN }}
dbt_cloud_account_id: ${{ vars.DBT_CLOUD_ACCOUNT_ID }}
dbt_cloud_job_id: ${{ vars.DBT_CLOUD_JOB_ID }}
failure_on_error: true
Unfortunately, it fails with the following debug log outputs that seem to indicate my token is not properly configured.
##[debug]Loading env
Run fal-ai/[email protected]
##[debug]Run job body:
##[debug]{
##[debug] "cause": "Triggered by a GitHub Action"
##[debug]}
Error: There has been a problem with running your dbt cloud job:
Error: Request failed with status code 401
##[debug]Error: Request failed with status code 401
##[debug] at createError (/home/runner/work/_actions/fal-ai/dbt-cloud-action/v4.3/node_modules/axios/lib/core/createError.js:16:15)
##[debug] at settle (/home/runner/work/_actions/fal-ai/dbt-cloud-action/v4.3/node_modules/axios/lib/core/settle.js:17:12)
##[debug] at IncomingMessage.handleStreamEnd (/home/runner/work/_actions/fal-ai/dbt-cloud-action/v4.3/node_modules/axios/lib/adapters/http.js:269:11)
##[debug] at IncomingMessage.emit (node:events:525:35)
##[debug] at endReadableNT (node:internal/streams/readable:13[58](***MASKED***):12)
##[debug] at processTicksAndRejections (node:internal/process/task_queues:83:21)
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run dbt job on target environment
In my previous implementation, I have used a service token with 'Job Admin' scope on my project. I can see in dbt cloud that my token (a new one with the exact same config) is actually never accessed. Do I need to consider another - more extensive - permission?
Thanks in advance for your support.
The use case here is being able to trigger a run-operation
with specific arguments.
If a PR would be accepted, I would be happy to take a pass at this (with the caveat that I've never contributed to a GHA before)
We have a light CI job that essentially runs dbt parse --warn-error
to quickly flag issues like typos in schema files. This properly succeeds/fails in dbt cloud - but since it doesn't involve doing a proper dbt run it doesn't generate any artifacts.
Currently this results in a failed github action, with the following output:
Run fal-ai/[email protected]
Triggered job. https://cloud.getdbt.com...
Run: [11](...) 6739196 - Success
job finished with 'Success'
Error: There has been a problem with running your dbt cloud job:
Error: Request failed with status code 404
I think this is because getArtifacts
is always called after a successful job run, and getting artifacts involves fetching run_results.json
.
Am I using this Github Action wrong? Would it be possible to find a way to skip the need for fetching run_results
?
Node16 is at end of life, so running this action gives a warning annotation:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: fal-ai/dbt-cloud-action@main. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
I've tested, and changing the node version in action.yml
from node16
to node20
fixes it without causing any other issues. Can I submit a PR?
When cancelling the job on GitHub Actions interface, an ongoing job in dbt Cloud continues. In such a scenario it would be best to also cancel the dbt Cloud run (API reference)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.