Class: Wurk::Preflight::AppScan

Inherits:
Object
  • Object
show all
Defined in:
lib/wurk/preflight/app_scan.rb

Overview

wurk preflight --app rows read from the app's source and bundle, not from Redis: the patterns that carried over from stock Sidekiq and behave differently on Wurk. A text scan, so a row is a place to look, not a verdict.

Constant Summary collapse

SOURCE_DIRS =
%w[app lib config].freeze
MAX_SITES =
20
TIME_FIELD_READ =

Sidekiq 8 and Wurk store these as epoch milliseconds; Sidekiq 7 stored float seconds, and code written against it reads them that way.

/\[['"](?:failed_at|created_at|enqueued_at|retried_at)['"]\]/
FLUSH =
/\b(?:flushdb|flushall)\b/i
PRO_ENT_GUARD =
/defined\?\(\s*(?:::)?Sidekiq::(?:Pro|Enterprise|Ent)\b|Sidekiq\.(?:pro|ent)\?/
RUNNER_COMMAND =
/\b(?:wurk|wurkswarm|sidekiq|sidekiqswarm)\b/
WEB_SERVER_COMMAND =
/\brails\s+(?:s|server)\b|\bpuma\b/
PROCFILES =
%w[Procfile Procfile.dev].freeze
TESTED_PLUGINS =

The upstream versions each plugin's own suite runs green against Wurk (ref: in test/ecosystem//PIN, which preflight_app_scan_test.rb holds this to).

{
  'sentry-sidekiq' => '6.5.0',
  'sidekiq-cron' => '2.4.0',
  'sidekiq-failures' => '1.1.0',
  'sidekiq-unique-jobs' => '8.1.0'
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(root:, report:, specs: ::Gem.loaded_specs) ⇒ AppScan

Returns a new instance of AppScan.



31
32
33
34
35
# File 'lib/wurk/preflight/app_scan.rb', line 31

def initialize(root:, report:, specs: ::Gem.loaded_specs)
  @root = root
  @report = report
  @specs = specs
end

Instance Method Details

#run ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/wurk/preflight/app_scan.rb', line 37

def run
  time_fields
  connection_pool_pin
  rails_error_subscribers
  web_also_runs_workers
  flush_at_boot
  plugin_versions
  pro_ent_guards
end