flight_control 2.0.0.beta.1 → 2.0.0.beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -1
  3. data/README.md +23 -0
  4. data/app/assets/config/flight_control_manifest.js +3 -0
  5. data/app/assets/stylesheets/flight_control/application.css +5 -0
  6. data/app/assets/stylesheets/flight_control/bulma.min.css +21013 -0
  7. data/app/assets/stylesheets/flight_control/forms.css +8 -0
  8. data/app/assets/stylesheets/flight_control/jobs.css +42 -0
  9. data/app/controllers/concerns/flight_control/adapter_features.rb +25 -0
  10. data/app/controllers/concerns/flight_control/application_scoped.rb +39 -0
  11. data/app/controllers/concerns/flight_control/basic_authentication.rb +34 -0
  12. data/app/controllers/concerns/flight_control/failed_jobs_bulk_operations.rb +18 -0
  13. data/app/controllers/concerns/flight_control/job_filters.rb +44 -0
  14. data/app/controllers/concerns/flight_control/job_scoped.rb +17 -0
  15. data/app/controllers/concerns/flight_control/not_found_redirections.rb +36 -0
  16. data/app/controllers/concerns/flight_control/queue_scoped.rb +13 -0
  17. data/app/controllers/flight_control/application_controller.rb +35 -0
  18. data/app/controllers/flight_control/bulk_discards_controller.rb +21 -0
  19. data/app/controllers/flight_control/bulk_retries_controller.rb +10 -0
  20. data/app/controllers/flight_control/discards_controller.rb +19 -0
  21. data/app/controllers/flight_control/dispatches_controller.rb +19 -0
  22. data/app/controllers/flight_control/job_launches_controller.rb +28 -0
  23. data/app/controllers/flight_control/jobs_controller.rb +40 -0
  24. data/app/controllers/flight_control/queues/pauses_controller.rb +15 -0
  25. data/app/controllers/flight_control/queues_controller.rb +17 -0
  26. data/app/controllers/flight_control/recurring_tasks_controller.rb +39 -0
  27. data/app/controllers/flight_control/retries_controller.rb +14 -0
  28. data/app/controllers/flight_control/workers_controller.rb +24 -0
  29. data/app/helpers/flight_control/application_helper.rb +12 -0
  30. data/app/helpers/flight_control/dates_helper.rb +30 -0
  31. data/app/helpers/flight_control/interface_helper.rb +23 -0
  32. data/app/helpers/flight_control/jobs_helper.rb +105 -0
  33. data/app/helpers/flight_control/navigation_helper.rb +61 -0
  34. data/app/javascript/flight_control/application.js +3 -0
  35. data/app/javascript/flight_control/controllers/application.js +9 -0
  36. data/app/javascript/flight_control/controllers/form_controller.js +8 -0
  37. data/app/javascript/flight_control/controllers/index.js +11 -0
  38. data/app/javascript/flight_control/controllers/local_time_controller.js +27 -0
  39. data/app/models/flight_control/application_record.rb +5 -0
  40. data/app/models/flight_control/current.rb +3 -0
  41. data/app/models/flight_control/job_launch.rb +75 -0
  42. data/app/models/flight_control/page.rb +49 -0
  43. data/app/models/flight_control/recurring_task.rb +26 -0
  44. data/app/models/flight_control/worker.rb +18 -0
  45. data/app/views/flight_control/job_launches/new.html.erb +53 -0
  46. data/app/views/flight_control/jobs/_date_range_filter.html.erb +11 -0
  47. data/app/views/flight_control/jobs/_error_information.html.erb +24 -0
  48. data/app/views/flight_control/jobs/_filters.html.erb +49 -0
  49. data/app/views/flight_control/jobs/_general_information.html.erb +77 -0
  50. data/app/views/flight_control/jobs/_job.html.erb +13 -0
  51. data/app/views/flight_control/jobs/_jobs_page.html.erb +13 -0
  52. data/app/views/flight_control/jobs/_raw_data.html.erb +4 -0
  53. data/app/views/flight_control/jobs/_title.html.erb +19 -0
  54. data/app/views/flight_control/jobs/_toolbar.html.erb +18 -0
  55. data/app/views/flight_control/jobs/blocked/_actions.html.erb +3 -0
  56. data/app/views/flight_control/jobs/blocked/_job.html.erb +8 -0
  57. data/app/views/flight_control/jobs/failed/_actions.html.erb +5 -0
  58. data/app/views/flight_control/jobs/failed/_backtrace_toggle.html.erb +14 -0
  59. data/app/views/flight_control/jobs/failed/_job.html.erb +8 -0
  60. data/app/views/flight_control/jobs/finished/_job.html.erb +3 -0
  61. data/app/views/flight_control/jobs/in_progress/_job.html.erb +9 -0
  62. data/app/views/flight_control/jobs/index.html.erb +19 -0
  63. data/app/views/flight_control/jobs/scheduled/_actions.html.erb +5 -0
  64. data/app/views/flight_control/jobs/scheduled/_job.html.erb +13 -0
  65. data/app/views/flight_control/jobs/show.html.erb +6 -0
  66. data/app/views/flight_control/queues/_actions.html.erb +7 -0
  67. data/app/views/flight_control/queues/_job.html.erb +15 -0
  68. data/app/views/flight_control/queues/_queue.html.erb +16 -0
  69. data/app/views/flight_control/queues/_queue_title.html.erb +17 -0
  70. data/app/views/flight_control/queues/index.html.erb +21 -0
  71. data/app/views/flight_control/queues/show.html.erb +25 -0
  72. data/app/views/flight_control/recurring_tasks/_actions.html.erb +5 -0
  73. data/app/views/flight_control/recurring_tasks/_general_information.html.erb +37 -0
  74. data/app/views/flight_control/recurring_tasks/_recurring_task.html.erb +22 -0
  75. data/app/views/flight_control/recurring_tasks/_title.html.erb +10 -0
  76. data/app/views/flight_control/recurring_tasks/index.html.erb +18 -0
  77. data/app/views/flight_control/recurring_tasks/show.html.erb +14 -0
  78. data/app/views/flight_control/shared/_job.html.erb +27 -0
  79. data/app/views/flight_control/shared/_jobs.html.erb +14 -0
  80. data/app/views/flight_control/shared/_pagination_toolbar.html.erb +7 -0
  81. data/app/views/flight_control/workers/_configuration.html.erb +6 -0
  82. data/app/views/flight_control/workers/_raw_data.html.erb +6 -0
  83. data/app/views/flight_control/workers/_title.html.erb +11 -0
  84. data/app/views/flight_control/workers/_worker.html.erb +21 -0
  85. data/app/views/flight_control/workers/_workers_page.html.erb +15 -0
  86. data/app/views/flight_control/workers/index.html.erb +6 -0
  87. data/app/views/flight_control/workers/show.html.erb +14 -0
  88. data/app/views/layouts/flight_control/_application_selection.html.erb +14 -0
  89. data/app/views/layouts/flight_control/_flash.html.erb +9 -0
  90. data/app/views/layouts/flight_control/_navigation.html.erb +9 -0
  91. data/app/views/layouts/flight_control/application.html.erb +28 -0
  92. data/app/views/layouts/flight_control/application_selection/_applications.html.erb +13 -0
  93. data/app/views/layouts/flight_control/application_selection/_servers.html.erb +15 -0
  94. data/config/importmap.rb +5 -0
  95. data/config/routes.rb +34 -0
  96. data/lib/active_job/job_proxy.rb +2 -1
  97. data/lib/active_job/jobs_relation.rb +17 -5
  98. data/lib/active_job/queue_adapters/solid_queue_ext.rb +43 -5
  99. data/lib/flight_control/engine.rb +7 -1
  100. data/lib/flight_control/host_route_helpers.rb +34 -0
  101. data/lib/flight_control/version.rb +1 -1
  102. data/lib/flight_control.rb +1 -0
  103. metadata +94 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ad093eeb61f357dc4aead0c094eb413607dfa234cd7cdf4ed15579a0fa0af51
4
- data.tar.gz: a7774ba9273438d984569b4f739795019caaea77d1f1e42b033cd862e0af9231
3
+ metadata.gz: 92136b24112b7e322f86dce0e4bdcfa22e2ebdac86edd8bcecb52f25504ba107
4
+ data.tar.gz: 9c6461eca4e2f2124fd04c6bfe49d11c3a643c0d6cf84c946f86b64f62df5abd
5
5
  SHA512:
6
- metadata.gz: 9ce93746fa317b44831c7fa4d12bca2590d25a76f4eeb375041df08895f326d1e8c25a414d10da06638b0c072c933c84bdbbe338bbf27a04dd77d0e93e8c9324
7
- data.tar.gz: 986514c76126354436fe67b584289a17cf864314f126c9f7c159f1207e48c7dd3816860b82fde3115cc04ecde18e7e483528ae3b93a7d3f8127c2264f89053c5
6
+ metadata.gz: 60039b2a8752a3a0cad44eb15e3bfa11a3a15698c3c235e5e4357843663dd51775e5cadfb798d302a5ff9f298b362b7d7a8745696f207e57db5f68dd6c680355
7
+ data.tar.gz: 85d145d60c4fca2432cddba0703e93db012cc7db50a14790ae0c5f619daf833070fef642c6181dd12243c920901d0bb2f3815ea2221b47247ec7033d8654d9d5
data/CHANGELOG.md CHANGED
@@ -2,7 +2,32 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [2.0.0] - 2026-07-20
5
+ ## [2.0.0.beta.3] - 2026-09-09
6
+
7
+ - Adds back `app/` and `config/` directories to the packaged gem.
8
+
9
+ ## [2.0.0.beta.2] - 2026-09-08
10
+
11
+ Ported from mission_control-jobs (upstream 1.1.0...1.2.0 and later):
12
+
13
+ - Adds `enqueued_at` and `scheduled_at` date-range filters, applied natively by Solid Queue.
14
+ - Adds a `back_to_main_app_path` setting to point the "Back to main app" link somewhere other than the host's root.
15
+ - Routes host-app route helpers used inside the engine through `main_app`, so a base controller redirecting to, say, `new_session_path` keeps working.
16
+ - Loads the engine's stylesheets individually so they also work under Propshaft.
17
+ - Shows the total of pending jobs on the queues page, and how many times a job has been retried.
18
+ - Truncates long job arguments in job lists.
19
+ - Orders failed jobs by when they failed rather than by job id.
20
+ - Submits the job filters on `change` instead of debouncing keystrokes.
21
+ - Swaps only the backtrace when toggling between clean and full.
22
+ - Disables Turbo's prefetching of links on hover.
23
+ - Redirects to the queues index when showing a queue that no longer exists.
24
+ - Shows the raw error when a failed execution's error can't be parsed.
25
+ - Fixes `config.active_job.default_page_size` not being applied.
26
+ - Fixes the "Expires" tooltip of blocked jobs rendering its markup as text.
27
+ - Fixes `JobProxy#duration` when `scheduled_at` isn't set.
28
+ - Avoids N+1 count queries when listing Solid Queue queues.
29
+
30
+ ## [2.0.0.beta.1] - 2026-07-20
6
31
 
7
32
  - Drops support for Resque and Async adapters to focus on Solid Queue.
8
33
  - Drops support for Rails versions below 8.1.
data/README.md CHANGED
@@ -107,6 +107,23 @@ If you do this, you can disable the default HTTP Basic Authentication using the
107
107
  config.flight_control.http_basic_auth_enabled = false
108
108
  ```
109
109
 
110
+ Your base controller's code runs inside the engine, whose route helpers take precedence. Route helpers of your app that Flight Control doesn't define itself, like `new_session_path` from Rails' authentication generator, still work as they are, for example from a `before_action` that redirects to the login page. Helpers that both your app and Flight Control define, like `root_path`, resolve to Flight Control's; use `main_app.root_path` to reach your app's.
111
+
112
+ #### Authentication via route constraints
113
+
114
+ You can also keep authentication out of Flight Control's controllers altogether and restrict access when mounting the engine, using [route constraints](https://guides.rubyonrails.org/routing.html#advanced-constraints). For example, with the sessions created by Rails' authentication generator:
115
+
116
+ ```ruby
117
+ # config/routes.rb
118
+ Rails.application.routes.draw do
119
+ constraints ->(request) { Session.find_by(id: request.cookie_jar.signed[:session_id])&.user&.admin? } do
120
+ mount FlightControl::Engine, at: "/jobs"
121
+ end
122
+ end
123
+ ```
124
+
125
+ Requests that don't satisfy the constraint never reach the engine. As with a custom base controller, disable HTTP Basic Authentication if you don't want both.
126
+
110
127
  ### Other configuration settings
111
128
 
112
129
  Besides `base_controller_class`, you can also set the following for `FlightControl` or `config.flight_control`:
@@ -116,6 +133,7 @@ Besides `base_controller_class`, you can also set the following for `FlightContr
116
133
  - `internal_query_count_limit`: in count queries, the maximum number of records that will be counted if the adapter needs to limit these queries. True counts above this number will be returned as `INFINITY`. This keeps count queries fast—defaults to `500,000`
117
134
  - `scheduled_job_delay_threshold`: the time duration before a scheduled job is considered delayed. Defaults to `1.minute` (a job is considered delayed if it hasn't transitioned from the `scheduled` status 1 minute after the scheduled time).
118
135
  - `show_console_help`: whether to show the console help. If you don't want the console help message, set this to `false`—defaults to `true`.
136
+ - `back_to_main_app_path`: an optional string path for the "Back to main app" link. Example: `'/admin'`. Defaults to the host app's `root_path` when available.
119
137
  - `backtrace_cleaner`: a backtrace cleaner used for optionally filtering backtraces on the Failed Jobs detail page. Defaults to `Rails::BacktraceCleaner.new`. See the [Advanced configuration](#advanced-configuration) section for how to configure/override this setting on a per application/server basis.
120
138
  - `filter_arguments`: an array of strings representing the job argument keys you want to filter out in the UI. This is useful for hiding sensitive user data. Currently, only root-level hash keys are supported.
121
139
 
@@ -223,6 +241,11 @@ ActiveJob.jobs.finished.where(job_class_name: "SomeJob")
223
241
 
224
242
  # All jobs in progress being run by a given worker
225
243
  ActiveJob.jobs.in_progress.where(worker_id: 42)
244
+
245
+ # Filtering by dates takes a range, which can be open on either end
246
+ ActiveJob.jobs.failed.where(enqueued_at: 2.days.ago..)
247
+ ActiveJob.jobs.scheduled.where(scheduled_at: Time.now..1.hour.from_now)
248
+ ActiveJob.jobs.finished.where(finished_at: ..1.week.ago)
226
249
  ```
227
250
 
228
251
  Some examples of bulk operations:
@@ -0,0 +1,3 @@
1
+ //= link_directory ../stylesheets/flight_control .css
2
+ //= link_directory ../../javascript/flight_control .js
3
+ //= link_directory ../../javascript/flight_control/controllers .js
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Application-wide styles. The engine's stylesheets are linked individually from the layout,
3
+ * so that they load regardless of the host app's asset pipeline: Propshaft serves files as
4
+ * they are, without processing Sprockets directives.
5
+ */