amoghrajesh commented on code in PR #76575: URL: https://github.com/apache/airflow/pull/76575#discussion_r4520298665
########## dev/registry/fill_durable_versions.py: ########## @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Date each durable module in modules.json against the provider tags that first shipped it. + +Runs on the host rather than in Breeze with the rest of the module extraction, because it reads +the ``providers-<id>/<version>`` git tags and Breeze does not mount ``.git``. + +Usage: + python dev/registry/fill_durable_versions.py --modules dev/registry/modules.json +""" + +from __future__ import annotations + +import argparse +import functools +import json +import subprocess +import sys +from pathlib import Path + +from packaging.version import InvalidVersion, Version + +AIRFLOW_ROOT = Path(__file__).parent.parent.parent + +# What to look for in the gating class's file to date the capability. Both tokens are the +# mechanism itself, not its declaration: KubernetesPodOperator reconnected via task_state_store +# in 10.20.0 but only declared `__supports_durable_execution` for the registry in 10.21.0, and +# dating it by the declaration would report a release later than the behaviour shipped. +DURABLE_TOKENS = { + "marker": "task_state_store", Review Comment: Right on the dates. `durable: bool = False` is in `agent.py` from 0.1.0, `task_state_store` only from 0.7.0. Dating on the signature alone breaks PowerBI though. It inherits `durable` from `ResumableJobMixin`, so `durable: bool` is not in `powerbi.py` and it would date to nothing. Its `execute_resumable` token gives 15.3.0 correctly. So only the `marker` token changed, to `task_state_store|durable: bool` with `git grep -lE`, taking the earliest match of either. `resumable_mixin` is untouched. Re-dated the catalog: AgentOperator and `@task.agent` go 0.7.0 to 0.1.0, the other 10 unchanged. ########## dev/breeze/src/airflow_breeze/commands/registry_commands.py: ########## @@ -145,7 +145,28 @@ def extract_data(python: str, provider: str | None, allow_unreleased: bool): bring_compose_project_down(preserve_volumes=False, shell_params=shell_params) remove_docker_networks([f"{unique_project_name}_default"]) fix_ownership_using_docker() - sys.exit(result.returncode) + if result.returncode: + sys.exit(result.returncode) + + # Dating a durable module needs the providers-* tags, so it runs here rather than beside + # the module extraction in the container. + with ci_group("Dating durable modules"): Review Comment: Both now assert on `call_args_list[0]` instead of the last call. Added two more: the dating step is the last `run_command` with both module paths, and a non-zero exit from it fails the command. 5 pass. -- 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]
