Verified Commit 2fb5ff73 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider
Browse files

chore(gem-dependencies): rubocop 0.84.0 (was 0.83.0)

Using bundler flags:  rubocop 0.84.0 (was 0.83.0)
parent f826c3a4
......@@ -28,3 +28,10 @@ lib/access_import_test/*.xlsx
doc
/.idea
.vscode/
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
include:
- project: gitlab-ci/rails-testing
ref: v1
file: rails-testing.yml
image: git.panter.ch:5001/open-source/aoz-003/gitlab_ci:2.6.6
stages:
......@@ -12,81 +17,35 @@ variables:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/$POSTGRES_DB'
POSTGRES_HOST_AUTH_METHOD: trust
.pull-push-cash:
cache:
key: aoz-003-ruby-2-6-6
paths:
- tmp/cache/ruby
- tmp/cache/yarn
- tmp/cache/webdrivers
policy: pull-push
.pull-cache:
cache:
key: aoz-003-ruby-2-6-6
paths:
- tmp/cache/ruby
- tmp/cache/yarn
- tmp/cache/webdrivers
policy: pull
.test-extend:
stage: test
before_script:
- yarn install --cache-folder tmp/cache/yarn
- bundle config set path 'tmp/cache'
- bundle install
- bundle exec rails db:schema:load
.update_webdrivers: &update_webdrivers |
function update_webdrivers_task() {
if ! [ -f "tmp/cache/webdrivers/chromedriver" ]; then
echo "webdrivers are not cached and thus need to be updated/fetched"
bundle exec rake webdrivers:chromedriver:update
fi
}
.retry-dropped-runners:
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- job_execution_timeout
- scheduler_failure
- stale_schedule
lint:
stage: test
extends:
- .pull-push-cash
- .test-extend
- .cache-pull-push
- .retry-dropped-runners
- .bundle-yarn-install-webdrivers-chrome
script:
# only for having crhomedriver in the cache (this job is the only one pushing the cache)
- *update_webdrivers
- update_webdrivers_task
- bundle exec rails db:schema:load # some RuboCop cops require it
- yarn lint:js
- bundle exec rubocop
- yarn lint:css
- bundle exec rubocop
test:
stage: test
extends:
- .pull-cache
- .test-extend
- .cache-pull
- .retry-dropped-runners
- .bundle-yarn-install
script:
- bundle exec rails db:schema:load
- bundle exec rails test
system:
stage: test
extends:
- .pull-cache
- .test-extend
- .cache-pull
- .retry-dropped-runners
- .bundle-yarn-install-webdrivers-chrome
- .capybara-screenshot-artifacts
script:
- *update_webdrivers
- update_webdrivers_task
- bundle exec rails db:schema:load
- bundle exec rails test:system
artifacts:
paths:
- tmp/screenshots
when: on_failure
expire_in: 1 week
......@@ -16,6 +16,7 @@ AllCops:
- Rakefile
- vendor/**/*
- lib/access_import/**/*
- 'node_modules/**/*'
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: true
......@@ -154,7 +155,8 @@ Layout/LineLength:
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
# elements. Strings will be converted to Regexp objects. A line that matches
# any regular expression listed in this option will be ignored by LineLength.
IgnoredPatterns: []
IgnoredPatterns:
- !ruby/regexp /^\s*\# .*/
Style/Alias:
Enabled: false
......
......@@ -5,7 +5,7 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end
gem 'rails', '>= 5.2.0', '< 6.0.0'
gem 'rails', '>= 6.0.0', '< 6.1.0'
gem 'bootsnap', require: false
gem 'bootstrap-datepicker-rails'
......@@ -47,6 +47,7 @@ gem 'slim-rails'
gem 'sprockets-es6'
gem 'uglifier'
gem 'webdrivers', '~> 4.0'
gem 'webpacker'
gem 'wicked_pdf'
gem 'will-paginate-i18n'
gem 'will_paginate'
......
......@@ -2,53 +2,66 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.3)
actioncable (5.2.4.3)
actionpack (= 5.2.4.3)
actioncable (6.0.3.1)
actionpack (= 6.0.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4.3)
actionpack (= 5.2.4.3)
actionview (= 5.2.4.3)
activejob (= 5.2.4.3)
actionmailbox (6.0.3.1)
actionpack (= 6.0.3.1)
activejob (= 6.0.3.1)
activerecord (= 6.0.3.1)
activestorage (= 6.0.3.1)
activesupport (= 6.0.3.1)
mail (>= 2.7.1)
actionmailer (6.0.3.1)
actionpack (= 6.0.3.1)
actionview (= 6.0.3.1)
activejob (= 6.0.3.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.4.3)
actionview (= 5.2.4.3)
activesupport (= 5.2.4.3)
actionpack (6.0.3.1)
actionview (= 6.0.3.1)
activesupport (= 6.0.3.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.3)
activesupport (= 5.2.4.3)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.3.1)
actionpack (= 6.0.3.1)
activerecord (= 6.0.3.1)
activestorage (= 6.0.3.1)
activesupport (= 6.0.3.1)
nokogiri (>= 1.8.5)
actionview (6.0.3.1)
activesupport (= 6.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.4.3)
activesupport (= 5.2.4.3)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.3.1)
activesupport (= 6.0.3.1)
globalid (>= 0.3.6)
activemodel (5.2.4.3)
activesupport (= 5.2.4.3)
activerecord (5.2.4.3)
activemodel (= 5.2.4.3)
activesupport (= 5.2.4.3)
arel (>= 9.0)
activestorage (5.2.4.3)
actionpack (= 5.2.4.3)
activerecord (= 5.2.4.3)
activemodel (6.0.3.1)
activesupport (= 6.0.3.1)
activerecord (6.0.3.1)
activemodel (= 6.0.3.1)
activesupport (= 6.0.3.1)
activestorage (6.0.3.1)
actionpack (= 6.0.3.1)
activejob (= 6.0.3.1)
activerecord (= 6.0.3.1)
marcel (~> 0.3.1)
activesupport (5.2.4.3)
activesupport (6.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (9.0.0)
ast (2.4.0)
autoprefixer-rails (9.7.6)
execjs
......@@ -172,7 +185,7 @@ GEM
fasterer (0.8.3)
colorize (~> 0.7)
ruby_parser (>= 3.14.1)
ffaker (2.14.0)
ffaker (2.15.0)
ffi (1.12.2)
globalid (0.4.2)
activesupport (>= 4.2.0)
......@@ -286,40 +299,44 @@ GEM
pry (>= 0.10.4)
psych (3.1.0)
public_suffix (4.0.5)
puma (4.3.4)
puma (4.3.5)
nio4r (~> 2.0)
pundit (2.1.0)
activesupport (>= 3.0.0)
rack (2.2.2)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.3)
actioncable (= 5.2.4.3)
actionmailer (= 5.2.4.3)
actionpack (= 5.2.4.3)
actionview (= 5.2.4.3)
activejob (= 5.2.4.3)
activemodel (= 5.2.4.3)
activerecord (= 5.2.4.3)
activestorage (= 5.2.4.3)
activesupport (= 5.2.4.3)
rails (6.0.3.1)
actioncable (= 6.0.3.1)
actionmailbox (= 6.0.3.1)
actionmailer (= 6.0.3.1)
actionpack (= 6.0.3.1)
actiontext (= 6.0.3.1)
actionview (= 6.0.3.1)
activejob (= 6.0.3.1)
activemodel (= 6.0.3.1)
activerecord (= 6.0.3.1)
activestorage (= 6.0.3.1)
activesupport (= 6.0.3.1)
bundler (>= 1.3.0)
railties (= 5.2.4.3)
railties (= 6.0.3.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (5.1.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
railties (5.2.4.3)
actionpack (= 5.2.4.3)
activesupport (= 5.2.4.3)
railties (>= 6.0.0, < 7)
railties (6.0.3.1)
actionpack (= 6.0.3.1)
activesupport (= 6.0.3.1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.1)
......@@ -346,16 +363,19 @@ GEM
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rubocop (0.83.0)
rubocop (0.84.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
rubocop-ast (>= 0.0.3)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.0.3)
parser (>= 2.7.0.1)
rubocop-minitest (0.9.0)
rubocop (>= 0.74)
rubocop-performance (1.5.2)
rubocop-performance (1.6.0)
rubocop (>= 0.71.0)
rubocop-rails (2.5.2)
activesupport
......@@ -383,6 +403,7 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
semantic_range (2.3.0)
sexp_processor (4.14.1)
simple_form (5.0.2)
actionpack (>= 5.0)
......@@ -438,7 +459,12 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
websocket-driver (0.7.1)
webpacker (5.1.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.2)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
wicked_pdf (2.0.2)
......@@ -448,6 +474,7 @@ GEM
wkhtmltopdf-binary (0.12.5.4)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.3.0)
PLATFORMS
ruby
......@@ -502,7 +529,7 @@ DEPENDENCIES
pry-rails
puma
pundit
rails (>= 5.2.0, < 6.0.0)
rails (>= 6.0.0, < 6.1.0)
rails-i18n
ransack
rcodetools
......@@ -525,6 +552,7 @@ DEPENDENCIES
sprockets-es6
uglifier
webdrivers (~> 4.0)
webpacker
wicked_pdf
will-paginate-i18n
will_paginate
......
......@@ -30,7 +30,7 @@ module FilterDropdownHelper
end
def custom_filter_q_arg(filter, multi_qs, value, *excludes)
q_values = search_parameters.merge(multi_qs.map { |q| [q, value.to_s] }.to_h) if multi_qs
q_values = search_parameters.merge(multi_qs.index_with { |_q| value.to_s }) if multi_qs
(q_values || search_parameters).except(*excludes).merge("#{filter}": value.to_s)
end
......
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb
// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)
console.log('Hello World from Webpacker')
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
var isTestEnv = api.env('test')
if (!validEnv.includes(currentEnv)) {
throw new Error(
'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' +
JSON.stringify(currentEnv) +
'.'
)
}
return {
presets: [
isTestEnv && [
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
],
(isProductionEnv || isDevelopmentEnv) && [
'@babel/preset-env',
{
forceAllTransforms: true,
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
]
].filter(Boolean),
plugins: [
'babel-plugin-macros',
'@babel/plugin-syntax-dynamic-import',
isTestEnv && 'babel-plugin-dynamic-import-node',
'@babel/plugin-transform-destructuring',
[
'@babel/plugin-proposal-class-properties',
{
loose: true
}
],
[
'@babel/plugin-proposal-object-rest-spread',
{
useBuiltIns: true
}
],
[
'@babel/plugin-transform-runtime',
{
helpers: false,
regenerator: true,
corejs: false
}
],
[
'@babel/plugin-transform-regenerator',
{
async: false
}
]
].filter(Boolean)
}
}
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
......@@ -9,24 +8,25 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a starting point to setup your application.
FileUtils.chdir APP_ROOT do
# This script is a way to setup or update your development environment automatically.
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
# Install JavaScript dependencies if using Yarn
# Install JavaScript dependencies
# system('bin/yarn')
# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# end
puts "\n== Preparing database =="
system! 'bin/rails db:setup'
system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
......
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/dev_server_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::DevServerRunner.run(ARGV)
end
......@@ -8,14 +8,14 @@ require 'rails/all'
Bundler.require(*Rails.groups)
require 'webdrivers/chromedriver'
Webdrivers.install_dir = 'tmp/cache/webdrivers'
Webdrivers.install_dir = '.ci-cache/webdrivers'
module Aoz
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
config.time_zone = 'Zurich'
config.load_defaults 6.0
config.time_zone = 'Zurich'
config.autoload_paths += Dir[config.root.join('lib/access_import/**/')]
config.autoload_paths += Dir[config.root.join('lib/access_import/accessors/**/')]
WillPaginate.per_page = 20
......
......@@ -2,7 +2,7 @@ development:
adapter: async
test:
adapter: async
adapter: test
production:
adapter: redis
......
......@@ -16,6 +16,7 @@ Rails.application.configure do
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
config.cache_store = :memory_store
config.public_file_server.headers = {
......@@ -30,7 +31,7 @@ Rails.application.configure do
## in order to activate letter_opener uncomment this line
config.action_mailer.delivery_method = :letter_opener_web
# Store uploaded files on the local file system (see config/storage.yml for options)
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Don't care if the mailer can't send.
......@@ -57,7 +58,7 @@ Rails.application.configure do
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations
# Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
......
......@@ -28,15 +28,12 @@ Rails.application.configure do
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
......@@ -44,10 +41,10 @@ Rails.application.configure do