Commit f83f9748 authored by Michael Prilop's avatar Michael Prilop 🌴
Browse files

samarbeid version 1.0

parent c0857a58
Pipeline #474426754 passed with stages
in 4 minutes and 28 seconds
const INLINE_ELEMENTS = require('eslint-plugin-vue/lib/utils/inline-non-void-elements.json')
module.exports = {
extends: [
// add more generic rulesets here, such as:
'standard',
'plugin:vue/recommended'
],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
// quotes: ["error", "double"] // We might want to add this as ONLY exception to aling with ruby standard
'vue/multiline-html-element-content-newline': ['warn', {
ignores: ['pre', 'textarea', 'router-link'].concat(INLINE_ELEMENTS),
ignoreWhenEmpty: true,
allowEmptyLines: false
}]
}
}
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# Ignore uploaded files in development
/storage/*
!/storage/.keep
/public/assets
.byebug_history
# Ignore master key for decrypting credentials and more.
/config/master.key
# Ignore database configuration
/config/database.yml
# RubyMine project files
.idea
# added by webpacker install
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
/coverage/*
# local configuration, see .env.example.*
/.env
/compose.local.yaml
# production data
/data
# vendored dependencies
/vendor/ruby
/vendor/bundle
/vendor/yarn
# generated files
docker/operations/compose.local.yaml
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/ruby/tags/
image: "ruby:3.0.3"
.services-and-setings-for-test-jobs: &services-and-setings-for-test-jobs
services:
- name: docker.elastic.co/elasticsearch/elasticsearch:7.15.0
alias: elasticsearch
command: [ "bin/elasticsearch", "-Ediscovery.type=single-node", "-Expack.security.enabled=false" ] # We have to disable bootstrap checks (i.e. single node mode) because memory settings on our runner are very low
- postgres:13
- name: logicalspark/docker-tikaserver:1.27
alias: apache-tika
- selenium/standalone-chrome:3
# https://github.com/SeleniumHQ/docker-selenium/releases/ rolling 3.x release
variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/samarbeid_test"
POSTGRES_HOST_AUTH_METHOD: trust #Since Feb 2020 postgres docker images require this
DISABLE_DATABASE_ENVIRONMENT_CHECK: "1"
ELASTICSEARCH_URL: "http://elasticsearch:9200"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
TIKA_URL: 'http://apache-tika:9998'
SELENIUM_URL: "http://selenium__standalone-chrome:4444/wd/hub/"
artifacts:
when: always
paths:
- coverage/ # Store test results as artifacts to pass on to later stages (i.e. coverage job)
- tmp/screenshots/ # Store Screenshots of failing Browser tests
# in general all our test jobs may be interrupted (may not be set globally)
interruptible: true
## Global Configuration ##
# Only pull Cache in most jobs
cache:
paths:
- vendor/ruby
- vendor/yarn
- public/assets
- public/packs
- node_modules
policy: pull
before_script:
# Install binaries
- apt-get update -qq
- apt-get install apt-transport-https ca-certificates -qq
- curl -sL https://deb.nodesource.com/setup_14.x | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn bash - > /dev/null
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key add - > /dev/null
- echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list
- apt-get update -qq
- apt-get install nodejs yarn -qq
# Check binary versions
- ruby -v
- node -v
- yarn --version
- gem install bundler --no-doc # Bundler is not installed with the image
- yarn install --frozen-lockfile --cache-folder vendor/yarn # Install yarn/webpacker packages
- bundle config set --local path 'vendor/ruby'
- bundle config set --local jobs 3
- bundle install
stages:
- test
- check
code-style:
stage: check
needs: []
script:
- echo " you might want to run these commands with automatic fix before git commits. You could do so by adding following hook:"
- echo "echo 'bin/fix-code-style' > .git/hooks/pre-commit"
- echo "chmod +x .git/hooks/pre-commit"
- bundle exec standardrb --no-fix
- echo "If it is a false alarm one can disable blocks of code or single lines"
- echo " see https://docs.rubocop.org/rubocop/configuration.html#disabling-cops-within-source-code for details"
- yarn run eslint 'app/**/*.{js,vue}' --max-warnings 0
- echo "If it is a false alarm one can disable blocks of code or single lines"
- echo " see https://eslint.org/docs/2.13.1/user-guide/configuring#disabling-rules-with-inline-comments-1 for details"
unit-and-system-tests:
<<: *services-and-setings-for-test-jobs
needs: []
stage: test
parallel: 4
script:
- bundle exec rake db:setup
# We precompile everything to avoid timeouts and failures when compilation takes to long
- bundle exec rake assets:precompile
- bundle exec rake knapsack:minitest # This automatically uses Gitlabs CI_NODE Variables introduced by parallel keyword
cache:
# We populate cache only from this job as here we bundle/yarn install (as in all jobs) but also generate assets
policy: pull-push
paths:
- vendor/ruby
- vendor/yarn
- public/assets
- public/packs
- node_modules
coverage:
stage: check
needs: ["unit-and-system-tests"]
script:
- bundle exec bin/merge_coverage_reports
coverage: '/LOC \((\d+\.\d+%)\) covered.$/'
artifacts:
name: coverage
expire_in: 31d
paths:
- coverage/index.html
- coverage/assets/
reports:
metrics: test_coverage.txt
pages:
stage: check
needs: ["coverage"]
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
artifacts:
paths:
- public
script:
- bundle exec rake rubycritic
- rm -r public
- mkdir public
- mv tmp/rubycritic/* public/
bundle-audit:
stage: check
needs: []
before_script:
- gem install bundle-audit
script:
- bundle-audit check --update
brakeman-severe:
stage: check
needs: []
before_script:
- export LC_ALL=C.UTF-8
- gem install brakeman
script:
- echo "If it is a false alarm one can disable issues by using 'brakeman --interactive' (leave note why!)"
- brakeman
yarn-audit:
stage: check
needs: []
script:
- echo "If upgrading is not possible (dependency) and Issue is not relevant it may be ignored in '.iyarc' file (leave comment!)."
- echo "This command may fail if an previous ignored CVE is no longer present. It then should be removed from '.iyarc' file."
- yarn run improved-yarn-audit --fail-on-missing-exclusions --retry-on-network-failure --min-severity high
# Ignore File for YARN audit CVEs
# We run our audit with --fail-on-missing-exclusions flag, thus only currently present CVEs may be ignored here.
# PLEASE add a comment line before the ignored CVE and indicate what it's about and why it's okay to ignore!
1007030
# This configuration is here to avoid Reek reporting smells in RubyCritic which are best practices for a Rails project
# See https://github.com/troessner/reek#working-with-rails for details
directories:
"app/controllers":
IrresponsibleModule:
enabled: false
NestedIterators:
max_allowed_nesting: 2
UnusedPrivateMethod:
enabled: false
InstanceVariableAssumption:
enabled: false
"app/helpers":
IrresponsibleModule:
enabled: false
UtilityFunction:
enabled: false
"app/mailers":
IrresponsibleModule:
enabled: false
InstanceVariableAssumption:
enabled: false
"app/models":
IrresponsibleModule:
enabled: false
InstanceVariableAssumption:
enabled: false
"app/jobs":
IrresponsibleModule:
enabled: false
InstanceVariableAssumption:
enabled: false
"app/channels":
IrresponsibleModule:
enabled: false
InstanceVariableAssumption:
enabled: false
ruby-3.0.3
\ No newline at end of file
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby File.read(".ruby-version").strip.delete_prefix("ruby-")
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 6.1.0"
# Use PostgreSQL as the database for Active Record
gem "pg"
# Use Puma as the app server
gem "puma"
# Use SCSS for stylesheets
gem "sassc-rails"
gem "sprockets", "<4"
# Use Uglifier as compressor for JavaScript assets
gem "uglifier", ">= 1.3.0"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem "jbuilder", "~> 2.5"
# Use ActiveStorage variant
gem "image_processing", "~> 1.2"
gem "active_storage_validations"
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.1.0", require: false
# Use Webpack to manage app-like JavaScript modules in Rails
gem "webpacker", "~> 5.x"
# Rails engine that provides an easy-to-use interface for managing your data
gem "rails_admin"
# Simple Has Many (Collection) Widget for RailsAdmin that is much simpler looking than the default has_many association field
gem "rails_admin_simple_has_many", github: "Dietech-Group/rails_admin_simple_has_many"
# Sentry Exception Tracking
gem "sentry-ruby"
gem "sentry-rails"
# Intelligent search made easy with Rails and Elasticsearch
gem "searchkick"
# AASM - State machines for Ruby classes (plain Ruby, ActiveRecord, Mongoid, NoBrainer)
gem "aasm"
# Multithreaded, Postgres-based, ActiveJob backend for Ruby on Rails.
gem "good_job"
# Flexible authentication solution for Rails with Warden.
gem "devise"
# Translations for the devise gem
gem "devise-i18n"
# The authorization Gem for Ruby on Rails.
gem "cancancan"
# Nokogiri (鋸) is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support.
gem "nokogiri"
# This library is intended to provide Ruby with an interface for validating JSON objects against a JSON schema conforming to JSON Schema Draft 4
gem "json-schema"
# Cron jobs in Ruby
gem "whenever"
gem "rails-i18n" # Centralization of locale data collection for Ruby on Rails
group :development, :test do
# Call 'binding.pry' anywhere in the code to stop execution and get a debugger console
gem "awesome_print" # Pretty print your Ruby objects with style -- in full color and with proper indentation
gem "pry-byebug" # Step-by-step debugging and stack navigation in Pry
gem "pry-rails" # Rails >= 3 pry initializer
gem "standard" # Ruby Style Guide, with linter & automatic code fixer
gem "stateoscope" # State Machine Visualizer - use like this: rake 'stateoscope:visualize[Workflow]'
gem "knapsack" # Knapsack splits tests across CI nodes and makes sure that tests will run comparable time on each node.
end
group :development do
# The Listen gem listens to file modifications and notifies you about the changes. Works everywhere!
gem "listen"
gem "binding_of_caller"
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "rubycritic", require: false # A Ruby code quality reporter
gem "rubycritic-small-badge", require: false # Self service small badge for Rubycritic
gem "bullet" # add https://github.com/flyerhzm/bullet as recommended by cancancan upgrade guide.
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem "capybara", ">= 2.15"
gem "selenium-webdriver"
gem "minitest-retry" # Re-run system test when the test fails.
gem "capybara-lockstep" # Synchronize Capybara commands with application JavaScript and AJAX requests -> Avoids a lot of flaky tests
# Group multiple assertions into one block to get results about all of them and not only the first failing. Inspired by rspec aggregate_failures. https://github.com/tjwp/aggregate_assertions
gem "aggregate_assertions"
# A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code.
gem "timecop"
# First gem that allows testing whenever-gem jobs
gem "whenever-test"
gem "simplecov", "~> 0.20.0", require: false # Code Coverage Reports
gem "roo" # For reading and comparing Excel files in Export tests
end
# Simple HTTP and REST client for Ruby, we use it to access Tika Text extraction service
gem "rest-client"
# NewRelic application performance monitoring
gem "newrelic_rpm"
# mail templating
gem "mjml-rails"
# HTML-aware string truncation
gem "truncato"
# xlsx generation with charts, images, automated column width, customizable styles and full schema validation.
gem "caxlsx"
GIT
remote: https://github.com/Dietech-Group/rails_admin_simple_has_many.git
revision: 02b3bd82e6f92ffddd2cbec11f10cecfdbe31520
specs:
rails_admin_simple_has_many (0.0.5)
js-routes (~> 1.2, >= 1.2.4)
rails (>= 4.0, < 7)
GEM
remote: https://rubygems.org/
specs:
aasm (5.2.0)
concurrent-ruby (~> 1.0)
actioncable (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
mail (>= 2.7.1)
actionmailer (6.1.4.6)
actionpack (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activesupport (= 6.1.4.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.6)
actionview (= 6.1.4.6)
activesupport (= 6.1.4.6)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.6)
actionpack (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
nokogiri (>= 1.8.5)
actionview (6.1.4.6)
activesupport (= 6.1.4.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_storage_validations (0.9.6)
activejob (>= 5.2.0)
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
activesupport (>= 5.2.0)
activejob (6.1.4.6)
activesupport (= 6.1.4.6)
globalid (>= 0.3.6)
activemodel (6.1.4.6)
activesupport (= 6.1.4.6)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (6.1.4.6)
activemodel (= 6.1.4.6)
activesupport (= 6.1.4.6)
activestorage (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activesupport (= 6.1.4.6)
marcel (~> 1.0.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
aggregate_assertions (0.1.0)
minitest (~> 5.0)
ast (2.4.2)
awesome_print (1.9.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.16)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.9.3)
msgpack (~> 1.0)
builder (3.2.4)
bullet (6.1.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cancancan (3.3.0)
capybara (3.35.3)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
capybara-lockstep (1.1.0)
activesupport (>= 3.2)
capybara (>= 2.0)
ruby2_keywords
selenium-webdriver (>= 3)
caxlsx (3.1.1)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
childprocess (3.0.0)
chronic (0.10.2)
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.9)
crass (1.0.6)
debug_inspector (1.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.8.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
devise-i18n (1.10.0)
devise (>= 4.8.0)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
elasticsearch (7.13.3)
elasticsearch-api (= 7.13.3)
elasticsearch-transport (= 7.13.3)
elasticsearch-api (7.13.3)
multi_json
elasticsearch-transport (7.13.3)
faraday (~> 1)
multi_json
equalizer (0.0.11)
erubi (1.10.0)
erubis (2.7.0)
et-orbi (1.2.6)
tzinfo
execjs (2.8.1)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
ffi (1.15.4)
flay (2.12.1)
erubis (~> 2.7.0)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
flog (4.6.4)
path_expander (~> 1.0)
ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.8)
fugit (1.5.2)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
globalid (1.0.0)
activesupport (>= 5.0)
good_job (2.9.4)
activejob (>= 5.2.0)
activerecord (>= 5.2.0)
concurrent-ruby (>= 1.0.2)
fugit (>= 1.1)
railties (>= 5.2.0)
thor (>= 0.14.1)
webrick (>= 1.3)
zeitwerk (>= 2.0)
haml (5.2.2)
temple (>= 0.8.0)
tilt
hashie (4.1.0)
htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.4)
domain_name (~> 0.5)
i18n (1.9.1)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
js-routes (1.4.14)
railties (>= 4)
json-schema (2.8.1)
addressable (>= 2.4)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)