rocketjob_mission_control 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/rocket_job_mission_control/datatable.js.coffee +2 -0
  3. data/app/assets/stylesheets/rocket_job_mission_control/base.scss +19 -7
  4. data/app/controllers/rocket_job_mission_control/dirmon_entries_controller.rb +1 -3
  5. data/app/controllers/rocket_job_mission_control/jobs/index_filters_controller.rb +7 -7
  6. data/app/controllers/rocket_job_mission_control/jobs_controller.rb +1 -0
  7. data/app/datatables/rocket_job_mission_control/jobs_datatable.rb +4 -2
  8. data/app/datatables/rocket_job_mission_control/workers_datatable.rb +1 -1
  9. data/app/interactors/rocket_job_mission_control/dirmon_entries/search.rb +1 -1
  10. data/app/interactors/rocket_job_mission_control/jobs/search.rb +1 -1
  11. data/app/interactors/rocket_job_mission_control/workers/search.rb +1 -1
  12. data/app/models/job_sanitizer.rb +17 -0
  13. data/app/views/layouts/rocket_job_mission_control/application.html.haml +1 -1
  14. data/app/views/layouts/rocket_job_mission_control/partials/_header.html.haml +1 -1
  15. data/app/views/rocket_job_mission_control/jobs/edit.html.haml +5 -5
  16. data/app/views/rocket_job_mission_control/jobs/show.html.haml +4 -3
  17. data/app/views/rocket_job_mission_control/workers/index.html.haml +1 -1
  18. data/app/views/rocket_job_mission_control/workers/index_filters/paused.html.haml +2 -2
  19. data/app/views/rocket_job_mission_control/workers/index_filters/running.html.haml +2 -2
  20. data/app/views/rocket_job_mission_control/workers/index_filters/starting.html.haml +2 -2
  21. data/app/views/rocket_job_mission_control/workers/index_filters/stopping.html.haml +2 -2
  22. data/config/locales/en.yml +10 -10
  23. data/lib/rocket_job_mission_control/version.rb +1 -1
  24. data/spec/controllers/dirmon_entries/index_filters_controller_spec.rb +15 -10
  25. data/spec/controllers/jobs/index_filters_controller_spec.rb +2 -1
  26. data/spec/controllers/jobs_controller_spec.rb +8 -1
  27. data/spec/controllers/workers/index_filters_controller_spec.rb +1 -1
  28. data/spec/dummy/Rakefile +2 -1
  29. data/spec/dummy/config.ru +1 -1
  30. data/spec/dummy/config/application.rb +4 -3
  31. data/spec/dummy/config/environment.rb +3 -3
  32. data/spec/dummy/config/environments/test.rb +20 -22
  33. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  34. data/spec/dummy/config/routes.rb +2 -3
  35. data/spec/dummy/{public/favicon.ico → db/test.sqlite3} +0 -0
  36. data/spec/dummy/log/development.log +0 -0
  37. data/spec/dummy/log/test.log +29861 -2625
  38. data/spec/interactors/jobs/search_spec.rb +35 -0
  39. data/spec/models/job_sanitizer_spec.rb +16 -0
  40. data/spec/rails_helper.rb +1 -3
  41. metadata +13 -44
  42. data/spec/dummy/README.rdoc +0 -28
  43. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  44. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  45. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  46. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  47. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  48. data/spec/dummy/bin/bundle +0 -3
  49. data/spec/dummy/bin/rails +0 -4
  50. data/spec/dummy/bin/rake +0 -4
  51. data/spec/dummy/config/environments/development.rb +0 -34
  52. data/spec/dummy/config/initializers/assets.rb +0 -8
  53. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  54. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  55. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  56. data/spec/dummy/config/initializers/inflections.rb +0 -16
  57. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  58. data/spec/dummy/config/locales/en.yml +0 -23
  59. data/spec/dummy/public/404.html +0 -67
  60. data/spec/dummy/public/422.html +0 -67
  61. data/spec/dummy/public/500.html +0 -66
@@ -0,0 +1,35 @@
1
+ require 'rails_helper'
2
+
3
+ describe RocketJobMissionControl::Jobs::Search do
4
+
5
+ let(:search_term) { "bad[^$" }
6
+ let(:expected_result) { [] }
7
+ let(:search_subset) { spy("query_builder", where: expected_result) }
8
+
9
+ subject { described_class.new(search_term, search_subset) }
10
+
11
+ it 'escapes the search_term' do
12
+ expect(subject.search_term).to eq('bad\\[\\^\\$')
13
+ end
14
+
15
+ describe '#execute' do
16
+ before { subject.execute }
17
+
18
+ describe 'with blank search terms' do
19
+ let(:search_term) { "" }
20
+
21
+ it 'does not search' do
22
+ expect(search_subset).to_not have_received(:where)
23
+ end
24
+ end
25
+
26
+ describe 'with search terms' do
27
+ let(:search_term) { "job[" }
28
+
29
+ it 'searches for the search term' do
30
+ expect(search_subset).to have_received(:where).with({"$or"=>[{:_type=>/job\[/i}, {:description=>/job\[/i}]})
31
+ end
32
+ end
33
+ end
34
+
35
+ end
@@ -0,0 +1,16 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe JobSanitizer do
4
+ describe '#sanitize' do
5
+ it "replaces blank string in log_level with nil" do
6
+ params = { job: { log_level: '' } }
7
+ sanitized = { job: { log_level: nil } }
8
+ expect(JobSanitizer.new(params).sanitize).to eq(sanitized)
9
+ end
10
+
11
+ it "leaves valid log_levels alone" do
12
+ params = { job: { log_level: :warn } }
13
+ expect(JobSanitizer.new(params).sanitize).to eq(params)
14
+ end
15
+ end
16
+ end
@@ -23,7 +23,7 @@ require 'rspec/rails'
23
23
 
24
24
  RSpec.configure do |config|
25
25
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
26
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
26
+ # config.fixture_path = "#{::Rails.root}/spec/fixtures"
27
27
 
28
28
  # If you're not using ActiveRecord, or you'd prefer not to run each of your
29
29
  # examples within a transaction, remove the following line or assign false
@@ -45,5 +45,3 @@ RSpec.configure do |config|
45
45
  # https://relishapp.com/rspec/rspec-rails/docs
46
46
  config.infer_spec_type_from_file_location!
47
47
  end
48
-
49
- DatabaseCleaner.strategy = :truncation
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocketjob_mission_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Cloutier
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-17 00:00:00.000000000 Z
13
+ date: 2016-07-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -191,6 +191,7 @@ files:
191
191
  - app/interactors/rocket_job_mission_control/jobs/search.rb
192
192
  - app/interactors/rocket_job_mission_control/workers/search.rb
193
193
  - app/models/job_failures.rb
194
+ - app/models/job_sanitizer.rb
194
195
  - app/views/layouts/rocket_job_mission_control/application.html.haml
195
196
  - app/views/layouts/rocket_job_mission_control/partials/_header.html.haml
196
197
  - app/views/layouts/rocket_job_mission_control/partials/_sidebar.html.haml
@@ -242,46 +243,30 @@ files:
242
243
  - spec/controllers/jobs_controller_spec.rb
243
244
  - spec/controllers/workers/index_filters_controller_spec.rb
244
245
  - spec/controllers/workers_controller_spec.rb
245
- - spec/dummy/README.rdoc
246
246
  - spec/dummy/Rakefile
247
- - spec/dummy/app/assets/javascripts/application.js
248
- - spec/dummy/app/assets/stylesheets/application.css
249
- - spec/dummy/app/controllers/application_controller.rb
250
- - spec/dummy/app/helpers/application_helper.rb
251
- - spec/dummy/app/views/layouts/application.html.erb
252
- - spec/dummy/bin/bundle
253
- - spec/dummy/bin/rails
254
- - spec/dummy/bin/rake
255
247
  - spec/dummy/config.ru
256
248
  - spec/dummy/config/application.rb
257
249
  - spec/dummy/config/boot.rb
258
250
  - spec/dummy/config/database.yml
259
251
  - spec/dummy/config/environment.rb
260
- - spec/dummy/config/environments/development.rb
261
252
  - spec/dummy/config/environments/test.rb
262
- - spec/dummy/config/initializers/assets.rb
263
- - spec/dummy/config/initializers/backtrace_silencers.rb
264
- - spec/dummy/config/initializers/cookies_serializer.rb
265
- - spec/dummy/config/initializers/filter_parameter_logging.rb
266
- - spec/dummy/config/initializers/inflections.rb
267
- - spec/dummy/config/initializers/mime_types.rb
253
+ - spec/dummy/config/initializers/secret_token.rb
268
254
  - spec/dummy/config/initializers/session_store.rb
269
255
  - spec/dummy/config/initializers/wrap_parameters.rb
270
- - spec/dummy/config/locales/en.yml
271
256
  - spec/dummy/config/mongo.yml
272
257
  - spec/dummy/config/routes.rb
273
258
  - spec/dummy/config/secrets.yml
259
+ - spec/dummy/db/test.sqlite3
260
+ - spec/dummy/log/development.log
274
261
  - spec/dummy/log/test.log
275
- - spec/dummy/public/404.html
276
- - spec/dummy/public/422.html
277
- - spec/dummy/public/500.html
278
- - spec/dummy/public/favicon.ico
279
262
  - spec/helpers/application_helper_spec.rb
280
263
  - spec/helpers/jobs_helper_spec.rb
281
264
  - spec/helpers/pagination_helper_spec.rb
282
265
  - spec/helpers/slices_helper_spec.rb
283
266
  - spec/helpers/workers_helper_spec.rb
267
+ - spec/interactors/jobs/search_spec.rb
284
268
  - spec/models/job_failures_spec.rb
269
+ - spec/models/job_sanitizer_spec.rb
285
270
  - spec/rails_helper.rb
286
271
  - spec/spec_helper.rb
287
272
  - vendor/assets/javascripts/jquery.bootstrap-touchspin.js
@@ -326,45 +311,29 @@ test_files:
326
311
  - spec/controllers/jobs_controller_spec.rb
327
312
  - spec/controllers/workers/index_filters_controller_spec.rb
328
313
  - spec/controllers/workers_controller_spec.rb
329
- - spec/dummy/app/assets/javascripts/application.js
330
- - spec/dummy/app/assets/stylesheets/application.css
331
- - spec/dummy/app/controllers/application_controller.rb
332
- - spec/dummy/app/helpers/application_helper.rb
333
- - spec/dummy/app/views/layouts/application.html.erb
334
- - spec/dummy/bin/bundle
335
- - spec/dummy/bin/rails
336
- - spec/dummy/bin/rake
337
314
  - spec/dummy/config/application.rb
338
315
  - spec/dummy/config/boot.rb
339
316
  - spec/dummy/config/database.yml
340
317
  - spec/dummy/config/environment.rb
341
- - spec/dummy/config/environments/development.rb
342
318
  - spec/dummy/config/environments/test.rb
343
- - spec/dummy/config/initializers/assets.rb
344
- - spec/dummy/config/initializers/backtrace_silencers.rb
345
- - spec/dummy/config/initializers/cookies_serializer.rb
346
- - spec/dummy/config/initializers/filter_parameter_logging.rb
347
- - spec/dummy/config/initializers/inflections.rb
348
- - spec/dummy/config/initializers/mime_types.rb
319
+ - spec/dummy/config/initializers/secret_token.rb
349
320
  - spec/dummy/config/initializers/session_store.rb
350
321
  - spec/dummy/config/initializers/wrap_parameters.rb
351
- - spec/dummy/config/locales/en.yml
352
322
  - spec/dummy/config/mongo.yml
353
323
  - spec/dummy/config/routes.rb
354
324
  - spec/dummy/config/secrets.yml
355
325
  - spec/dummy/config.ru
326
+ - spec/dummy/db/test.sqlite3
327
+ - spec/dummy/log/development.log
356
328
  - spec/dummy/log/test.log
357
- - spec/dummy/public/404.html
358
- - spec/dummy/public/422.html
359
- - spec/dummy/public/500.html
360
- - spec/dummy/public/favicon.ico
361
329
  - spec/dummy/Rakefile
362
- - spec/dummy/README.rdoc
363
330
  - spec/helpers/application_helper_spec.rb
364
331
  - spec/helpers/jobs_helper_spec.rb
365
332
  - spec/helpers/pagination_helper_spec.rb
366
333
  - spec/helpers/slices_helper_spec.rb
367
334
  - spec/helpers/workers_helper_spec.rb
335
+ - spec/interactors/jobs/search_spec.rb
368
336
  - spec/models/job_failures_spec.rb
337
+ - spec/models/job_sanitizer_spec.rb
369
338
  - spec/rails_helper.rb
370
339
  - spec/spec_helper.rb
@@ -1,28 +0,0 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
@@ -1,13 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,5 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
@@ -1,34 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger.
20
- config.active_support.deprecation = :log
21
-
22
- # Debug mode disables concatenation and preprocessing of assets.
23
- # This option may cause significant delays in view rendering with a large
24
- # number of complex assets.
25
- config.assets.debug = true
26
-
27
- # Adds additional error checking when serving assets at runtime.
28
- # Checks for improperly declared sprockets dependencies.
29
- # Raises helpful error messages.
30
- config.assets.raise_runtime_errors = true
31
-
32
- # Raises error for missing translations
33
- # config.action_view.raise_on_missing_translations = true
34
- end
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Precompile additional assets.
7
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
- # Rails.application.config.assets.precompile += %w( search.js )
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
@@ -1,16 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format. Inflections
4
- # are locale specific, and you may define rules for as many different
5
- # locales as you wish. All of these examples are active by default:
6
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- # inflect.irregular 'person', 'people'
10
- # inflect.uncountable %w( fish sheep )
11
- # end
12
-
13
- # These inflection rules are supported but not enabled by default:
14
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
- # inflect.acronym 'RESTful'
16
- # end
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>