Skip to content

Commit

Permalink
Merge pull request #92 from dbt-labs/fix/remove-custom-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
b-per authored Sep 18, 2024
2 parents d0d9ab7 + 7d2e800 commit 563ae2c
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 32 deletions.
2 changes: 0 additions & 2 deletions example_jobs_file/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
threads: 4
state: 1
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: false
schedule: true
Expand All @@ -50,7 +49,6 @@ jobs:
threads: 4
state: 1
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: true # this job runs from webhooks
schedule: false # this doesn't run on a schedule
Expand Down
2 changes: 0 additions & 2 deletions example_jobs_file/jobs_templated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
threads: 4
state: 1
triggers:
custom_branch_only: false
git_provider_webhook: false
github_webhook: false
# we can add more complex logic in Jinja based on our variables
Expand Down Expand Up @@ -52,7 +51,6 @@ jobs:
threads: 4
state: 1
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: true # this job runs from webhooks
schedule: false # this doesn't run on a schedule
Expand Down
2 changes: 0 additions & 2 deletions example_jobs_file/jobs_with_anchors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
threads: 4
state: 1
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: false
schedule: true
Expand All @@ -66,7 +65,6 @@ jobs:
target_name: TEST
threads: 4
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: true # this job runs from webhooks
schedule: false # this doesn't run on a schedule
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dbt-jobs-as-code"
version = "0.8.0"
version = "0.8.1"
description = "A CLI to allow defining dbt Cloud jobs as code"
authors = ["dbt Labs <[email protected]>"]
license = "Apache License 2.0"
Expand Down
1 change: 0 additions & 1 deletion src/schemas/common_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def set_any_of_string_boolean(schema: Dict[str, Any]):
class Triggers(BaseModel):
github_webhook: bool = field_optional_bool_allowed_as_string_in_schema
git_provider_webhook: Optional[bool] = field_optional_bool_allowed_as_string_in_schema
custom_branch_only: Optional[bool] = field_optional_bool_allowed_as_string_in_schema
schedule: Optional[bool] = field_optional_bool_allowed_as_string_in_schema
on_merge: Optional[bool] = field_optional_bool_allowed_as_string_in_schema

Expand Down
5 changes: 5 additions & 0 deletions src/schemas/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,8 @@ class JobMissingFields(JobDefinition):
next_run: Optional[str] = ""
next_run_humanized: Optional[str] = ""
is_system: bool
account: Any
project: Any
environment: Any
most_recent_run: Any
most_recent_completed_run: Any
17 changes: 5 additions & 12 deletions src/schemas/load_job_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@
"title": "State",
"type": "integer"
},
"run_compare_changes": {
"default": false,
"title": "Run Compare Changes",
"type": "boolean"
},
"job_type": {
"default": "scheduled",
"enum": [
Expand Down Expand Up @@ -418,18 +423,6 @@
"default": false,
"title": "Git Provider Webhook"
},
"custom_branch_only": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
}
],
"default": false,
"title": "Custom Branch Only"
},
"schedule": {
"anyOf": [
{
Expand Down
2 changes: 0 additions & 2 deletions tests/exporter/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_export_jobs_yml(capsys):
triggers:
github_webhook: false
git_provider_webhook: false
custom_branch_only: true
schedule: false
on_merge: false
description: ''
Expand Down Expand Up @@ -75,7 +74,6 @@ def test_export_jobs_yml(capsys):
triggers=Triggers(
github_webhook=False,
git_provider_webhook=False,
custom_branch_only=True,
schedule=False,
),
state=1,
Expand Down
2 changes: 0 additions & 2 deletions tests/integration-tests/jobs_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
triggers:
github_webhook: false
git_provider_webhook: false
custom_branch_only: false
schedule: false
job_completion_trigger_condition:
condition:
Expand Down Expand Up @@ -60,7 +59,6 @@ jobs:
triggers:
github_webhook: false
git_provider_webhook: false
custom_branch_only: false
schedule: false
custom_environment_variables:
- DBT_ALPHA: "true"
Expand Down
2 changes: 0 additions & 2 deletions tests/loader/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
triggers:
github_webhook: false
git_provider_webhook: "false"
custom_branch_only: true
schedule: true
on_merge: false
job_completion_trigger_condition:
Expand Down Expand Up @@ -54,7 +53,6 @@ jobs:
triggers:
github_webhook: true
git_provider_webhook: false
custom_branch_only: true
schedule: false
on_merge: true
job_type: other
Expand Down
2 changes: 0 additions & 2 deletions tests/loader/jobs_templated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
triggers:
github_webhook: false
git_provider_webhook: false
custom_branch_only: true
# we can put some logic to decide for true/false
schedule: "{{ env_type == 'prod' }}"
on_merge: false
Expand Down Expand Up @@ -55,7 +54,6 @@ jobs:
triggers:
github_webhook: true
git_provider_webhook: false
custom_branch_only: true
schedule: false
on_merge: true
job_type: other
Expand Down
2 changes: 0 additions & 2 deletions tests/loader/jobs_with_anchors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
threads: 4
state: 1
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: false
schedule: true
Expand All @@ -62,7 +61,6 @@ jobs:
target_name: TEST
threads: 4
triggers:
custom_branch_only: true
git_provider_webhook: false
github_webhook: true # this job runs from webhooks
schedule: false # this doesn't run on a schedule
Expand Down
2 changes: 0 additions & 2 deletions tests/loader/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"settings": {"target_name": "production", "threads": 4},
"state": 1,
"triggers": {
"custom_branch_only": True,
"git_provider_webhook": False,
"github_webhook": False,
"on_merge": False,
Expand Down Expand Up @@ -87,7 +86,6 @@
"settings": {"target_name": "TEST", "threads": 4},
"state": 1,
"triggers": {
"custom_branch_only": True,
"git_provider_webhook": False,
"github_webhook": True,
"on_merge": True,
Expand Down

0 comments on commit 563ae2c

Please sign in to comment.