Skip to content

Show provider version, default setting for durable operators on registry - #76575

Open
amoghrajesh wants to merge 7 commits into
apache:mainfrom
astronomer:registry-additions-for-durable-exec
Open

amoghrajesh wants to merge 7 commits into
apache:mainfrom
astronomer:registry-additions-for-durable-exec

Conversation

@amoghrajesh

@amoghrajesh amoghrajesh commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What

The Registry marks an operator as supporting durable execution, and stops there. A Dag author still cannot tell which provider version they need, or whether the operator ships with durable execution switched off. Both facts are already derivable from the sources the extraction pipeline reads, so nobody should have to open a changelog for them.

Current behaviour

listModules carries one durable field, supports_durable_execution. The /durable/ page shows a badge and a hardcoded sentence in the legend saying durability is "on by default for most, opt-in for the AI agent operators", which has to be edited by hand every time that stops being true.

Proposed change

Three derived fields on each module entry:

Field
durable_gating_provider the provider whose version gates the capability
durable_since_version earliest release of that provider that has it
durable_opt_in true only where the operator declares durable: bool = False, so you have to pass durable=True yourself

Nothing here is declared by a provider maintainer. It is all read from the classes at extraction time.

The extraction also emits durable_mechanism (marker or resumable_mixin) and durable_gating_class, which tell the dating step which file to search. fill_durable_versions.py drops both once it has the version, so they never reach /api/modules.json or the published OpenAPI schema.

The /durable/ page shows the version and the opt-in state as badges beside the existing Durable one, and the hardcoded legend sentence is gone.

Changes of Note

Why a gating provider. Four operators inherit durability from a base class in another provider. EksPodOperator ships in amazon and gets durability from KubernetesPodOperator in cncf-kubernetes, so an amazon version number says nothing about it. Its badge reads cncf-kubernetes 10.20.0+, and the provider name appears only when it differs from the one the module ships in.

How the version is found. One git grep across a provider's release tags returns every release whose copy of the gating class's file contains the mechanism, and the lowest wins. I tried two other alternatives and dropped them.

a) Parsing changelogs gets 6 of 9 providers right: Livy's entry reads "Reconnect to the running Livy batch on retry instead of resubmitting" and never says durable
b) Broader keyword matching hits 2021 entries about reattach_on_restart and dates Kubernetes to 2.0.3. Bisecting with git show per release works but costs seven calls per operator and assumes the capability was added once and kept.

Why the mechanism and not the marker. Dating a marker operator by its __supports_durable_execution declaration reports when it was advertised, not when it worked. KubernetesPodOperator reconnected through task_state_store in 10.20.0 and only declared the marker in 10.21.0. The marker pattern also matches durable: bool, since an operator can take the flag before it moves to task_state_store: AgentOperator had durable in common-ai 0.1.0, keeping its journal in ObjectStorage, and only moved to task_state_store in 0.7.0. Whichever appears first dates it. ResumableJobMixin operators are dated by execute_resumable.

Why durable_opt_in and not the declared default. "On by default" is written two ways: durable: bool = True (PowerBIDatasetRefreshOperator, through ResumableJobMixin) and durable: bool | None = None resolved in __init__ (KubernetesPodOperator). Exposing the raw default would give API readers true and null for the same answer, so the field is a plain bool that is true only for an explicit False.

Why the version lookup runs on the host. Breeze does not mount .git, so a git command inside the container sees nothing. fill_durable_versions.py runs after the container step and breeze registry extract-data drives both. A failed container run stops before the dating step, so it never dates a stale modules.json. A checkout with no providers-* tags leaves durable_since_version null and says so. Any other git failure raises with git's stderr and exits 1.

User implications / backcompat

All three fields default to null or false, so previously generated modules.json from S3 still validates against the contract and the incremental build path is unaffected. No provider API changes.

Re-publishing a wave tagged before this merges would otherwise fail: its merge step validates the S3 catalog, which main has written with the new fields, against the tag's own extra="forbid" contract, and a failed registry step also skips the docs sync. The merge step now runs from the workflow's checkout rather than the tag, the same way make_mnt_writeable.sh already does, so the contract always matches the data in the bucket. Re-publishing an old wave writes that wave's modules without the new fields, and their badges come back on the next publish from main.

Testing and some screenshots

Extraction run through Breeze across cncf-kubernetes, amazon, common-ai, apache-livy
and microsoft-azure (654 modules, 12 durable). Every version below was then checked
against git show <tag>:<file> independently of the new code:

gating provider since
KubernetesPodOperator cncf-kubernetes 10.20.0
EksPodOperator cncf-kubernetes 10.20.0
GlueJobOperator amazon 9.35.0
RedshiftDataOperator amazon 9.33.0
LivyOperator apache-livy 4.6.0
AgentOperator common-ai 0.7.0
MSGraphAsyncOperator microsoft-azure 15.3.0
image image image image

related: #67236


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Comment thread registry/src/durable.njk Resolved
Comment thread dev/registry/fill_durable_versions.py Resolved
Comment thread registry/src/css/main.css Resolved
@amoghrajesh
amoghrajesh requested review from Lee-W and kaxil November 10, 2026 02:10
Comment thread dev/registry/merge_registry_data.py Outdated

providers_payload = validate_providers_catalog({"providers": merged_providers})
modules_payload = validate_modules_catalog({"modules": merged_modules})
modules_payload = validate_extracted_modules_catalog({"modules": merged_modules})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this stay on validate_modules_catalog? In CI, fill_durable_versions.py has already stripped the two internal fields by the time merge runs, so the extracted contract only drops the extra="forbid" check on what we publish, and nothing else calls validate_modules_catalog now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back on validate_modules_catalog. Added a test that merge rejects durable_mechanism and durable_gating_class.

Comment thread dev/registry/extract_parameters.py Resolved
Comment thread dev/registry/fill_durable_versions.py Resolved
@kaxil

kaxil commented Nov 11, 2026

Copy link
Copy Markdown
Member

Could you refresh the PR description before merge? It still describes the first version:

  • The "Five derived fields" table lists durable_mechanism, durable_gating_class and durable_default. What ships now is durable_gating_provider, durable_since_version and durable_opt_in, with the other two stripped before publish.
  • "Why task_state_store and not the marker" doesn't mention that dating now also matches durable: bool, which is what moves AgentOperator to 0.1.0.
  • "Other git failures are silent" is no longer true since they raise and exit 1.

@amoghrajesh

Copy link
Copy Markdown
Contributor Author

@kaxil Updated the description: fields table, the dating section, and git failures.

@amoghrajesh
amoghrajesh requested a review from kaxil November 12, 2026 05:14
@kaxil

kaxil commented Nov 15, 2026

Copy link
Copy Markdown
Member

Do you want to try around the thing we discussed on Slack about a Operators page with filter for various things?

@amoghrajesh

Copy link
Copy Markdown
Contributor Author

Yes, I am on it

@amoghrajesh

Copy link
Copy Markdown
Contributor Author

@kaxil gentle bump on this one. I've addressed the last round: the merge step now runs from the workflow's checkout so older waves can still re-publish, plus the tests you asked for. Mind taking another look when you get a chance?

Heads up: this overlaps with #77143. Happy to rebase whichever lands second and move the badges onto the new Operators page.

Comment thread dev/registry/fill_durable_versions.py Resolved
Comment on lines +41 to +45
DURABLE_SOURCE = "\n".join(
f"class {name}:\n def execute(self, task_state_store):\n return self.execute_resumable()\n"
for name in ("Op", "KubernetesPodOperator")
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DURABLE_SOURCE = "\n".join(
f"class {name}:\n def execute(self, task_state_store):\n return self.execute_resumable()\n"
for name in ("Op", "KubernetesPodOperator")
)
_DURABLE_CLASS_TEMPLATE = textwrap.dedent(
"""\
class {name}:
def execute(self, task_state_store):
return self.execute_resumable()
"""
)
DURABLE_SOURCE = "\n".join(
_DURABLE_CLASS_TEMPLATE.format(name=name) for name in ("Op", "KubernetesPodOperator")
)

I think it's easier to read this way


return _execute_chain_calls_resumable(cls, _MAX_DEFERRAL_WALK_DEPTH)

def _repo_relative_source(cls: type) -> Path | None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _repo_relative_source(cls: type) -> Path | None:
def _find_source_path_in_repo(cls: type) -> Path | None:

return None


def _provider_id_from_source(rel_path: Path) -> str | None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _provider_id_from_source(rel_path: Path) -> str | None:
def _find_provider_id(rel_path: Path) -> str | None:

return first_releases


def durable_group(module: dict) -> tuple[str, str, str, str] | None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def durable_group(module: dict) -> tuple[str, str, str, str] | None:
def find_durable_group(module: dict) -> tuple[str, str, str, str] | None:

also making it a named tuple will be easier to read

class DurableGroup(NamedTuple):
    provider_id: str
    token: str
    source_path: str
    class_name: str

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants