vincbeck commented on code in PR #55736:
URL: https://github.com/apache/airflow/pull/55736#discussion_r2355658712


##########
airflow-core/src/airflow/dag_processing/bundles/manager.py:
##########
@@ -214,15 +238,34 @@ def _extract_and_sign_template(bundle_name: str) -> 
tuple[str | None, dict]:
                     self.log.debug("Updated template parameters for bundle 
%s", name)
             else:
                 new_template, new_params = _extract_and_sign_template(name)
-                new_bundle = DagBundleModel(name=name)
-                new_bundle.signed_url_template = new_template
-                new_bundle.template_params = new_params
+                bundle = DagBundleModel(name=name)
+                bundle.signed_url_template = new_template
+                bundle.template_params = new_params
 
-                session.add(new_bundle)
+                session.add(bundle)
                 self.log.info("Added new DAG bundle %s to the database", name)
 
+            if team and bundle_to_team.get(name) != config.team_name:
+                # Change of team. It can be associating a team to a dag bundle 
that did not have one or
+                # swapping a team for another
+                bundle.teams = [team]
+                if bundle_to_team.get(name):
+                    self.log.warning(

Review Comment:
   While working on it I do not feel comfortable potentially blocking the 
dag-processor process. Since the team_name is defined in the config, it is easy 
to revert back. While changing the team ownership of a dag bundle is impactful 
for users, on the DB, the changes are fairly small (one row in one table), thus 
reverting is easy.
   
   But if you and others think we should have an approval step in this case, 
happy to add it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to