diff --git a/example_jobs_file/jobs.yml b/example_jobs_file/jobs.yml index 857608b..67cf363 100644 --- a/example_jobs_file/jobs.yml +++ b/example_jobs_file/jobs.yml @@ -23,7 +23,6 @@ jobs: threads: 4 state: 1 triggers: - custom_branch_only: true git_provider_webhook: false github_webhook: false schedule: true @@ -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 diff --git a/example_jobs_file/jobs_templated.yml b/example_jobs_file/jobs_templated.yml index 9e65118..e4f6bc7 100644 --- a/example_jobs_file/jobs_templated.yml +++ b/example_jobs_file/jobs_templated.yml @@ -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 @@ -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 diff --git a/example_jobs_file/jobs_with_anchors.yml b/example_jobs_file/jobs_with_anchors.yml index d1a1096..80ac883 100644 --- a/example_jobs_file/jobs_with_anchors.yml +++ b/example_jobs_file/jobs_with_anchors.yml @@ -45,7 +45,6 @@ jobs: threads: 4 state: 1 triggers: - custom_branch_only: true git_provider_webhook: false github_webhook: false schedule: true @@ -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 diff --git a/pyproject.toml b/pyproject.toml index bd46e8a..b704d5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "Apache License 2.0" diff --git a/src/schemas/common_types.py b/src/schemas/common_types.py index c7213e0..3a5424f 100644 --- a/src/schemas/common_types.py +++ b/src/schemas/common_types.py @@ -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 diff --git a/src/schemas/job.py b/src/schemas/job.py index 4b4c2cc..b520340 100644 --- a/src/schemas/job.py +++ b/src/schemas/job.py @@ -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 diff --git a/src/schemas/load_job_schema.json b/src/schemas/load_job_schema.json index aba97c6..2f7341c 100644 --- a/src/schemas/load_job_schema.json +++ b/src/schemas/load_job_schema.json @@ -248,6 +248,11 @@ "title": "State", "type": "integer" }, + "run_compare_changes": { + "default": false, + "title": "Run Compare Changes", + "type": "boolean" + }, "job_type": { "default": "scheduled", "enum": [ @@ -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": [ { diff --git a/tests/exporter/test_export.py b/tests/exporter/test_export.py index 40876a8..11b0d6d 100644 --- a/tests/exporter/test_export.py +++ b/tests/exporter/test_export.py @@ -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: '' @@ -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, diff --git a/tests/integration-tests/jobs_template.yml b/tests/integration-tests/jobs_template.yml index 5d26e99..3ab7fde 100644 --- a/tests/integration-tests/jobs_template.yml +++ b/tests/integration-tests/jobs_template.yml @@ -27,7 +27,6 @@ jobs: triggers: github_webhook: false git_provider_webhook: false - custom_branch_only: false schedule: false job_completion_trigger_condition: condition: @@ -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" diff --git a/tests/loader/jobs.yml b/tests/loader/jobs.yml index 5faebb4..6cf8365 100644 --- a/tests/loader/jobs.yml +++ b/tests/loader/jobs.yml @@ -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: @@ -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 diff --git a/tests/loader/jobs_templated.yml b/tests/loader/jobs_templated.yml index 65e23cb..e4a4ea4 100644 --- a/tests/loader/jobs_templated.yml +++ b/tests/loader/jobs_templated.yml @@ -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 @@ -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 diff --git a/tests/loader/jobs_with_anchors.yml b/tests/loader/jobs_with_anchors.yml index f601673..54fb7d0 100644 --- a/tests/loader/jobs_with_anchors.yml +++ b/tests/loader/jobs_with_anchors.yml @@ -43,7 +43,6 @@ jobs: threads: 4 state: 1 triggers: - custom_branch_only: true git_provider_webhook: false github_webhook: false schedule: true @@ -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 diff --git a/tests/loader/test_loader.py b/tests/loader/test_loader.py index 9c548dc..1a022fe 100644 --- a/tests/loader/test_loader.py +++ b/tests/loader/test_loader.py @@ -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, @@ -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,