Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"permissions": {
"allow": [
"Bash(git add *)",
"Bash(git commit -m ' *)"
"Bash(git commit -m ' *)",
"Bash(git push *)",
"Bash(bundle exec *)"
]
}
}
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Rails engine scaffold with isolated namespace `SolidQueueDashboard`
- Configurable authentication hook (`SolidQueueDashboard.authenticate`)
- Rails engine scaffold with isolated namespace `SolidQueueWeb`
- Configurable authentication hook (`SolidQueueWeb.authenticate`)
- Read-only dashboard with stat cards for ready, scheduled, running, blocked, and failed jobs
- Queues index page showing all queues sorted by name
- Jobs index with status filter tabs (ready, scheduled, claimed, blocked, failed) and per-queue filtering
Expand All @@ -25,5 +25,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- CI workflow with lint (RuboCop) and test (RSpec) matrix across Ruby 3.3, 3.4, and 4.0
- `bin/release` script for versioned gem releases

[Unreleased]: https://github.com/eclectic-coding/solid_queue_dashboard/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/eclectic-coding/solid_queue_dashboard/releases/tag/v0.1.0
[Unreleased]: https://github.com/eclectic-coding/solid_queue_web/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/eclectic-coding/solid_queue_web/releases/tag/v0.1.0
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

# Specify your gem's dependencies in solid_queue_dashboard.gemspec.
# Specify your gem's dependencies in solid_queue_web.gemspec.
gemspec

gem "puma"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
solid_queue_dashboard (0.1.0)
solid_queue_web (0.1.0)
rails (>= 8.1.3)
solid_queue (>= 1.0)

Expand Down Expand Up @@ -296,7 +296,7 @@ DEPENDENCIES
rspec-rails
rubocop-rails-omakase
simplecov
solid_queue_dashboard!
solid_queue_web!
sqlite3

CHECKSUMS
Expand Down Expand Up @@ -386,7 +386,7 @@ CHECKSUMS
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
solid_queue (1.4.0) sha256=e6a18d196f0b27cb6e3c77c5b31258b05fb634f8ed64fb1866ed164047216c2a
solid_queue_dashboard (0.1.0)
solid_queue_web (0.1.0)
sqlite3 (2.9.4-aarch64-linux-gnu) sha256=ecabed721e6eaad54601d2685f09029d90025efc8d931040dc89cb3f8a2080ec
sqlite3 (2.9.4-arm64-darwin) sha256=1d5aad413a815d236e96d43f05a1acc600b6cd086800770342a3f9c2877499ff
sqlite3 (2.9.4-x86_64-linux-gnu) sha256=537a3eda71b1df1336d0055cbebe55a7317c34870c192c7b6b9d8d0be6871847
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SolidQueueDashboard
# SolidQueueWeb

[![Gem Version](https://badge.fury.io/rb/solid_queue_dashboard.svg)](https://rubygems.org/gems/solid_queue_dashboard)
[![Gem Version](https://badge.fury.io/rb/solid_queue_web.svg)](https://rubygems.org/gems/solid_queue_web)

A read-only Rails engine that mounts a monitoring dashboard for [Solid Queue](https://github.com/rails/solid_queue). View queues, inspect jobs by status, and browse failed executions — all without leaving your app.

Expand All @@ -17,7 +17,7 @@ A read-only Rails engine that mounts a monitoring dashboard for [Solid Queue](ht
Add to your application's Gemfile:

```ruby
gem "solid_queue_dashboard"
gem "solid_queue_web"
```

Then run:
Expand All @@ -31,17 +31,17 @@ bundle install
Add to your `config/routes.rb`:

```ruby
mount SolidQueueDashboard::Engine, at: "/jobs"
mount SolidQueueWeb::Engine, at: "/jobs"
```

The dashboard will be available at `/jobs`.

## Authentication

The engine ships with no authentication by default. Add a block to an initializer (e.g. `config/initializers/solid_queue_dashboard.rb`) to protect the dashboard:
The engine ships with no authentication by default. Add a block to an initializer (e.g. `config/initializers/solid_queue_web.rb`) to protect the dashboard:

```ruby
SolidQueueDashboard.authenticate do
SolidQueueWeb.authenticate do
# Called in the context of ApplicationController — use any helper available there.
# Return a truthy value to allow access, falsy to deny (triggers HTTP Basic prompt).
current_user&.admin?
Expand All @@ -58,7 +58,7 @@ HTTP Basic authentication is used as a fallback when the block returns falsy.

## Contributing

Bug reports and pull requests are welcome on [GitHub](https://github.com/eclectic-coding/solid_queue_dashboard).
Bug reports and pull requests are welcome on [GitHub](https://github.com/eclectic-coding/solid_queue_web).

## License

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module SolidQueueDashboard
module SolidQueueWeb
class ApplicationController < ActionController::Base
before_action :authenticate!

private

def authenticate!
return unless (auth = SolidQueueDashboard.authenticate)
return unless (auth = SolidQueueWeb.authenticate)

instance_exec(&auth) || request_basic_auth
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
class DashboardController < ApplicationController
def index
@stats = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
class FailedJobsController < ApplicationController
def index
@failed_jobs = SolidQueue::FailedExecution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
class JobsController < ApplicationController
STATUSES = %w[ready scheduled claimed blocked failed].freeze

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
class QueuesController < ApplicationController
def index
@queues = SolidQueue::Queue.all.sort_by(&:name)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
module ApplicationHelper
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
class ApplicationJob < ActiveJob::Base
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SolidQueueDashboard
module SolidQueueWeb
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Solid Queue Dashboard</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "solid_queue_dashboard/application", media: "all" %>
<%= stylesheet_link_tag "solid_queue_web/application", media: "all" %>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# installed from the root of your application.

ENGINE_ROOT = File.expand_path("..", __dir__)
ENGINE_PATH = File.expand_path("../lib/solid_queue_dashboard/engine", __dir__)
ENGINE_PATH = File.expand_path("../lib/solid_queue_web/engine", __dir__)

# Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
Expand Down
8 changes: 4 additions & 4 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ -z "$VERSION" ]]; then
fi

TAG="v$VERSION"
VERSION_FILE="lib/solid_queue_dashboard/version.rb"
VERSION_FILE="lib/solid_queue_web/version.rb"

# Must be on main
BRANCH=$(git rev-parse --abbrev-ref HEAD)
Expand Down Expand Up @@ -48,7 +48,7 @@ sed -i '' "s/^## \[Unreleased\]$/## [$VERSION] - $TODAY/" CHANGELOG.md
awk "/^## \[$VERSION\]/{print \"## [Unreleased]\n\"; print; next}1" CHANGELOG.md > CHANGELOG.tmp && mv CHANGELOG.tmp CHANGELOG.md
# Update the comparison links at the bottom
sed -i '' \
"s|^\[Unreleased\]:.*|\[Unreleased\]: https://github.com/eclectic-coding/solid_queue_dashboard/compare/$TAG...HEAD\n[$VERSION]: https://github.com/eclectic-coding/solid_queue_dashboard/releases/tag/$TAG|" \
"s|^\[Unreleased\]:.*|\[Unreleased\]: https://github.com/eclectic-coding/solid_queue_web/compare/$TAG...HEAD\n[$VERSION]: https://github.com/eclectic-coding/solid_queue_web/releases/tag/$TAG|" \
CHANGELOG.md

echo "==> Committing release..."
Expand All @@ -63,9 +63,9 @@ git push origin main
git push origin "$TAG"

echo "==> Building gem..."
gem build solid_queue_dashboard.gemspec
gem build solid_queue_web.gemspec

GEM_FILE="solid_queue_dashboard-${VERSION}.gem"
GEM_FILE="solid_queue_web-${VERSION}.gem"

echo ""
echo "Built: $GEM_FILE"
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SolidQueueDashboard::Engine.routes.draw do
SolidQueueWeb::Engine.routes.draw do
root to: "dashboard#index"

resources :queues, only: [ :index ]
Expand Down
7 changes: 0 additions & 7 deletions lib/solid_queue_dashboard/engine.rb

This file was deleted.

3 changes: 0 additions & 3 deletions lib/solid_queue_dashboard/version.rb

This file was deleted.

6 changes: 3 additions & 3 deletions lib/solid_queue_dashboard.rb → lib/solid_queue_web.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "solid_queue_dashboard/version"
require "solid_queue_dashboard/engine"
require "solid_queue_web/version"
require "solid_queue_web/engine"

module SolidQueueDashboard
module SolidQueueWeb
class << self
def authenticate(&block)
@authenticate = block if block_given?
Expand Down
7 changes: 7 additions & 0 deletions lib/solid_queue_web/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "solid_queue"

module SolidQueueWeb
class Engine < ::Rails::Engine
isolate_namespace SolidQueueWeb
end
end
3 changes: 3 additions & 0 deletions lib/solid_queue_web/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module SolidQueueWeb
VERSION = "0.1.0"
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# desc "Explaining what the task does"
# task :solid_queue_dashboard do
# task :solid_queue_web do
# # Task goes here
# end
14 changes: 7 additions & 7 deletions solid_queue_dashboard.gemspec → solid_queue_web.gemspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

require_relative "lib/solid_queue_dashboard/version"
require_relative "lib/solid_queue_web/version"

Gem::Specification.new do |spec|
spec.name = "solid_queue_dashboard"
spec.version = SolidQueueDashboard::VERSION
spec.name = "solid_queue_web"
spec.version = SolidQueueWeb::VERSION
spec.authors = [ "Chuck Smith" ]
spec.email = [ "eclectic-coding@users.noreply.github.com" ]
spec.homepage = "https://github.com/eclectic-coding/solid_queue_dashboard"
spec.homepage = "https://github.com/eclectic-coding/solid_queue_web"
spec.summary = "A read-only Rails engine dashboard for monitoring Solid Queue jobs."
spec.description = "Mount SolidQueueDashboard in any Rails app using Solid Queue to get a " \
spec.description = "Mount SolidQueueWeb in any Rails app using Solid Queue to get a " \
"real-time read-only view of your queues, jobs by status, and failed executions."
spec.license = "MIT"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/eclectic-coding/solid_queue_dashboard"
spec.metadata["changelog_uri"] = "https://github.com/eclectic-coding/solid_queue_dashboard/blob/main/CHANGELOG.md"
spec.metadata["source_code_uri"] = "https://github.com/eclectic-coding/solid_queue_web"
spec.metadata["changelog_uri"] = "https://github.com/eclectic-coding/solid_queue_web/blob/main/CHANGELOG.md"

spec.files = Dir.chdir(File.expand_path(__dir__)) do
Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Rails.application.routes.draw do
mount SolidQueueDashboard::Engine, at: "/jobs"
mount SolidQueueWeb::Engine, at: "/jobs"
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SimpleCov.start "rails" do
add_filter "/spec/"
add_filter "/lib/solid_queue_dashboard/version.rb"
add_filter "/lib/solid_queue_web/version.rb"

add_group "Controllers", "app/controllers"
add_group "Helpers", "app/helpers"
Expand Down