Add provider class registration checks to provider.yaml validation#64127
Add provider class registration checks to provider.yaml validation#64127potiuk merged 4 commits intoapache:mainfrom
Conversation
842c744 to
8f514ae
Compare
8f514ae to
e0032a8
Compare
e0032a8 to
768f67a
Compare
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.
768f67a to
cd179f2
Compare
…anagers Extends the provider class registration checks to also cover BaseSecretsBackend, BaseAuthManager, FileTaskHandler (logging), BaseDagBundle, and BaseDBManager subclasses, addressing the gap noted in review. Adds both directions of validation: - yaml-to-code: classes listed in provider.yaml exist and are importable - code-to-yaml: classes in provider code are registered in provider.yaml
- Redis: Fix incorrect module path (missing .log. segment) - HDFS: Add missing logging section for HdfsTaskHandler
Feel free :). Claude is your friend - all ther was entirely Claude generated. |
Backport failed to create: v3-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 3dc0d9e v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
…pache#64127) * Add provider class registration checks to provider.yaml validation 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. * Fix mypy errors: use correct BaseHook import path * Add validation for secrets-backends, auth-managers, logging, and db-managers Extends the provider class registration checks to also cover BaseSecretsBackend, BaseAuthManager, FileTaskHandler (logging), BaseDagBundle, and BaseDBManager subclasses, addressing the gap noted in review. Adds both directions of validation: - yaml-to-code: classes listed in provider.yaml exist and are importable - code-to-yaml: classes in provider code are registered in provider.yaml * Fix provider.yaml logging registration for Redis and HDFS - Redis: Fix incorrect module path (missing .log. segment) - HDFS: Add missing logging section for HdfsTaskHandler
…pache#64127) * Add provider class registration checks to provider.yaml validation 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. * Fix mypy errors: use correct BaseHook import path * Add validation for secrets-backends, auth-managers, logging, and db-managers Extends the provider class registration checks to also cover BaseSecretsBackend, BaseAuthManager, FileTaskHandler (logging), BaseDagBundle, and BaseDBManager subclasses, addressing the gap noted in review. Adds both directions of validation: - yaml-to-code: classes listed in provider.yaml exist and are importable - code-to-yaml: classes in provider code are registered in provider.yaml * Fix provider.yaml logging registration for Redis and HDFS - Redis: Fix incorrect module path (missing .log. segment) - HDFS: Add missing logging section for HdfsTaskHandler
Add two new checks to
run_provider_yaml_files_check.pythat verify provider classesare properly registered in
provider.yaml, closing the gap where existing checks onlyvalidated yaml→code (classes listed in YAML exist) but not code→yaml (classes in code
are listed).
New checks
1. Hook conn_type registration check
BaseHooksubclasses that defineconn_typedirectlyconnection-typesconn_typewith an already-registered sync hook are allowed2. Comprehensive class registration check
BaseHook,BaseOperator,BaseSensorOperator,BaseTrigger,BaseExecutor,BaseNotifiersend_*_notification = FooNotifier) viaid()dedup__init__.pyre-exports for executorstests/,example_dags/,decorators/directoriesVerified: 1,571 classes across all providers (936 operators, 307 hooks,
155 triggers, 152 sensors, 13 notifiers, 8 executors).
Also registers the missing
LocalKubernetesExecutorin thecncf.kubernetesprovider, found by the new check.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 4.6) following the guidelines