sidekiq_queue_manager 1.1.0 → 2.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0b811d2bd12bbf0f5ed238d7e9a2f1a48ed6e7034313697cc7d3ea23c136840
4
- data.tar.gz: 127dbcf05fbafdde46f77fab0fb7d4306f560718b34f1b395b9e3d20df704410
3
+ metadata.gz: 3b2640e2b918627c813a711db3487c4261b08f153a4ed3717fa5a6f9eb3811f7
4
+ data.tar.gz: 833e2540f832309dbbd3dd06387ce5b0b92c8ef0a2970638aa6eefe90bc186b2
5
5
  SHA512:
6
- metadata.gz: dff9898513e4b040c8302ed81778e515d90ca401ff9c65eabac31c0caa03171398060e9d39c85a3448d84741f58b4ae1b89be2449e2374526d4a0b3eb70e8468
7
- data.tar.gz: 49831b2810880b5bd5813c73fc28af465b67f8d24550d030320eb2196b0da3f3c31ff5490436bc77e9178aecdd175de23de7b3d29075fbf02d8a6313556bc022
6
+ metadata.gz: 712ae0ef4321710938a3af0295de9983d09d62ea02c73068da3f3a4003d12c131850ff2c74ab78e4cccccc9d5de49be6bbcb723703efba12c4ab1de93464ef58
7
+ data.tar.gz: f72ebc6d34524cad3d7f7a0bbd38d3a873403706b1900bfed6edc438b4e3883afbfa527048ffe0ee9e56b1d3b21c06f82c0a004d9343e6defa1f10995ff09215
data/INSTALLATION.md CHANGED
@@ -22,7 +22,8 @@ Create `config/initializers/sidekiq_queue_manager.rb`:
22
22
 
23
23
  ```ruby
24
24
  SidekiqQueueManager.configure do |config|
25
- # REQUIRED: Set basic auth password (follows Sidekiq Web UI pattern)
25
+ # Enable authentication (recommended for production)
26
+ config.basic_auth_enabled = true
26
27
  config.basic_auth_password = 'your-secure-password-here'
27
28
 
28
29
  # Optional: Protect critical queues
@@ -30,7 +31,7 @@ SidekiqQueueManager.configure do |config|
30
31
  end
31
32
  ```
32
33
 
33
- **⚠️ Professional Standard**: Like Sidekiq Web UI, this gem requires explicit authentication configuration. You must set a password or configure custom authentication.
34
+ **🔒 Security Note**: Authentication is **disabled by default** for easy development setup. **Enable it for production** by setting `basic_auth_enabled = true` and providing a secure password.
34
35
 
35
36
  ### **2. Mount the Engine**
36
37
 
data/README.md CHANGED
@@ -6,28 +6,35 @@
6
6
  [![Sidekiq](https://img.shields.io/badge/Sidekiq-7.0%2B-orange.svg)](https://sidekiq.org)
7
7
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
8
 
9
- **Professional Sidekiq queue monitoring and management interface for Rails applications.**
9
+ **Complete Sidekiq management suite with tabbed interface for queues, scheduled jobs, retries, and dead jobs.**
10
10
 
11
- A modern, real-time web interface for monitoring and managing Sidekiq queues with zero configuration required. Perfect for production environments requiring professional queue monitoring capabilities.
11
+ A modern, real-time web interface for comprehensive Sidekiq management with zero configuration required. Features match and extend the official Sidekiq Web UI with enhanced filtering, smart number formatting, and professional design. Perfect for production environments requiring full-featured job management capabilities.
12
12
 
13
13
  ---
14
14
 
15
15
  ## ✨ Features
16
16
 
17
- ### 🚀 **Real-Time Queue Management**
17
+ ### 🚀 **Complete Sidekiq Management Suite**
18
18
 
19
- - **Live Statistics** - Real-time queue metrics with 5-second auto-refresh
19
+ - **Live Statistics** - Real-time queue metrics with smart number formatting (K, M, B, T)
20
20
  - **Universal Queue Discovery** - Automatically detects ALL Sidekiq queues
21
- - **Pause/Resume Operations** - Individual and bulk queue control
21
+ - **Tabbed Interface** - Organized views for Queues, Scheduled, Retries, and Dead jobs
22
+ - **Scheduled Jobs Management** - View, delete, enqueue, and bulk clear scheduled jobs
23
+ - **Retry Jobs Management** - Retry now, delete, kill, or bulk operations on failed jobs
24
+ - **Dead Jobs Management** - Resurrect, delete permanently, or bulk operations on dead jobs
22
25
  - **Advanced Queue Controls** - Set limits, block queues, manage process limits
23
- - **Job Management** - View, delete, and paginate through individual jobs
26
+ - **Job Management** - View, delete, and paginate through jobs with filtering
24
27
 
25
28
  ### 🎨 **Professional Interface**
26
29
 
27
- - **Modern UI/UX** - Dark-mode optimized responsive design
28
- - **Live Pull Toggle** - Enable/disable real-time updates
29
- - **Custom Modal System** - Professional confirmations and prompts
30
- - **Mobile Responsive** - Optimized for all device sizes
30
+ - **Modern Tabbed UI** - Organized interface with Queues, Scheduled, Retries, and Dead job views
31
+ - **Smart Number Display** - Large numbers automatically formatted (92.9M, 1.2B, 5T) to prevent overflow
32
+ - **Dark-mode Optimized** - Beautiful responsive design that works on all screen sizes
33
+ - **Live Pull Toggle** - Enable/disable real-time updates with visual indicators
34
+ - **Custom Modal System** - Professional confirmations and prompts (no browser alerts)
35
+ - **Advanced Filtering** - Filter jobs by class name across all tabs
36
+ - **Pagination** - Efficient browsing through large job sets
37
+ - **Mobile Responsive** - Optimized layouts for desktop, tablet, and mobile
31
38
  - **Accessibility Ready** - ARIA labels, keyboard navigation, screen reader support
32
39
 
33
40
  ### 🔒 **Enterprise Features**
@@ -149,10 +156,41 @@ end
149
156
 
150
157
  The main dashboard provides:
151
158
 
152
- - **Global Statistics** - Processed, failed, busy, and enqueued job counts
153
- - **Queue Summary** - Total queues, paused queues, and total jobs
154
- - **Live Controls** - Toggle real-time updates and manual refresh
155
- - **Queue Table** - Detailed view of all queues with actions
159
+ - **Enhanced Global Statistics** - Processed, failed, busy, enqueued, scheduled, retry, and dead job counts with smart formatting
160
+ - **Tabbed Interface** - Four main sections: Queues, Scheduled, Retries, and Dead jobs with real-time counts
161
+ - **Live Controls** - Toggle real-time updates and manual refresh with visual indicators
162
+ - **Advanced Filtering** - Filter jobs by class name across all tabs
163
+ - **Responsive Design** - Optimized layouts that prevent number overflow on all screen sizes
164
+
165
+ ### Job Management by Type
166
+
167
+ #### 📅 Scheduled Jobs Tab
168
+
169
+ - **View Scheduled Jobs** - Browse future jobs with execution times and time remaining
170
+ - **Enqueue Now** - Execute scheduled jobs immediately
171
+ - **Delete Jobs** - Remove scheduled jobs before execution
172
+ - **Clear All** - Bulk delete all scheduled jobs (with optional filtering)
173
+ - **Pagination** - Navigate through large lists of scheduled jobs
174
+ - **Filtering** - Filter by job class name for easy searching
175
+
176
+ #### 🔄 Retries Tab
177
+
178
+ - **View Failed Jobs** - See jobs that failed and are awaiting retry
179
+ - **Retry Now** - Execute retry jobs immediately
180
+ - **Kill Jobs** - Move retry jobs to dead queue
181
+ - **Delete Jobs** - Permanently remove retry jobs
182
+ - **Retry All** - Bulk retry all failed jobs (with optional filtering)
183
+ - **Clear All** - Bulk delete all retry jobs (with optional filtering)
184
+ - **Progress Indicators** - Visual progress bars showing retry attempts vs limits
185
+
186
+ #### ☠️ Dead Jobs Tab
187
+
188
+ - **View Dead Jobs** - Browse jobs that have exhausted all retry attempts
189
+ - **Resurrect Jobs** - Move dead jobs back to retry queue
190
+ - **Delete Permanently** - Remove dead jobs forever
191
+ - **Resurrect All** - Bulk resurrect all dead jobs (with optional filtering)
192
+ - **Clear All** - Bulk delete all dead jobs permanently (with optional filtering)
193
+ - **Error Details** - View error messages and stack traces
156
194
 
157
195
  ### Queue Operations
158
196
 
@@ -210,6 +248,36 @@ POST /queues/pause_all # Pause all non-critical queues
210
248
  POST /queues/resume_all # Resume all paused queues
211
249
  ```
212
250
 
251
+ ### Scheduled Jobs Endpoints
252
+
253
+ ```http
254
+ GET /scheduled # List scheduled jobs (paginated, filterable)
255
+ DELETE /scheduled/:id # Delete specific scheduled job
256
+ POST /scheduled/:id/enqueue # Enqueue scheduled job immediately
257
+ POST /scheduled/clear # Clear all scheduled jobs (with optional filter)
258
+ ```
259
+
260
+ ### Retry Jobs Endpoints
261
+
262
+ ```http
263
+ GET /retries # List retry jobs (paginated, filterable)
264
+ POST /retries/:id/retry # Retry specific job immediately
265
+ DELETE /retries/:id # Delete specific retry job
266
+ POST /retries/:id/kill # Kill retry job (move to dead queue)
267
+ POST /retries/retry_all # Retry all jobs (with optional filter)
268
+ POST /retries/clear # Clear all retry jobs (with optional filter)
269
+ ```
270
+
271
+ ### Dead Jobs Endpoints
272
+
273
+ ```http
274
+ GET /dead # List dead jobs (paginated, filterable)
275
+ POST /dead/:id/resurrect # Resurrect dead job to retry queue
276
+ DELETE /dead/:id # Delete dead job permanently
277
+ POST /dead/resurrect_all # Resurrect all dead jobs (with optional filter)
278
+ POST /dead/clear # Clear all dead jobs (with optional filter)
279
+ ```
280
+
213
281
  ### Queue-Specific Endpoints
214
282
 
215
283
  ```http
@@ -241,9 +309,14 @@ GET /live # Server-Sent Events stream for real-time updates
241
309
 
242
310
  ### Production Recommendations
243
311
 
244
- 1. **Authentication Required**
312
+ 1. **Enable Authentication** (disabled by default for development)
245
313
 
246
314
  ```ruby
315
+ # Enable basic auth
316
+ config.basic_auth_enabled = true
317
+ config.basic_auth_password = 'secure-password'
318
+
319
+ # OR use custom authentication
247
320
  config.authentication_method = :authenticate_admin!
248
321
  ```
249
322
 
@@ -314,12 +387,46 @@ The gem works out-of-the-box on Heroku with no additional configuration needed.
314
387
 
315
388
  ### Compatibility
316
389
 
317
- - ✅ **Sidekiq Pro/Enterprise** - Full compatibility
390
+ - ✅ **Sidekiq Web UI Feature Parity** - Matches and extends official Sidekiq Web functionality
391
+ - ✅ **Sidekiq Pro/Enterprise** - Full compatibility with all Sidekiq editions
318
392
  - ✅ **Multi-process Sidekiq** - Advanced process management
319
- - ✅ **Existing Sidekiq setups** - Zero breaking changes
320
- - ✅ **All queue types** - Works with any Sidekiq job
321
- - ✅ **Docker/Kubernetes** - Container-ready
322
- - ✅ **Heroku/Cloud platforms** - Platform-agnostic
393
+ - ✅ **Existing Sidekiq setups** - Zero breaking changes, drop-in replacement
394
+ - ✅ **All job types** - Works with queued, scheduled, retry, and dead jobs
395
+ - ✅ **Docker/Kubernetes** - Container-ready with health checks
396
+ - ✅ **Heroku/Cloud platforms** - Platform-agnostic deployment
397
+
398
+ ---
399
+
400
+ ## 📝 Changelog
401
+
402
+ ### Version 1.1.0 (Latest)
403
+
404
+ 🎉 **Major Feature Release - Complete Sidekiq Management Suite**
405
+
406
+ **New Features:**
407
+ - ✨ **Tabbed Interface** - Organized views for Queues, Scheduled, Retries, and Dead jobs
408
+ - 📅 **Scheduled Jobs Management** - View, delete, enqueue immediately, and bulk operations
409
+ - 🔄 **Retry Jobs Management** - Retry now, delete, kill, and bulk operations with progress indicators
410
+ - ☠️ **Dead Jobs Management** - Resurrect, delete permanently, and bulk operations
411
+ - 📊 **Enhanced Statistics** - Added scheduled, retry, and dead job counts to main dashboard
412
+ - 🔢 **Smart Number Formatting** - Large numbers automatically formatted (92.9M, 1.2B, 5T) to prevent overflow
413
+ - 🔍 **Advanced Filtering** - Filter jobs by class name across all tabs
414
+ - 📄 **Pagination** - Efficient browsing through large job sets
415
+ - 💬 **Custom Modals** - Professional confirmation dialogs (no browser alerts)
416
+
417
+ **API Enhancements:**
418
+ - 🚀 **18 New REST Endpoints** - Complete API coverage for scheduled, retry, and dead jobs
419
+ - 📡 **Real-time Tab Counts** - Live updates for all job type counts
420
+ - 🎯 **Enhanced Error Handling** - Comprehensive error responses and validation
421
+
422
+ **UI/UX Improvements:**
423
+ - 📱 **Responsive Grid System** - Optimized 7-card stats layout that prevents overflow
424
+ - 🎨 **Enhanced Visual Design** - Progress bars, status indicators, and improved typography
425
+ - ⚡ **Performance Optimized** - Efficient loading and rendering of large job lists
426
+
427
+ **Backward Compatibility:**
428
+ - ✅ **Zero Breaking Changes** - All existing functionality preserved
429
+ - 🔄 **Seamless Upgrade** - Drop-in replacement for previous versions
323
430
 
324
431
  ---
325
432
 
@@ -373,4 +480,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
373
480
  **Created and maintained by [Jamal Awad](https://github.com/jamalawd)**
374
481
  *Ruby enthusiast, tech lead, & architect passionate about open-source development*
375
482
 
376
- *Transform your Sidekiq monitoring experience with professional-grade queue management.*
483
+ *Transform your Sidekiq experience with comprehensive job management - queues, scheduled jobs, retries, and dead jobs in one professional interface.*
@@ -179,12 +179,21 @@ module SidekiqQueueManager
179
179
 
180
180
  # Get the mount path from the engine's routes
181
181
  def engine_mount_path
182
- # Extract mount path from the current request path
183
- if request.path =~ %r{^(/[^/]+)}
184
- Regexp.last_match(1)
185
- else
186
- '/sidekiq_manager' # Default fallback
182
+ # Look through Rails routes for engine mounts
183
+ Rails.application.routes.routes.each do |route|
184
+ next unless route.respond_to?(:app)
185
+ next unless route.app.respond_to?(:app)
186
+
187
+ # Check if this route's app is our engine
188
+ if route.app.app == SidekiqQueueManager::Engine
189
+ path_spec = route.path.spec.to_s
190
+ return path_spec.gsub(/\(\.:format\)$/, '').chomp('/')
191
+ end
187
192
  end
193
+
194
+ nil
195
+ rescue StandardError
196
+ nil
188
197
  end
189
198
 
190
199
  # Common helper for accessing main application methods
@@ -14,16 +14,19 @@ module SidekiqQueueManager
14
14
  # Internal options (sensible defaults, not typically user-configured)
15
15
  attr_reader :redis_key_prefix, :redis_timeout, :log_level, :enable_csp, :cache_ttl
16
16
 
17
+ # Track whether user has explicitly configured the gem
18
+ attr_reader :explicitly_configured
19
+
17
20
  def initialize
18
21
  # Essential defaults (what most users care about)
19
22
  @authentication_method = nil # Custom auth method (optional)
20
23
  @critical_queues = [] # No protected queues by default
21
24
  @theme = 'auto' # Auto light/dark theme
22
25
 
23
- # Basic HTTP Authentication (professional standard - explicit configuration required)
24
- @basic_auth_enabled = true # Secure by default like Sidekiq Web UI
26
+ # Basic HTTP Authentication - safer defaults for gem installation
27
+ @basic_auth_enabled = false # Disabled by default - user must opt-in
25
28
  @basic_auth_username = 'admin' # Standard admin username
26
- @basic_auth_password = nil # MUST be explicitly set by user
29
+ @basic_auth_password = nil # MUST be explicitly set by user when enabled
27
30
 
28
31
  # Advanced defaults (rarely changed)
29
32
  @refresh_interval = 5000 # 5 second UI refresh
@@ -37,18 +40,33 @@ module SidekiqQueueManager
37
40
  @log_level = :info # Standard logging level
38
41
  @enable_csp = true # Security headers enabled
39
42
  @cache_ttl = 300 # 5 minute cache TTL
43
+
44
+ # Track explicit configuration
45
+ @explicitly_configured = false
46
+ end
47
+
48
+ # Mark that user has explicitly configured the gem
49
+ def mark_as_configured!
50
+ @explicitly_configured = true
40
51
  end
41
52
 
42
53
  # Validate essential user-provided configuration
43
- def validate!
54
+ def validate!(skip_auth_unless_configured: false)
44
55
  validate_basic_settings!
45
- validate_authentication!
56
+
57
+ # Only validate authentication if explicitly configured or forced
58
+ if skip_auth_unless_configured && !@explicitly_configured
59
+ Rails.logger.debug '[SidekiqQueueManager] Skipping authentication validation - not explicitly configured'
60
+ else
61
+ validate_authentication!
62
+ end
63
+
46
64
  self # Return self for method chaining (Ruby idiom)
47
65
  end
48
66
 
49
67
  # Check if configuration is valid without raising (Ruby's truthiness approach)
50
- def valid?
51
- validate!
68
+ def valid?(skip_auth_unless_configured: false)
69
+ validate!(skip_auth_unless_configured: skip_auth_unless_configured)
52
70
  true
53
71
  rescue ConfigurationError
54
72
  false
@@ -88,8 +88,16 @@ module SidekiqQueueManager
88
88
  # Dependency validation with Ruby's case pattern matching
89
89
  def validate_and_configure!
90
90
  SidekiqQueueManager.validate_dependencies!
91
- SidekiqQueueManager.configuration.validate!
92
- Rails.logger.info '[SidekiqQueueManager] Configuration validated successfully'
91
+
92
+ # Skip authentication validation during startup unless explicitly configured
93
+ # This prevents crashes when gem is just added to Gemfile without configuration
94
+ SidekiqQueueManager.configuration.validate!(skip_auth_unless_configured: true)
95
+
96
+ if SidekiqQueueManager.configuration.explicitly_configured
97
+ Rails.logger.info '[SidekiqQueueManager] Configuration validated successfully'
98
+ else
99
+ Rails.logger.info '[SidekiqQueueManager] Engine loaded - authentication validation deferred until first access'
100
+ end
93
101
  end
94
102
 
95
103
  def handle_configuration_error(error)
@@ -7,6 +7,6 @@ module SidekiqQueueManager
7
7
  # - MAJOR: Incompatible API changes
8
8
  # - MINOR: Add functionality in backward compatible manner
9
9
  # - PATCH: Backward compatible bug fixes
10
- VERSION = '1.1.0'
10
+ VERSION = '2.0.0'
11
11
  end
12
12
 
@@ -59,8 +59,11 @@ module SidekiqQueueManager
59
59
  # @yield [Configuration] the configuration instance
60
60
  # @return [Configuration] the updated configuration
61
61
  def configure
62
- yield(configuration) if block_given?
63
- configuration.tap(&:validate!) # Ruby idiom: tap for side effects
62
+ return configuration unless block_given?
63
+
64
+ yield(configuration)
65
+ configuration.mark_as_configured! # Mark as explicitly configured
66
+ configuration.tap(&:validate!) # Ruby idiom: tap for side effects - full validation when explicitly configured
64
67
  end
65
68
 
66
69
  # Resets configuration to defaults (primarily for testing)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_queue_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamal Awad