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

Allow users to opt-in or out (default) of detached test nodes #1470

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

tatiana
Copy link
Collaborator

@tatiana tatiana commented Jan 15, 2025

Since we introduced detached test tasks to fix a customer issue in #1433 (release 1.8.1), we changed how Cosmos renders DAGs, with the chance that Cosmos significantly changed how it renders a dbt project - even when users did not change their DbtDag or DbtTaskGroup configuration. This is unacceptable in a micro release - and for this reason we're reverting this change and making the feature opt-in.

PR #1433 led to issues such as #1464, reported by multiple Cosmos users, and also issues that did not become Github issues, such as an Astro customer who reported that when they upgraded to Cosmos 1.8.1, the number of tasks increased dramatically. One problem with #1433 was that it did not empower users to opt in or out of having detached test nodes, solving the problem for some but causing problems for many.

This PR aims to solve this problem by introducing a new property to RenderConfig: should_detach_multiple_parents_tests. We are reverting the Cosmos DAG rendering to what it was in 1.8.0 and before: by default, it will not detach tests with multiple parents. Users must opt-in for this behaviour if and when they want to.

We understand this may be perceived as a breaking change by some, but it is the correct way to move forward and avoid causing further disruption.

Ultimately, we'll review the current implementation, as described in #1469, but with this change, we're documenting the current behaviour and empowering users.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 15, 2025
Copy link

netlify bot commented Jan 15, 2025

Deploy Preview for sunny-pastelito-5ecb04 ready!

Name Link
🔨 Latest commit d203f59
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/6787e0fb69c3f2000810a8a9
😎 Deploy Preview https://deploy-preview-1470--sunny-pastelito-5ecb04.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dosubot dosubot bot added area:config Related to configuration, like YAML files, environment variables, or executer configuration area:docs Relating to documentation, changes, fixes, improvement area:rendering Related to rendering, like Jinja, Airflow tasks, etc labels Jan 15, 2025
@tatiana tatiana changed the title Allow users to opt-in/out of detached test nodes Allow users to opt-in or out (default) of detached test nodes Jan 15, 2025
@tatiana tatiana mentioned this pull request Jan 15, 2025
Copy link
Contributor

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great to me. Thanks for the quick fix and tidying up/making it configurable around this issue!

cosmos/config.py Outdated Show resolved Hide resolved
docs/configuration/testing-behavior.rst Outdated Show resolved Hide resolved
Co-authored-by: Pankaj Koti <pankajkoti699@gmail.com>
Copy link

cloudflare-workers-and-pages bot commented Jan 15, 2025

Deploying astronomer-cosmos with  Cloudflare Pages  Cloudflare Pages

Latest commit: edb4ca3
Status: ✅  Deploy successful!
Preview URL: https://6bb4b5b9.astronomer-cosmos.pages.dev
Branch Preview URL: https://configurable-detached-tests.astronomer-cosmos.pages.dev

View logs

Co-authored-by: Pankaj Koti <pankajkoti699@gmail.com>
@tatiana tatiana merged commit 104f8d4 into main Jan 15, 2025
64 of 66 checks passed
@tatiana tatiana deleted the configurable-detached-tests branch January 15, 2025 16:25
tatiana added a commit that referenced this pull request Jan 15, 2025
Bug Fixes
* Fix ``httpx.get`` exception handling while emitting telemetry by
@tatiana in #1439
* Fix (not) rendering detached tests in ``TestBehavior.NONE`` and
``AFTER_ALL`` by @tatiana in #1463
* Fix detached test tasks names so they do not exceed 250 chars by
@tatiana in #1464

Enhancement
* Allow users to opt-in or out (default) of detached test nodes by
@tatiana in #1470. Learn more about this
[here](https://astronomer.github.io/astronomer-cosmos/configuration/testing-behavior.html).

Docs
* Docs: Fix broken links and rendering by @pankajastro in #1437
* Update ``operator args`` docs to include ``install_deps`` by @tatiana
in #1456
* Improve Cosmos ``select`` docs to include latest graph operator
support by @tatiana in #1467

Others
* Upgrade GitHub action artifacts upload-artifact & download-artifact to
v4 by @pankajkoti in #1445
* Enable Depandabot to scan outdated Github Actions dependencies by
@tatiana in #1446
* Pre-commit hook updates in #1459, #1441
* Dependabot Github action updates in #1451, #1452, #1453, #1454, #1455
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.95%. Comparing base (42d30a1) to head (d203f59).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1470   +/-   ##
=======================================
  Coverage   96.95%   96.95%           
=======================================
  Files          73       73           
  Lines        4370     4371    +1     
=======================================
+ Hits         4237     4238    +1     
  Misses        133      133           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tatiana tatiana added this to the Cosmos 1.8.2 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:config Related to configuration, like YAML files, environment variables, or executer configuration area:docs Relating to documentation, changes, fixes, improvement area:rendering Related to rendering, like Jinja, Airflow tasks, etc size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants