Giter VIP home page Giter VIP logo

dbt-cloud-action's People

Contributors

burkaygur avatar chamini2 avatar daniel-ferguson avatar kingalban avatar maxpowis avatar mederka avatar skwon615 avatar turbo1912 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dbt-cloud-action's Issues

feature request: include dbt api "overrides" as optional inputs into request body

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?

Support `steps_override`

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)

Undefined issue with DBT run after it succeeds

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.

Screenshots:
Screenshot 2022-07-21 at 09 27 52

Screenshot 2022-07-21 at 09 28 35

Action reports failure when job doesn't create `run_reports.json` artifact

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?

Request failed with status code 401 using a 'Job Admin' service token

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.