You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/05 16:29:14 UTC

[GitHub] [airflow] jedcunningham opened a new pull request #15208: Fix missing on_load trigger for folder-based plugins

jedcunningham opened a new pull request #15208:
URL: https://github.com/apache/airflow/pull/15208


   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


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj merged pull request #15208: Fix missing on_load trigger for folder-based plugins

Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #15208:
URL: https://github.com/apache/airflow/pull/15208


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #15208: Fix missing on_load trigger for folder-based plugins

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #15208:
URL: https://github.com/apache/airflow/pull/15208#issuecomment-813604973


   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.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham commented on a change in pull request #15208: Fix missing on_load trigger for folder-based plugins

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #15208:
URL: https://github.com/apache/airflow/pull/15208#discussion_r607185961



##########
File path: airflow/plugins_manager.py
##########
@@ -184,13 +184,23 @@ def is_valid_plugin(plugin_obj):
     return False
 
 
+def register_plugin(plugin_instance):
+    """
+    Start plugin load and register it after success initialization
+
+    :param plugin_instance: subclass of AirflowPlugin
+    """
+    global plugins  # pylint: disable=global-statement
+    plugin_instance.on_load()

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




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham commented on pull request #15208: Fix missing on_load trigger for folder-based plugins

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #15208:
URL: https://github.com/apache/airflow/pull/15208#issuecomment-814503202


   @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.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org