Module: RoundhouseUi

Defined in:
lib/roundhouse_ui.rb,
lib/roundhouse_ui/audit.rb,
lib/roundhouse_ui/fetch.rb,
lib/roundhouse_ui/pause.rb,
lib/roundhouse_ui/engine.rb,
lib/roundhouse_ui/metrics.rb,
lib/roundhouse_ui/version.rb,
lib/roundhouse_ui/redaction.rb,
lib/roundhouse_ui/snapshots.rb,
lib/roundhouse_ui/cancellation.rb,
lib/roundhouse_ui/observability.rb,
lib/roundhouse_ui/cancel_middleware.rb,
app/helpers/roundhouse_ui/nav_helper.rb,
app/helpers/roundhouse_ui/application_helper.rb,
app/controllers/roundhouse_ui/busy_controller.rb,
app/controllers/roundhouse_ui/dead_controller.rb,
app/controllers/roundhouse_ui/jobs_controller.rb,
app/controllers/roundhouse_ui/audit_controller.rb,
app/controllers/roundhouse_ui/redis_controller.rb,
app/helpers/roundhouse_ui/observability_helper.rb,
app/controllers/roundhouse_ui/assets_controller.rb,
app/controllers/roundhouse_ui/errors_controller.rb,
app/controllers/roundhouse_ui/queues_controller.rb,
app/controllers/roundhouse_ui/metrics_controller.rb,
app/controllers/roundhouse_ui/retries_controller.rb,
app/controllers/roundhouse_ui/workers_controller.rb,
app/controllers/roundhouse_ui/capsules_controller.rb,
app/controllers/roundhouse_ui/dashboard_controller.rb,
app/controllers/roundhouse_ui/scheduled_controller.rb,
app/controllers/roundhouse_ui/snapshots_controller.rb,
app/controllers/roundhouse_ui/application_controller.rb,
app/controllers/concerns/roundhouse_ui/job_set_browsing.rb

Overview

Brand name is "Roundhouse"; the gem and Ruby namespace are RoundhouseUi (matching the published gem name roundhouse_ui).

Defined Under Namespace

Modules: ApplicationHelper, Audit, Cancellation, JobSetBrowsing, NavHelper, Observability, ObservabilityHelper, Pause, Redaction, Snapshots Classes: ApplicationController, AssetsController, AuditController, BusyController, CancelMiddleware, CapsulesController, DashboardController, DeadController, Engine, ErrorsController, Fetch, JobsController, Metrics, MetricsController, QueuesController, RedisController, RetriesController, ScheduledController, SnapshotsController, WorkersController

Constant Summary collapse

VERSION =
"0.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.actor_resolverObject

How the audit log names the person taking an action. Auth is the host's job, so give Roundhouse a callable that pulls the actor from the request:

RoundhouseUi.actor_resolver = ->(controller) { controller.current_user&.email }

Defaults to "anonymous".



44
45
46
# File 'lib/roundhouse_ui.rb', line 44

def actor_resolver
  @actor_resolver
end

.allow_job_editingObject

Opt-in: enqueue brand-new jobs and edit/re-enqueue existing ones from the UI. Off by default — it's a sharp tool (bad edits create unrunnable jobs).



48
49
50
# File 'lib/roundhouse_ui.rb', line 48

def allow_job_editing
  @allow_job_editing
end

.observabilityObject



34
35
36
# File 'lib/roundhouse_ui.rb', line 34

def observability
  @observability ||= Observability::NullAdapter.new
end

.read_onlyObject

When true, destructive actions (purge, retry, delete, …) are disabled. Mount Roundhouse read-only where operators should only observe.



20
21
22
# File 'lib/roundhouse_ui.rb', line 20

def read_only
  @read_only
end

.redact_argsObject

Argument keys (substring, case-insensitive) to mask when displaying jobs. e.g. RoundhouseUi.redact_args = %w[password token secret]. Default: none.



52
53
54
# File 'lib/roundhouse_ui.rb', line 52

def redact_args
  @redact_args
end

.snapshot_storeObject



26
27
28
# File 'lib/roundhouse_ui.rb', line 26

def snapshot_store
  @snapshot_store ||= Snapshots::RedisStore.new
end

Class Method Details

.cancelled?(jid) ⇒ Boolean

Cooperative cancellation check for long-running jobs:

raise SomeStop if RoundhouseUi.cancelled?(jid)

Returns:

  • (Boolean)


65
66
67
# File 'lib/roundhouse_ui.rb', line 65

def cancelled?(jid)
  Cancellation.cancelled?(jid)
end

.configure {|_self| ... } ⇒ Object

Configure in an initializer:

RoundhouseUi.configure do |c|
c.read_only = !Rails.env.development?
end

Yields:

  • (_self)

Yield Parameters:

  • _self (RoundhouseUi)

    the object that the method was called on



59
60
61
# File 'lib/roundhouse_ui.rb', line 59

def configure
  yield self
end