Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing on_load trigger for folder-based plugins #15208

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

jedcunningham
Copy link
Member

This is resurrecting #10878 by @maiorBoltach, slightly simplified and with more comprehensive test coverage.

Method 'on_load' should run on plugins initialization, that are located in plugin folder.
Before method was triggered only for plugins in airflow.plugins.* entry points

closes: #10868

:param plugin_instance: subclass of AirflowPlugin
"""
global plugins # pylint: disable=global-statement
plugin_instance.on_load()
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need to check if on_load is present since we already verify the plugin is a subclass of AirflowPlugin.

@github-actions
Copy link

github-actions bot commented Apr 5, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Apr 5, 2021
@mik-laj mik-laj merged commit 97b7780 into apache:master Apr 6, 2021
@jedcunningham jedcunningham deleted the plugin_manager_onload_fix branch April 6, 2021 21:49
@jedcunningham
Copy link
Member Author

@mik-laj, can this be added to the next bugfix milestone (2.0.2 or 2.0.3)? Just want to make sure it doesn't get missed.

@jedcunningham jedcunningham added this to the Airflow 2.0.2 milestone Apr 12, 2021
ashb pushed a commit that referenced this pull request Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:plugins full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on_load method is not working for plugins located in folder
3 participants