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

Link jobs to existing ID when importing jobs #124

Merged
merged 2 commits into from
Feb 6, 2025
Merged

Conversation

b-per
Copy link
Collaborator

@b-per b-per commented Feb 6, 2025

Closes #121 (or I believe so 🤣)

Now, when using import-jobs on a job that is already managed via dbt-jobs-as-code (i.e. contains an identifier in [[ ... ]]), the identifier in the outputted YAML will be the existing one, meaning that a plan/sync would result in no change rather than deleting one job and creating a new one.

@b-per b-per requested a review from a team as a code owner February 6, 2025 10:59
Copy link
Contributor

github-actions bot commented Feb 6, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/dbt_jobs_as_code
   main.py24413943%93–96, 102, 122–123, 149–152, 158, 186–270, 317–349, 362–399, 425–464, 488–522, 527–528, 532
src/dbt_jobs_as_code/client
   __init__.py1775867%16, 53–54, 62, 89–104, 119–120, 139–140, 147–157, 170–171, 187–188, 205, 215, 245–247, 289–304, 327, 343–344, 354–366, 369–380, 385–394
src/dbt_jobs_as_code/cloud_yaml_mapping
   change_set.py1492285%46, 84–85, 123, 135, 156–157, 163–165, 180–183, 212–222, 241–250, 268–282, 318–331
src/dbt_jobs_as_code/importer
   __init__.py27774%14–15, 22–27
src/dbt_jobs_as_code/loader
   load.py87199%118
src/dbt_jobs_as_code/schemas
   __init__.py33488%49, 64, 77–78
   common_types.py621084%7–8, 12–13, 29–30, 67–68, 86, 92
   config.py14379%18, 24–25
   job.py81298%134, 139
TOTAL93224674% 

Tests Skipped Failures Errors Time
50 0 💤 0 ❌ 0 🔥 9.766s ⏱️

@b-per b-per merged commit 4239bcd into main Feb 6, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Linking ids to jobs does not mark existing jobs to not be deleted
1 participant