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

[Bug] Linking ids to jobs does not mark existing jobs to not be deleted #121

Closed
christineberger opened this issue Jan 24, 2025 · 0 comments · Fixed by #124
Closed

[Bug] Linking ids to jobs does not mark existing jobs to not be deleted #121

christineberger opened this issue Jan 24, 2025 · 0 comments · Fixed by #124
Assignees
Labels
bug Something isn't working triage Issue needs to be triaged by the maintainer team.

Comments

@christineberger
Copy link

Describe the bug
When there are existing jobs that were not created by jobs-as-code but follow the identifier convention, they need to be imported so that jobs-as-code does not mark them for deletion. Additionally, importing the job with linked_id does not help unmark it.

To Reproduce
Steps to reproduce the behavior:

  1. Create a job named something like QAT - [[some_model_flow]]
  2. From jobs-as-code, create a new test job without importing
  3. Run a plan and see that the some_model_flow job will be deleted
  4. Get an import of the existing job with linked_id - you will see that it has the linked_id, but if you run the plan again you will see that some_model_flow is still marked for deletion.
  5. In order to get jobs-as-code to recognize the existing job with the import, you need to change the job's key (import_#:) to the identifier like some_model_flow:.
  6. If you run plan again, you will see now that the job will not be deleted.

Expected behavior
I expect if there is a linked id, that no matter the job's named configuration key it will link with the existing job. This doesn't happen unless the key is the same as the identifier.

Desktop (please complete the following information):

  • OS [e.g. iOS]: Sequoia 15.2
  • dbt Core Version [e.g. 1.3.1]: dbt CLI
  • dbt-jobs-as-code Version [e.g. 1.0.0]: 1.0.2
@christineberger christineberger added bug Something isn't working triage Issue needs to be triaged by the maintainer team. labels Jan 24, 2025
@christineberger christineberger changed the title [Bug] linking ids to jobs does not mark existing jobs to not be deleted [Bug] Linking ids to jobs does not mark existing jobs to not be deleted Jan 24, 2025
@b-per b-per closed this as completed in #124 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be triaged by the maintainer team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants