Skip to content
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

[Feature] Improve yml readability #112

Open
tim-steinkuhler opened this issue Dec 10, 2024 · 2 comments
Open

[Feature] Improve yml readability #112

tim-steinkuhler opened this issue Dec 10, 2024 · 2 comments
Assignees
Labels
triage Issue needs to be triaged by the maintainer team.

Comments

@tim-steinkuhler
Copy link

tim-steinkuhler commented Dec 10, 2024

Describe the feature
Structure the yml so that it matches the dbt Cloud UI.

Currently, the generated yml files are sorted alphabetically, so it took me a while to decypher what part of the yaml was responsible for what part of dbt Cloud job configuration. If you structure the yml in a way that it matches the dbt Cloud UI, it is easier to understand.

Example of re-ordered yaml:

jobs:
  build:
    account_id: 1
    project_id: 2
    environment_id: 3
    linked_id: 4

    # Job Settings
    job_type: scheduled
    name: prod - scheduled build
    description: Scheduled build job on prod


    # Execution settings
    run_generate_sources: false
    execute_steps:
      - dbt build
    generate_docs: true


    # Triggers
    triggers:
      github_webhook: false
      git_provider_webhook: false
      schedule: true
      on_merge: false

    schedule:
      cron: "0 4,9,13 * * 0,1,2,3,4,5,6"
    
    triggers_on_draft_pr: false
    job_completion_trigger_condition:


    # Advanced settings
    custom_environment_variables: []
    settings:
      threads: 4
      target_name: "prod"
    execution:
      timeout_seconds: 0

    dbt_version:  #  Inherited from environment

    deferring_job_definition_id:  # we defer to this environment instead
    deferring_environment_id: 3
    run_compare_changes: false
    compare_changes_flags: --select state:modified

Who will this benefit?
Anyone that wants to match the yaml to the outcome (job configuration) in dbt Cloud.

Are you interested in contributing this feature?

Perhaps if you agree that this is a good idea, we could chat about how to go about this

@tim-steinkuhler tim-steinkuhler added the triage Issue needs to be triaged by the maintainer team. label Dec 10, 2024
@b-per
Copy link
Collaborator

b-per commented Dec 10, 2024

That's interesting. Could you please mention

  • what exact command you are running
  • what Python version you are using

I just tried the command dbt-jobs-as-code import-jobs --account-id 12 --project-id 23 --include-linked-id on my side and I am getting the YML file ordered as in the Pydantic definition, not alphabetically

...
  import_5:
    linked_id: 1234
    account_id: 12
    project_id: 23
    environment_id: 34
    dbt_version: versionless
    name: PROD - Full deploy
    settings:
      threads: 4
...

@tim-steinkuhler
Copy link
Author

Ha, thank you for this! I must have mis-remembered then. My point was more that I had some trouble the first time I looked at the output, trying to link it to the UI.

Like, in your example, dbt_version is before name, while in the UI, dbt_version is the second to last thing on the page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issue needs to be triaged by the maintainer team.
Projects
None yet
Development

No branches or pull requests

2 participants