Conversation
Test files were accidentally deleted in the previous commit. This restores them from main and keeps only the feature changes for ui_job_name_override. Co-authored-by: Cursor <cursoragent@cursor.com>
Move testing-jobs-as-code/ and .venv to .git/info/exclude instead. Co-authored-by: Cursor <cursoragent@cursor.com>
The new field defaults to None and appears in model_dump(), so the test fixtures need to include it. Co-authored-by: Cursor <cursoragent@cursor.com>
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@b-per Feel free to hit me up with slack on questions or edits that I need to make, thanks! |
|
Hey! It will take some very hard convincing to implement this, and I am not convinced yet 😄
Without this, we lose a lot of the functionality of the tool. I am not sure I am getting what is the show stopper of having Ideally, we would have a field (hidden or not) in the platform API to store the jobs-as-code identifier for jobs. This would be the best and the cleanest but it has dependencies on modifying the code of the dbt platform to support that which we'd have to prioritize internally. The other option I can think of would be to store this state in the job Description as an alternative to the job Name. It would still show in the platform UI if this is a show stopper for the customer but at least it won't be in the name itself. |
Video Walkthrough
PR explanation video
Summary
Add a new optional
ui_job_name_overridefield to job definitions that allows users to control the exact job name displayed in the dbt Cloud UI without the[[identifier]]suffix.By default,
dbt-jobs-as-codeappends[[identifier]]to every job name for tracking purposes (e.g.Daily Job [[daily_job_prod]]). This is functional but clutters the UI. Whenui_job_name_overrideis set, the tool sends that exact name to dbt Cloud instead, and uses name + project + environment matching to track the job on subsequent syncs.Checklist
uv run pytest)rufflinting passes)uv run dbt-jobs-as-code update-json-schemaand commit the updated JSON schemaType of Change
Testing
Manual testing against live dbt Cloud (account 77338, project 136022)
ui_job_name_override— verified it appears in dbt Cloud as the exact override name (no[[identifier]]suffix)planafter creation — verified the tool matches the override job by name and reports it as identicalui_job_name_overridevalue — verifiedplandetects the rename as an UPDATE (not a duplicate CREATE) andsyncapplies itplanafter rename — verified the tool matches the job by its new override name and reports identicalui_job_name_override— confirmed existing behavior is completely unchanged (still uses[[identifier]]suffix)What changed
schemas/job.pyui_job_name_overrideoptional field. Updatedto_payload()to use override name when set. Excluded fromto_load_format()export.schemas/__init__.pyui_job_name_overridefrom diff comparison; substitutes effective name fornamewhen comparing so renames are detected.schemas/load_job_schema.jsonui_job_name_overrideproperty to the JSON schema.cloud_yaml_mapping/change_set.pynameto handle renames.docs/advanced_config/override_job_name.mddocs/advanced_config/index.mdYAML usage
When
ui_job_name_overrideis absent or null, behavior is identical to before — fully backwards compatible.