potiuk commented on code in PR #58840:
URL: https://github.com/apache/airflow/pull/58840#discussion_r2572968285
##########
dev/breeze/src/airflow_breeze/utils/selective_checks.py:
##########
@@ -1767,3 +1768,125 @@ def parse_dep(dep_str: str) -> tuple[str, str | None]:
)
return violations
+
+ @cached_property
+ def common_compat_changed_without_next_version(self) -> bool:
+ """
+ Check if common.compat provider changed and other providers changed
don't have '# use next version'
+ comment for their common-compat dependency.
+ """
+ if self._github_event != GithubEvents.PULL_REQUEST:
+ return False
+
+ # First, check if common.compat provider was changed
+ common_compat_changed = False
+ for changed_file in self._files:
+ if changed_file.startswith("providers/common/compat/"):
+ common_compat_changed = True
+ break
+
+ if not common_compat_changed:
+ return False
+
+ # Find only the providers that actually have file changes (not
including related providers)
+ changed_providers: set[str] = set()
+ for changed_file in self._files:
+ provider = find_provider_affected(changed_file, include_docs=False)
+ if provider and provider not in ["common.compat", "Providers"]:
+ changed_providers.add(provider)
+ elif provider == "Providers":
Review Comment:
Actually ... I take it back. Both you and AI were right :)
I did some additional tests, and I was a little over-protective. I have not
taken into account that each file is individually checked, and even if such
refactor happens, and new functionality is added - this new functionality does
not have to impact "all" providers - only those that actually changed.
Of course there is a whole class of problems that this one does not solve -
i.e. what happens when someone suddenly starts using a common provider feature
that was added few commits before.
This is not super likely, usually we do such refactors as single PRs, but it
might happen when we split PRs and such.
The only real check there would be tests. and I think I will add it
separately. I think our lowest deps tests should be adapted a bit - I am not
quite sure why but the lowest-deps tests **should** also bring common.compat to
the lowest version when lowest dep test is run for certain provider (I will
take a look and see if I can fix 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]