diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index dd90c3f862444..c969675d96977 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -301,20 +301,16 @@ jobs: --hook-stage manual upgrade-important-versions || true if: always() env: - UPGRADE_UV: "true" UPGRADE_PIP: "false" UPGRADE_PYTHON: "false" UPGRADE_GOLANG: "false" - UPGRADE_PREK: "true" UPGRADE_NODE_LTS: "false" UPGRADE_HATCH: "false" UPGRADE_PYYAML: "false" UPGRADE_GITPYTHON: "false" UPGRADE_RICH: "false" UPGRADE_RUFF: "false" - UPGRADE_MPROCS: "true" UPGRADE_MYPY: "false" - UPGRADE_PROTOC: "false" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "Run automated upgrade for important versions minus uv (failing if needed)" run: | @@ -328,19 +324,10 @@ jobs: if: always() env: UPGRADE_UV: "false" - UPGRADE_PIP: "true" - UPGRADE_PYTHON: "true" - UPGRADE_GOLANG: "true" UPGRADE_PREK: "false" - UPGRADE_NODE_LTS: "true" - UPGRADE_HATCH: "true" - UPGRADE_PYYAML: "true" - UPGRADE_GITPYTHON: "true" - UPGRADE_RICH: "true" - UPGRADE_RUFF: "true" - UPGRADE_MYPY: "true" UPGRADE_MPROCS: "false" UPGRADE_PROTOC: "false" + UPGRADE_OPENAPI_GENERATOR: "false" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test-airflow-release-commands: diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py index e301074f06f58..55fa83f1ae82c 100644 --- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py @@ -3335,7 +3335,7 @@ def split_date_version_and_suffix(file_name: str, suffix: str) -> VersionedFile: AIRFLOW_ROOT_PATH / "airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml" ) TARGET_API_YAML_PATH = PYTHON_CLIENT_DIR_PATH / "v2.yaml" -OPENAPI_GENERATOR_CLI_VER = "7.13.0" +OPENAPI_GENERATOR_CLI_VER = "7.18.0" GENERATED_CLIENT_DIRECTORIES_TO_COPY: list[Path] = [ Path("airflow_client") / "client", diff --git a/scripts/ci/prek/upgrade_important_versions.py b/scripts/ci/prek/upgrade_important_versions.py index 0c425a11c49e9..8ecb5af1b7ee5 100755 --- a/scripts/ci/prek/upgrade_important_versions.py +++ b/scripts/ci/prek/upgrade_important_versions.py @@ -290,6 +290,19 @@ def get_latest_github_release_version(repo: str) -> str: return version +def get_latest_openapi_generator_version() -> str: + if not UPGRADE_OPENAPI_GENERATOR: + return "" + if VERBOSE: + console.print("[bright_blue]Fetching latest OpenAPI generator version from GitHub") + url = "https://api.github.com/repos/OpenAPITools/openapi-generator/releases/latest" + headers = {"User-Agent": "Python requests"} + response = requests.get(url, headers=headers) + response.raise_for_status() + data = response.json() + return data["tag_name"].lstrip("v") + + class Quoting(Enum): UNQUOTED = 0 SINGLE_QUOTED = 1 @@ -408,6 +421,7 @@ def get_env_bool(name: str, default: bool = True) -> bool: UPGRADE_UV: bool = get_env_bool("UPGRADE_UV") UPGRADE_MYPY: bool = get_env_bool("UPGRADE_MYPY") UPGRADE_PROTOC: bool = get_env_bool("UPGRADE_PROTOC") +UPGRADE_OPENAPI_GENERATOR: bool = get_env_bool("UPGRADE_OPENAPI_GENERATOR") ALL_PYTHON_MAJOR_MINOR_VERSIONS = ["3.10", "3.11", "3.12", "3.13"] DEFAULT_PROD_IMAGE_PYTHON_VERSION = "3.12" @@ -500,6 +514,9 @@ def apply_pattern_replacements( "mprocs": [ (r"(ARG MPROCS_VERSION=)(\"[0-9.]+\")", 'ARG MPROCS_VERSION="{version}"'), ], + "openapi_generator": [ + (r"(OPENAPI_GENERATOR_CLI_VER = )(\"[0-9.]+\")", 'OPENAPI_GENERATOR_CLI_VER = "{version}"'), + ], } @@ -529,6 +546,7 @@ def fetch_all_package_versions() -> dict[str, str]: "node_lts": get_latest_lts_node_version() if UPGRADE_NODE_LTS else "", "protoc": get_latest_image_version("rvolosatovs/protoc") if UPGRADE_PROTOC else "", "mprocs": get_latest_github_release_version("pvolok/mprocs") if UPGRADE_MPROCS else "", + "openapi_generator": get_latest_openapi_generator_version() if UPGRADE_OPENAPI_GENERATOR else "", }