shahar1 commented on code in PR #69124:
URL: https://github.com/apache/airflow/pull/69124#discussion_r3609106701
##########
scripts/ci/prek/common_prek_utils.py:
##########
@@ -152,6 +160,32 @@ def read_allowed_kubernetes_versions() -> list[str]:
return [v.lstrip("v") for v in versions]
+def read_allowed_python_major_minor_versions() -> list[str]:
+ """Parse ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS from global_constants.py
(single source of truth)."""
+ return
list(_read_global_constants_assignment("ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS"))
+
+
+def read_current_postgres_versions() -> list[str]:
+ """Parse CURRENT_POSTGRES_VERSIONS from global_constants.py (single source
of truth)."""
+ return list(_read_global_constants_assignment("CURRENT_POSTGRES_VERSIONS"))
+
+
+def read_current_mysql_versions() -> list[str]:
+ """The MySQL release versions Airflow currently tests with.
+
+ Mirrors how ``CURRENT_MYSQL_VERSIONS`` is built in global_constants.py: the
+ "old" releases plus the LTS releases, plus an innovation release when one
is
+ configured. Returns the numeric versions only (e.g. ``["8.0", "8.4"]``);
the
+ docs add the textual "Innovation" annotation on top of these.
+ """
+ versions: list[str] =
list(_read_global_constants_assignment("MYSQL_OLD_RELEASES"))
+ versions += list(_read_global_constants_assignment("MYSQL_LTS_RELEASES"))
+ innovation = _read_global_constants_assignment("MYSQL_INNOVATION_RELEASE")
+ if innovation:
Review Comment:
`read_current_mysql_versions()` only checks `MYSQL_INNOVATION_RELEASE`, but
`CURRENT_MYSQL_VERSIONS` is also gated by `USE_MYSQL_INNOVATION_RELEASE` in
`global_constants.py`. If an innovation release is ever configured with that
toggle off, this hook would write a MySQL version into the docs that isn't
actually tested — the exact drift the PR removes. Suggest gating on both:
```python
innovation = _read_global_constants_assignment("MYSQL_INNOVATION_RELEASE")
use_innovation =
_read_global_constants_assignment("USE_MYSQL_INNOVATION_RELEASE")
if innovation and use_innovation:
versions.append(innovation)
```
*Non-blocking.*
--
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]