Project

General

Profile

Bug #19317

Plugin and dashboard widget registry auto-reloaded

Added by Dominic Cleal over 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Since #18445, the plugin and related classes may be reloaded, losing registrations - probably for plugin registrations, default dashboard widgets, modified menu items, and permissions.

The change to use require_dependency will allow Rails to track the constants and reload them when the source files are modified, discarding the class variable. The use of require_dependency is however required to ensure eager loading doesn't load the file twice (#18445).

The source files may need to be moved to prevent double-loading and to be excluded from autoloading.


Related issues

Related to Foreman - Bug #18445: "Cannot define multiple 'included' blocks" for audit_extensions with eager_load enabledClosed2017-02-09
Related to Foreman - Bug #10927: Resetting dashboard to default widgets adds no widgetsClosed2015-06-25
Related to Katello - Bug #19351: transient test failureClosed2017-04-21
Has duplicate Foreman - Bug #19318: Plugins infrastructure don't work reliably in developmentDuplicate2017-04-19
Has duplicate Katello - Bug #19290: Unable to retrieve API bindings via hammerDuplicate2017-04-17

Associated revisions

Revision 40fffe69 (diff)
Added by Dominic Cleal over 1 year ago

fixes #19317, #10927 - move registries to autoload_once path

Partially reverts 70ce8fe to reinstate autoload_once_paths as the
preferred way to load registry-type objects with class variables
containing data set up during app initialisation (e.g. plugin
registrations, menu items.)

autoload_once is compatible with using require_dependency, which is
preferred to allow Rails to track which constants are loaded, so eager
loading doesn't ever try to load the same file twice (7923c95.)

This moves all registry-type objects to app/registries/ and marks this
path as being autoload_once. The contents of this directory should be
kept at an absolute minimum to ease development.

Revision e74bf5ab (diff)
Added by Dominic Cleal over 1 year ago

refs #19317 - move FiltersHelperOverrides to app/registries/

Uses class to hold state, should be kept in the autoload_once registry
directory.

History

#1 Updated by Dominic Cleal over 1 year ago

  • Related to Bug #18445: "Cannot define multiple 'included' blocks" for audit_extensions with eager_load enabled added

#2 Updated by Tomer Brisker over 1 year ago

  • Related to Bug #10927: Resetting dashboard to default widgets adds no widgets added

#3 Updated by Dominic Cleal over 1 year ago

  • Has duplicate Bug #19318: Plugins infrastructure don't work reliably in development added

#4 Updated by John Mitsch over 1 year ago

  • Has duplicate Bug #19290: Unable to retrieve API bindings via hammer added

#5 Updated by The Foreman Bot over 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4472 added

#6 Updated by Justin Sherrill over 1 year ago

  • Related to Bug #19351: transient test failure added

#7 Updated by Dominic Cleal over 1 year ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#8 Updated by The Foreman Bot over 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/4507 added

#9 Updated by Marek Hulán over 1 year ago

  • Legacy Backlogs Release (now unused) set to 240

Also available in: Atom PDF