v2.1.0: configurable base controller + chart timezone#39
Merged
Conversation
Add SolidQueueMonitor.base_controller_class so host apps can plug the dashboard into their existing auth chain (Devise, Pundit, OmniAuth, custom sessions, etc.) instead of being limited to HTTP Basic. Default is "ActionController::Base", so existing setups behave identically. Engine helpers are wired explicitly via `helper Engine.helpers` so view methods like render_chart keep working when the parent is not ActionController::Base. Chart timezone behavior (already correct via Time.current end-to-end since v2.0) is now pinned by specs running in America/Los_Angeles. Bumps version to 2.1.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SolidQueueMonitor.base_controller_classconfig lets host apps plug the dashboard into their existing auth chain (Devise, Pundit, OmniAuth, custom sessions) instead of being stuck on HTTP Basic.render_chart, etc.) wired explicitly viahelper Engine.helpersso they keep working when the parent is notActionController::Base.Time.currentsince v2.0) now pinned by specs running inAmerica/Los_Angeles.Problem
Single biggest adoption blocker reported after v2.0.0: the engine's
ApplicationControllerhardcodedActionController::Base, so teams with Devise/Pundit/etc. had no clean integration point. Their workaround was monkey-patchingSolidQueueMonitor::ApplicationControllerviato_prepare— fragile and breaks on gem upgrade.Solution
lib/solid_queue_monitor.rb: top-levelbase_controller_classaccessor (default"ActionController::Base"). Top-level rather than insidesetup do |config|because it's a class-loading concern, not a runtime preference — same pattern as Mission Control: Jobs.app/controllers/solid_queue_monitor/application_controller.rb: inherits viaSolidQueueMonitor.base_controller_class.safe_constantize || ActionController::Base.safe_constantizekeeps boot resilient against typos / dev-mode autoload edge cases.helper SolidQueueMonitor::Engine.helpersso view methods likerender_chartkeep resolving regardless of parent class.Changes
lib/solid_queue_monitor.rb— addbase_controller_classaccessor +DEFAULT_BASE_CONTROLLER_CLASSconstant.app/controllers/solid_queue_monitor/application_controller.rb— dynamic parent + explicit engine-helper inclusion.spec/lib/solid_queue_monitor_spec.rb(new) — accessor coverage, parent-class resolution, and a regression guard that asserts engine helpers stay wired.spec/services/solid_queue_monitor/chart_data_service_spec.rb— new context running inAmerica/Los_Angeleswith a frozen UTC time, asserting labels render in PT not UTC.README.md— new "Custom Authentication" subsection (minimal + role-gated examples), commentedbase_controller_classline in the main config block.CHANGELOG.md—[2.1.0] - 2026-05-13entry.lib/solid_queue_monitor/version.rb—2.0.0→2.1.0.Testing
bundle exec rspec— 326 examples, 0 failures (was 315 in v2.0.0; +11 new).bundle exec rubocop— 73 files, no offenses.solid_queue_testhost app:AdminControllerwithbefore_actioncorrectly gates the dashboardrender_chart, etc.) resolve under the custom parentChecklist
style=attrs)[2.1.0]