Skip to content

Add provider class registration checks to provider.yaml validation#64127

Open
potiuk wants to merge 2 commits intoapache:mainfrom
potiuk:add-provider-class-registration-checks
Open

Add provider class registration checks to provider.yaml validation#64127
potiuk wants to merge 2 commits intoapache:mainfrom
potiuk:add-provider-class-registration-checks

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Mar 24, 2026

Add two new checks to run_provider_yaml_files_check.py that verify provider classes
are properly registered in provider.yaml, closing the gap where existing checks only
validated yaml→code (classes listed in YAML exist) but not code→yaml (classes in code
are listed).

New checks

1. Hook conn_type registration check

  • Imports all hook modules, finds BaseHook subclasses that define conn_type directly
  • Verifies the connection type is registered in connection-types
  • Async hooks sharing conn_type with an already-registered sync hook are allowed
  • Skips abstract classes

2. Comprehensive class registration check

  • Walks all provider source files (not just standard directories)
  • Finds concrete subclasses of BaseHook, BaseOperator, BaseSensorOperator,
    BaseTrigger, BaseExecutor, BaseNotifier
  • Verifies modules (or class paths for executors/notifications) are registered
  • Handles class aliases (e.g. send_*_notification = FooNotifier) via id() dedup
  • Handles __init__.py re-exports for executors
  • Skips tests/, example_dags/, decorators/ directories
  • Prints every discovered class with OK/MISSING status for transparency

Verified: 1,571 classes across all providers (936 operators, 307 hooks,
155 triggers, 152 sensors, 13 notifiers, 8 executors).

Also registers the missing LocalKubernetesExecutor in the cncf.kubernetes
provider, found by the new check.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Claude Opus 4.6)

Generated-by: Claude Code (Claude Opus 4.6) following the guidelines

@boring-cyborg boring-cyborg bot added area:dev-tools area:providers backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Mar 24, 2026
potiuk added 2 commits March 24, 2026 07:28
Add two new checks to run_provider_yaml_files_check.py:

1. Check that hook classes defining conn_type are registered in
   connection-types — catches hooks with unique conn_type values that
   are not listed in provider.yaml (async variants sharing conn_type
   with a registered sync hook are allowed).

2. Check that all provider Hook/Operator/Sensor/Trigger/Executor/Notifier
   classes are registered in provider.yaml — walks all provider source
   files, imports them, and verifies every concrete subclass of base
   types has its module (or class path for executors/notifications)
   registered in the appropriate section.

Also register the missing LocalKubernetesExecutor in the cncf.kubernetes
provider.yaml, which was found by the new check.
@potiuk potiuk force-pushed the add-provider-class-registration-checks branch from 842c744 to 8f514ae Compare March 24, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:providers backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants