Skip to content

Commit

Permalink
Merge pull request #106 from dbt-labs/feature/flags-for-compare
Browse files Browse the repository at this point in the history
  • Loading branch information
b-per authored Nov 6, 2024
2 parents e31d412 + 7387924 commit b1caade
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
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.9.0"
version = "0.10.0"
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: 1 addition & 0 deletions src/dbt_jobs_as_code/schemas/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class JobDefinition(BaseModel):
description: str = ""
state: int = 1
run_compare_changes: bool = False
compare_changes_flags: str = "--select state:modified"
# we don't want to enforce the list in case we add more, but still want to get those in the JSON schema
job_type: str = Field(
json_schema_extra={"enum": ["scheduled", "merge", "ci", "other"]},
Expand Down
11 changes: 6 additions & 5 deletions src/dbt_jobs_as_code/schemas/load_job_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@
"$ref": "#/$defs/Settings"
},
"execution": {
"allOf": [
{
"$ref": "#/$defs/Execution"
}
],
"$ref": "#/$defs/Execution",
"default": {
"timeout_seconds": 0
}
Expand Down Expand Up @@ -253,6 +249,11 @@
"title": "Run Compare Changes",
"type": "boolean"
},
"compare_changes_flags": {
"default": "--select state:modified",
"title": "Compare Changes Flags",
"type": "string"
},
"job_type": {
"default": "scheduled",
"enum": [
Expand Down
1 change: 1 addition & 0 deletions tests/exporter/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_export_jobs_yml(capsys):
on_merge: false
description: ''
run_compare_changes: false
compare_changes_flags: --select state:modified
job_type: scheduled
triggers_on_draft_pr: false
job_completion_trigger_condition:
Expand Down
2 changes: 2 additions & 0 deletions tests/loader/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"jobs": {
"job1": {
"account_id": 43791,
"compare_changes_flags": "--select state:modified",
"custom_environment_variables": [],
"dbt_version": None,
"deferring_environment_id": None,
Expand Down Expand Up @@ -45,6 +46,7 @@
},
"job2": {
"account_id": 43791,
"compare_changes_flags": "--select state:modified",
"custom_environment_variables": [
{
"display_value": None,
Expand Down

0 comments on commit b1caade

Please sign in to comment.