From 460d2f9779bfdccbd25dafd36294d7d371f8c8ef Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Wed, 21 Aug 2019 16:45:36 -0500 Subject: [PATCH] Assert node + dep upgrades --- Gemfile | 2 +- Gemfile.lock | 33 +++++++++++------------- app/models/celery_script_settings_bag.rb | 13 ++++++++++ package.json | 2 +- spec/factories/users.rb | 6 ++--- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Gemfile b/Gemfile index 155bb23d6..c7fe9fbe3 100755 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem "rabbitmq_http_api_client" gem "rack-attack" gem "rack-cors" gem "rails_12factor" -gem "rails" +gem "rails", "5.2.3" # TODO: Upgrade to Rails 6 gem "redis", "~> 4.0" gem "request_store" gem "rollbar" diff --git a/Gemfile.lock b/Gemfile.lock index d177f5462..f8a59244d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,15 +76,15 @@ GEM database_cleaner (1.7.0) declarative (0.0.10) declarative-option (0.1.0) - delayed_job (4.1.7) - activesupport (>= 3.0, < 5.3) - delayed_job_active_record (4.1.3) - activerecord (>= 3.0, < 5.3) + delayed_job (4.1.8) + activesupport (>= 3.0, < 6.1) + delayed_job_active_record (4.1.4) + activerecord (>= 3.0, < 6.1) delayed_job (>= 3.0, < 5) - devise (4.6.2) + devise (4.7.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0, < 6.0) + railties (>= 4.1.0) responders warden (~> 1.2.3) diff-lcs (1.3) @@ -98,8 +98,8 @@ GEM factory_bot_rails (5.0.2) factory_bot (~> 5.0.2) railties (>= 4.2.0) - faker (1.9.6) - i18n (>= 0.7) + faker (2.1.2) + i18n (>= 0.8) faraday (0.15.4) multipart-post (>= 1.2, < 3) faraday_middleware (0.13.1) @@ -108,7 +108,7 @@ GEM railties (>= 3.2, < 6.1) globalid (0.4.2) activesupport (>= 4.2.0) - google-api-client (0.30.7) + google-api-client (0.30.8) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.5, < 0.10.0) httpclient (>= 2.8.1, < 3.0) @@ -120,14 +120,14 @@ GEM google-cloud-env (~> 1.0) google-cloud-env (1.2.0) faraday (~> 0.11) - google-cloud-storage (1.19.0) + google-cloud-storage (1.21.0) addressable (~> 2.5) digest-crc (~> 0.4) google-api-client (~> 0.26) google-cloud-core (~> 1.2) googleauth (>= 0.6.2, < 0.10.0) - mime-types (~> 3.0) - googleauth (0.8.1) + mini_mime (~> 1.0) + googleauth (0.9.0) faraday (~> 0.12) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -151,9 +151,6 @@ GEM mimemagic (~> 0.3.2) memoist (0.16.0) method_source (0.9.2) - mime-types (3.2.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2019.0331) mimemagic (0.3.3) mini_mime (1.0.2) mini_portile2 (2.4.0) @@ -163,7 +160,7 @@ GEM mutations (0.9.0) activesupport nio4r (2.4.0) - nokogiri (1.10.3) + nokogiri (1.10.4) mini_portile2 (~> 2.4.0) orm_adapter (0.5.0) os (1.0.1) @@ -204,7 +201,7 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) + rails-html-sanitizer (1.2.0) loofah (~> 2.2, >= 2.2.2) rails_12factor (0.0.3) rails_serve_static_assets @@ -320,7 +317,7 @@ DEPENDENCIES rabbitmq_http_api_client rack-attack rack-cors - rails + rails (= 5.2.3) rails_12factor redis (~> 4.0) request_store diff --git a/app/models/celery_script_settings_bag.rb b/app/models/celery_script_settings_bag.rb index 1046e4de3..929157f09 100644 --- a/app/models/celery_script_settings_bag.rb +++ b/app/models/celery_script_settings_bag.rb @@ -20,6 +20,7 @@ module CeleryScriptSettingsBag "BoxLed3" => BoxLed, "BoxLed4" => BoxLed } ALLOWED_AXIS = %w(x y z all) + ALLOWED_ASSERTION_TYPES = %w(abort recover abort_recover) ALLOWED_CHANGES = %w(add remove update) ALLOWED_CHANNEL_NAMES = %w(ticker toast email espeak) ALLOWED_LHS_STRINGS = [*(0..69)].map { |x| "pin#{x}" }.concat(%w(x y z)) @@ -45,6 +46,7 @@ module CeleryScriptSettingsBag read_status reboot sync take_photo) ANY_VARIABLE = %i(tool coordinate point identifier) BAD_ALLOWED_PIN_MODES = '"%s" is not a valid pin_mode. Allowed values: %s' + BAD_ASSERTION_TYPE = '"%s" is not a valid assertion type. Try these instead: %s' BAD_AXIS = '"%s" is not a valid axis. Allowed values: %s' BAD_CHANNEL_NAME = '"%s" is not a valid channel_name. Allowed values: %s' BAD_LHS = 'Can not put "%s" into a left hand side (LHS)' \ @@ -94,6 +96,7 @@ module CeleryScriptSettingsBag ALLOWED_OPS: [ALLOWED_OPS, BAD_OP], ALLOWED_PACKAGES: [ALLOWED_PACKAGES, BAD_PACKAGE], ALLOWED_PIN_MODES: [ALLOWED_PIN_MODES, BAD_ALLOWED_PIN_MODES], + ALLOWED_ASSERTION_TYPES: [ALLOWED_ASSERTION_TYPES, BAD_ASSERTION_TYPE], AllowedPinTypes: [ALLOWED_PIN_TYPES, BAD_PIN_TYPE], Color: [Sequence::COLORS, MISC_ENUM_ERR], DataChangeType: [ALLOWED_CHANGES, MISC_ENUM_ERR], @@ -261,6 +264,12 @@ module CeleryScriptSettingsBag resource_type: { defn: [e(:resource_type)], }, + assertion_type: { + defn: [e(:ALLOWED_ASSERTION_TYPES)], + }, + lua: { + defn: [v(:string)], + }, }.map do |(name, conf)| blk = conf[:blk] defn = conf.fetch(:defn) @@ -268,6 +277,10 @@ module CeleryScriptSettingsBag end CORPUS_NODES = { + assertion: { + args: [:assertion_type, :_then, :lua], + tags: [:*], + }, _if: { args: [:lhs, :op, :rhs, :_then, :_else], body: [:pair], diff --git a/package.json b/package.json index 53aadc000..02a93b50b 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "coveralls": "3.0.5", "enzyme": "3.10.0", "enzyme-adapter-react-16": "1.14.0", - "farmbot": "8.0.5", + "farmbot": "8.1.0", "i18next": "17.0.9", "lodash": "4.17.15", "markdown-it": "9.0.1", diff --git a/spec/factories/users.rb b/spec/factories/users.rb index d343ce129..8f209fbed 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -3,9 +3,9 @@ FactoryBot.define do factory :user do device - name { Faker::Name.name } - email { Faker::Internet.email } - password { Faker::Internet.password(8) } + name { Faker::Name.name } + email { Faker::Internet.email } + password { Faker::Internet.password } confirmed_at { Time.now } after(:create) do |user| user.device ||= Devices::Create.run!(user: resp[:user])