Skip to content

Commit

Permalink
chore(deps): upgrade rails app (#753)
Browse files Browse the repository at this point in the history
* chore(deps): upgrade myapp to latest rails

prepare for being able to do some real world testing

* chore: fix worker to use no lock_limit
  • Loading branch information
mhenrixon authored Jan 30, 2023
1 parent 67732db commit 8c6da81
Show file tree
Hide file tree
Showing 141 changed files with 6,816 additions and 916 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ tmp/
/myapp/vendor/bundle/
/.bundle/
/.tool-versions
/myapp/yarn-error.log
23 changes: 7 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ inherit_gem:
rubocop-mhenrixon:
- config/default.yml

require:
- rubocop-performance
- rubocop-rake
- rubocop-rspec

AllCops:
NewCops: enable
TargetRubyVersion: 2.7
Expand All @@ -10,17 +15,13 @@ AllCops:
Exclude:
- "**/*.erb"
- "**/*.lua"
- '**/vendor/**/*'
- "**/vendor/**/*"
- "myapp/**/*"
- "bin/bench"

Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Layout/LineLength:
Exclude:
- myapp/db/**/*.rb
- myapp/config/initializers/devise.rb

Layout/LineContinuationLeadingSpace:
Enabled: false

Expand All @@ -44,16 +45,9 @@ Metrics/AbcSize:
Metrics/CyclomaticComplexity:
Max: 7

Metrics/MethodLength:
Max: 13
Exclude:
- myapp/db/**/*.rb
- myapp/config/initializers/devise.rb

Metrics/BlockLength:
Enabled: true
Exclude:
- "myapp/db/**/*.rb"
- "**/spec/**/*.rb"
- "**/*.rake"
- "Rakefile"
Expand All @@ -74,8 +68,6 @@ Naming/FileName:
- lib/sidekiq-unique-jobs.rb
- Gemfile
- Rakefile
- myapp/Gemfile
- myapp/Rakefile

Naming/RescuedExceptionsVariableName:
PreferredName: ex
Expand Down Expand Up @@ -139,7 +131,6 @@ Style/Documentation:
Enabled: true
Exclude:
- "examples/**/*.rb"
- "myapp/**/*.rb"
- "bin/**/*.rb"
- "lib/sidekiq_unique_jobs/testing.rb"
- "lib/sidekiq_unique_jobs/core_ext.rb"
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq_unique_jobs/locksmith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def enqueue(conn)
# @return [nil] when lock was not possible
# @return [Object] whatever the block returns when lock was acquired
#
def primed_async(conn, wait = nil, &block)
def primed_async(conn, wait = nil, &block) # rubocop:disable Metrics/MethodLength
timeout = (wait || config.timeout).to_i
timeout = 1 if timeout.zero?

Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq_unique_jobs/reflections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def initialize
#
# @return [void] <description>
#
def dispatch(reflection, *args)
def dispatch(reflection, *args) # rubocop:disable Metrics/MethodLength
if (block = @reflections[reflection])
block.call(*args)

Expand Down
10 changes: 5 additions & 5 deletions myapp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ APP_WEB_URL=http://localhost:3000
APP_CABLE_URL=ws://localhost:28080
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=
DB_USERNAME=mhenrixon
DB_PASSWORD=
DB_POOL=25
DB_TIMEOUT=5000
DB_REAPING_FREQUENCY=10
REDIS_URL=redis://localhost:6379/7
SECRET_KEY_BASE=10167c7f7654ed02b3557b05b88ece1866a9748a2e8e064016f76cb74ddae38264f7403ba65f301d63c21d770e0ee2ac6906f245e904b3b140d12297f67e0db1
WEB_CONSOLE_WHITELISTED_IPS=127.0.0.1 ::1 127.0.0.0/8 ::1
RAILS_MIN_THREADS=10
RAILS_MAX_THREADS=10
WEB_CONCURRENCY=2
WEB_CONSOLE_WHITELISTED_IPS="127.0.0.1 ::1 127.0.0.0/8"
6 changes: 4 additions & 2 deletions myapp/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ APP_CABLE_URL=ws://localhost:28080
WEB_CONSOLE_WHITELISTED_IPS=127.0.0.1 ::1 127.0.0.0/8 ::1
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=mhenrixon
DB_PASSWORD=
DB_POOL=25
DB_TIMEOUT=5000
DB_REAPING_FREQUENCY=10
RAILS_MIN_THREADS=10
RAILS_MAX_THREADS=10
WEB_CONCURRENCY=1
REDIS_URL=redis://localhost:6379/1
39 changes: 39 additions & 0 deletions myapp/.erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
EnableDefaultLinters: true
glob: "**/*.{html,text,js}{+*,}.erb"
exclude:
- 'vendor/**/*'
- 'node_modules/**/*'
- 'app/views/static/**/*'
linters:
ErbSafety:
enabled: true
FinalNewline:
enabled: true
Rubocop:
enabled: true
rubocop_config:
inherit_from:
- .rubocop.yml
Layout/InitialIndentation:
Enabled: false
Layout/LineLength:
Enabled: false
Layout/TrailingEmptyLines:
Enabled: false
Layout/TrailingWhitespace:
Enabled: false
Naming/FileName:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Rails/OutputSafety:
Enabled: false
Lint/MissingCopEnableDirective:
Enabled: false
Lint/RedundantCopEnableDirective:
Enabled: false
Style/RedundantEach:
Enabled: false
16 changes: 16 additions & 0 deletions myapp/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/app/javascript/controllers/index.js
/.git/
/.bundle/
/.github/
/bin/
/coverage/
/db/
/lib/
/log/
/node_modules/
/public/
/spec/
/storage/
/tmp/
/vendor/bundle/
/vendor/ruby/
Loading

0 comments on commit 8c6da81

Please sign in to comment.