Commit 7ed88b53 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider

Merge branch 'deploy_develop_to_production' into 'main'

Deploy develop to production

See merge request !1078
parents ad8cb308 ebd24496
Pipeline #89640 passed with stages
in 20 minutes and 24 seconds
......@@ -36,3 +36,4 @@ storage/
/yarn-error.log
yarn-debug.log*
.yarn-integrity
coverage
......@@ -7,22 +7,29 @@ image: git.panter.ch:5001/open-source/aoz-003/gitlab_ci:2.6.6
stages:
- test
- deploy
services:
- postgres:9.6
variables:
RAILS_ENV: test
POSTGRES_DB: aoz_test
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/$POSTGRES_DB'
POSTGRES_HOST_AUTH_METHOD: trust
.test-job-extends:
services:
- postgres:9.6
variables:
RAILS_ENV: test
POSTGRES_DB: aoz_test
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/$POSTGRES_DB'
POSTGRES_HOST_AUTH_METHOD: trust
artifacts:
paths:
- 'coverage/'
expire_in: 30 days
reports:
junit: coverage/coverage.xml
lint:
stage: test
extends:
- .cache-pull-push
- .retry-dropped-runners
- .bundle-yarn-install-webdrivers-chrome
- .test-job-extends
script:
- bundle exec rails db:schema:load # some RuboCop cops require it
- yarn lint:js
......@@ -35,17 +42,40 @@ test:
- .cache-pull
- .retry-dropped-runners
- .bundle-yarn-install
- .test-job-extends
script:
- bundle exec rails db:schema:load
- bundle exec rails test
system:
stage: test
retry: 1
variables:
TEST_TYPE: ':system'
extends:
- .cache-pull
- .retry-dropped-runners
- .bundle-yarn-install-webdrivers-chrome
- .capybara-screenshot-artifacts
- .test-job-extends
script:
- bundle exec rails db:schema:load
- bundle exec rails test:system
deploy-staging:
stage: deploy
script:
- gem install dpl
- dpl --provider=heroku --app=staging-aoz-freiwillige --api-key=$HEROKU_STAGING_API_KEY
only:
- develop
when: manual
deploy-production:
stage: deploy
script:
- gem install dpl
- dpl --provider=heroku --app=production-aoz-freiwillige --api-key=$HEROKU_STAGING_API_KEY
only:
- main
when: manual
......@@ -22,6 +22,7 @@ AllCops:
DisplayStyleGuide: true
ExtraDetails: true
TargetRubyVersion: 2.6
NewCops: enable
Rails:
Enabled: true
......@@ -31,6 +32,8 @@ Rails/HasAndBelongsToMany:
Enabled: false
Rails/RefuteMethods:
Enabled: false
Rails/UniqueValidationWithoutIndex:
Enabled: false
Metrics/AbcSize:
Exclude:
......@@ -202,3 +205,9 @@ Style/ExponentialNotation:
Enabled: true
Style/SlicingWithRange:
Enabled: true
# The following cops are added between 0.84.0 and 1.4.2.
# The configurations are default.
# If you want to use a cop by default, remove a configuration for the cop from here.
# If you want to disable a cop, change `Enabled` to false.
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 150`
# on 2020-05-20 13:18:07 +0200 using RuboCop version 0.83.0.
# on 2020-12-02 17:28:25 UTC using RuboCop version 1.4.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
......@@ -8,14 +8,14 @@
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
# Configuration parameters: EnforcedStyleAlignWith, Severity.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Layout/EndAlignment:
Exclude:
- 'app/policies/feedback_policy.rb'
- 'app/policies/semester_feedback_policy.rb'
# Offense count: 324
# Offense count: 311
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
......@@ -38,7 +38,6 @@ Layout/HashAlignment:
- 'app/helpers/format_helper.rb'
- 'app/inputs/date_year_range_picker_input.rb'
- 'app/models/assignment.rb'
- 'app/models/billing_expense.rb'
- 'app/models/concerns/assignment_common.rb'
- 'app/models/concerns/group_assignment_and_assignment_common.rb'
- 'app/models/concerns/group_assignment_common.rb'
......@@ -79,27 +78,23 @@ Layout/HashAlignment:
- 'test/models/volunteer_semester_elegibility_scopes_test.rb'
- 'test/models/volunteer_state_test.rb'
- 'test/policies/client_policy_test.rb'
- 'test/system/assignment_searches_test.rb'
- 'test/system/assignment_termination_index_test.rb'
- 'test/system/billing_expenses_test.rb'
- 'test/system/client_notifications_test.rb'
- 'test/system/clients_filter_dropdowns_test.rb'
- 'test/system/group_assignment_termination_index_test.rb'
- 'test/system/group_offer_filters_test.rb'
- 'test/system/group_offer_terminations_test.rb'
- 'test/system/group_offers_volunteer_searches_test.rb'
- 'test/system/hours_test.rb'
- 'test/system/semester_feedback_test.rb'
- 'test/system/semester_process_volunteer_actions_test.rb'
- 'test/system/terminate_assignments_test.rb'
- 'test/system/terminate_volunteers_test.rb'
- 'test/system/volunteer_searches_test.rb'
- 'test/utility/group_offer_and_assignment.rb'
- 'test/utility/performance_report_generator.rb'
- 'test/utility/reminder_mailing_builder.rb'
- 'test/utility/semester_scopes_generators.rb'
# Offense count: 329
# Offense count: 328
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
......@@ -120,7 +115,6 @@ Layout/LineLength:
- 'app/controllers/semester_process_volunteers_controller.rb'
- 'app/controllers/semester_processes_controller.rb'
- 'app/controllers/volunteers_controller.rb'
- 'app/helpers/api_button_helper.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/navigation_and_button_helper.rb'
- 'app/inputs/date_range_picker_input.rb'
......@@ -131,7 +125,6 @@ Layout/LineLength:
- 'app/models/concerns/group_assignment_common.rb'
- 'app/models/concerns/year_collection.rb'
- 'app/models/department.rb'
- 'app/models/document.rb'
- 'app/models/email_template.rb'
- 'app/models/event_volunteer.rb'
- 'app/models/group_assignment.rb'
......@@ -149,18 +142,12 @@ Layout/LineLength:
- 'app/policies/semester_feedback_policy.rb'
- 'app/policies/volunteer_policy.rb'
- 'app/services/semester.rb'
- 'app/views/assignments/_assignments_table.xlsx.axlsx'
- 'app/views/clients/_client_table.xlsx.axlsx'
- 'app/views/coplaners/sheets/_group_offers.xlsx.axlsx'
- 'app/views/events/show.xlsx.axlsx'
- 'app/views/group_offers/index.xlsx.axlsx'
- 'app/views/group_offers/search.json.jbuilder'
- 'app/views/performance_reports/show.xlsx.axlsx'
- 'app/views/users/index.xlsx.axlsx'
- 'app/views/volunteers/index.xlsx.axlsx'
- 'config/environments/production.rb'
- 'config/initializers/backtrace_silencers.rb'
- 'config/initializers/content_security_policy.rb'
- 'config/initializers/devise.rb'
- 'config/initializers/simple_form_bootstrap.rb'
- 'config/routes.rb'
- 'db/seeds.rb'
......@@ -173,12 +160,10 @@ Layout/LineLength:
- 'test/factories/trial_periods.rb'
- 'test/factories/volunteers.rb'
- 'test/helpers/semester_service_test.rb'
- 'test/integration/assignments_xlsx_export_test.rb'
- 'test/integration/clients_xlsx_export_test.rb'
- 'test/integration/events_xlsx_export_test.rb'
- 'test/integration/users_xlsx_export_test.rb'
- 'test/mailers/notification_mailer_test.rb'
- 'test/models/billing_expense_test.rb'
- 'test/models/event_volunteer_test.rb'
- 'test/models/group_offer_scopes_test.rb'
- 'test/models/performance_report_test.rb'
......@@ -196,7 +181,6 @@ Layout/LineLength:
- 'test/policies/group_assignments_policy_test.rb'
- 'test/policies/volunteer_policy_test.rb'
- 'test/system/admin_reset_user_password_test.rb'
- 'test/system/assignment_searches_test.rb'
- 'test/system/assignment_termination_index_test.rb'
- 'test/system/billing_expenses_test.rb'
- 'test/system/certificates_test.rb'
......@@ -209,10 +193,19 @@ Layout/LineLength:
- 'test/system/volunteer_searches_test.rb'
- 'test/utility/performance_report_generator.rb'
# Offense count: 2
Lint/AmbiguousBlockAssociation:
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Layout/MultilineMethodCallIndentation:
Exclude:
- 'app/views/group_offers/search.json.jbuilder'
- 'test/models/reminder_mailing_volunteer_test.rb'
# Offense count: 1
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'test/factories/users.rb'
# Offense count: 1
# Cop supports --auto-correct.
......@@ -229,7 +222,7 @@ Lint/RedundantCopDisableDirective:
# Offense count: 2
# Configuration parameters: AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!
# AllowedMethods: present?, blank?, presence, try, try!, in?
Lint/SafeNavigationChain:
Exclude:
- 'app/controllers/certificates_controller.rb'
......@@ -263,10 +256,9 @@ Lint/UnusedMethodArgument:
- 'app/models/concerns/acceptance_attributes.rb'
- 'app/models/volunteer.rb'
# Offense count: 12
# Offense count: 11
Lint/UselessAssignment:
Exclude:
- 'app/views/assignments/_assignments_table.xlsx.axlsx'
- 'app/views/users/index.xlsx.axlsx'
- 'db/seeds.rb'
- 'test/controllers/clients_controller_test.rb'
......@@ -283,16 +275,19 @@ Lint/Void:
Exclude:
- 'config/initializers/countries.rb'
# Offense count: 4
# Offense count: 7
# Configuration parameters: IgnoredMethods, Max.
Metrics/CyclomaticComplexity:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/controllers/assignments_controller.rb'
- 'app/controllers/departments_controller.rb'
- 'app/controllers/volunteers_controller.rb'
- 'app/helpers/filter_dropdown_helper.rb'
- 'app/models/certificate.rb'
- 'db/seeds.rb'
# Offense count: 2
# Configuration parameters: CountComments, Max.
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ModuleLength:
Exclude:
- 'app/helpers/application_helper.rb'
......@@ -305,11 +300,62 @@ Metrics/ParameterLists:
- 'app/helpers/application_helper.rb'
- 'app/helpers/navigation_and_button_helper.rb'
# Offense count: 2
# Offense count: 7
# Configuration parameters: IgnoredMethods, Max.
Metrics/PerceivedComplexity:
Exclude:
- 'app/controllers/assignments_controller.rb'
- 'app/controllers/departments_controller.rb'
- 'app/controllers/volunteers_controller.rb'
- 'app/helpers/filter_dropdown_helper.rb'
- 'app/models/certificate.rb'
- 'db/seeds.rb'
# Offense count: 19
# Cop supports --auto-correct.
Minitest/AssertInDelta:
Exclude:
- 'test/models/assignment_test.rb'
- 'test/models/volunteer_with_billable_hours_test.rb'
# Offense count: 8
Minitest/AssertionInLifecycleHook:
Exclude:
- 'test/system/group_offer_filters_test.rb'
# Offense count: 13
# Cop supports --auto-correct.
Minitest/LiteralAsActualArgument:
Exclude:
- 'test/controllers/departments_controller_test.rb'
- 'test/controllers/journals_controller_test.rb'
- 'test/integration/review_semester_with_multiple_assignments_test.rb'
- 'test/models/billing_expense_test.rb'
- 'test/models/user_test.rb'
- 'test/system/billing_expenses_test.rb'
- 'test/system/group_offers_test.rb'
- 'test/system/semester_feedback_test.rb'
- 'test/system/semester_process_volunteer_actions_test.rb'
# Offense count: 24
# Cop supports --auto-correct.
Minitest/TestMethodName:
Exclude:
- 'test/helpers/semester_service_test.rb'
- 'test/integration/users_xlsx_export_test.rb'
- 'test/models/group_assignment_scopes_test.rb'
- 'test/models/performance_report_test.rb'
- 'test/models/volunteer_scopes_test.rb'
- 'test/models/volunteer_semester_elegibility_scopes_test.rb'
- 'test/models/volunteer_with_billable_hours_test.rb'
- 'test/system/admin_reset_user_password_test.rb'
- 'test/system/assignment_termination_index_test.rb'
- 'test/system/clients_test.rb'
- 'test/system/group_assignment_termination_index_test.rb'
- 'test/system/journals_test.rb'
- 'test/system/semester_feedback_test.rb'
- 'test/system/semester_process_volunteer_actions_test.rb'
- 'test/system/volunteer_show_assignments_test.rb'
# Offense count: 1
Naming/AccessorMethodName:
......@@ -325,7 +371,7 @@ Naming/MemoizedInstanceVariableName:
# Offense count: 7
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'app/helpers/application_helper.rb'
......@@ -340,6 +386,12 @@ Naming/RescuedExceptionsVariableName:
- 'app/controllers/billing_expenses_controller.rb'
- 'app/controllers/review_semesters_controller.rb'
# Offense count: 1
# Configuration parameters: MinSize.
Performance/CollectionLiteralInLoop:
Exclude:
- 'db/seeds.rb'
# Offense count: 1
# Cop supports --auto-correct.
Performance/Detect:
......@@ -353,6 +405,14 @@ Performance/RedundantMerge:
Exclude:
- 'app/helpers/filter_dropdown_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/ActiveRecordCallbacksOrder:
Exclude:
- 'app/models/group_assignment.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/BelongsTo:
......@@ -366,19 +426,28 @@ Rails/Blank:
Exclude:
- 'app/models/volunteer.rb'
# Offense count: 5
# Offense count: 16
# Cop supports --auto-correct.
Rails/ContentTag:
Exclude:
- 'app/helpers/application_helper.rb'
- 'app/inputs/date_range_picker_input.rb'
- 'app/inputs/date_year_range_picker_input.rb'
# Offense count: 7
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Rails/Date:
Exclude:
- 'app/models/billing_expense.rb'
- 'app/models/concerns/billing_expense_semester_utils.rb'
- 'app/models/performance_report.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
# Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers.
# Whitelist: find_by_sql
# AllowedMethods: find_by_sql
# AllowedReceivers: Gem::Specification
Rails/DynamicFindBy:
Exclude:
- 'app/controllers/semester_process_volunteers_controller.rb'
......@@ -404,12 +473,11 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/user.rb'
- 'app/models/volunteer.rb'
# Offense count: 3
# Offense count: 2
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
Exclude:
- 'app/helpers/application_helper.rb'
- 'app/helpers/filter_dropdown_helper.rb'
# Offense count: 16
......@@ -428,6 +496,20 @@ Rails/InverseOf:
- 'app/models/user.rb'
- 'app/models/volunteer.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: config/routes.rb, config/routes/**/*.rb
Rails/MatchRoute:
Exclude:
- 'config/routes.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/NegateInclude:
Exclude:
- 'app/controllers/billing_expenses_controller.rb'
# Offense count: 2
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
......@@ -442,6 +524,12 @@ Rails/OutputSafety:
- 'app/helpers/notification_helper.rb'
- 'app/models/semester_process_volunteer.rb'
# Offense count: 2
# Cop supports --auto-correct.
Rails/Pluck:
Exclude:
- 'app/helpers/filter_dropdown_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
......@@ -450,9 +538,16 @@ Rails/ReadWriteAttribute:
Exclude:
- 'app/models/volunteer.rb'
# Offense count: 2
# Cop supports --auto-correct.
Rails/RedundantForeignKey:
Exclude:
- 'app/models/trial_period.rb'
- 'app/models/user.rb'
# Offense count: 7
# Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Rails/SkipsModelValidations:
Exclude:
- 'app/controllers/billing_expenses_controller.rb'
......@@ -470,12 +565,6 @@ Rails/TimeZone:
Exclude:
- 'app/controllers/clients_controller.rb'
# Offense count: 4
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/UniqueValidationWithoutIndex:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
......@@ -484,12 +573,58 @@ Rails/Validation:
Exclude:
- 'app/models/volunteer.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: exists, where
Rails/WhereExists:
Exclude:
- 'app/policies/application_policy.rb'
# Offense count: 3
# Cop supports --auto-correct.
Rails/WhereNot:
Exclude:
- 'app/models/department.rb'
- 'app/models/volunteer.rb'
# Offense count: 5
# Cop supports --auto-correct.
Style/CaseLikeIf:
Exclude:
- 'app/models/volunteer.rb'
- 'app/policies/application_policy.rb'
- 'app/services/semester.rb'
- 'test/factories/clients.rb'
- 'test/factories/volunteers.rb'
# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: ==, equal?, eql?
Style/ClassEqualityComparison:
Exclude:
- 'app/models/concerns/mission_either_one_relation.rb'
- 'app/models/trial_period.rb'
- 'app/policies/application_policy.rb'
- 'app/policies/assignment_policy.rb'
- 'app/policies/client_policy.rb'
- 'app/policies/group_assignment_policy.rb'
- 'app/policies/hour_policy.rb'
- 'app/policies/volunteer_policy.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/ColonMethodCall:
Exclude:
- 'app/models/concerns/mission_either_one_relation.rb'
# Offense count: 3
Style/CombinableLoops:
Exclude:
- 'app/views/coplaners/sheets/_stammdaten.xlsx.axlsx'
- 'test/models/volunteer_scopes_test.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
......@@ -505,12 +640,34 @@ Style/ExpandPathArguments:
- 'lib/tasks_test_helper.rb'
- 'test/test_helper.rb'
# Offense count: 4
# Cop supports --auto-correct.
Style/ExplicitBlockArgument:
Exclude:
- 'app/helpers/application_helper.rb'
- 'app/helpers/navigation_and_button_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/GlobalStdStream:
Exclude:
- 'config/environments/production.rb'
# Offense count: 1
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'app/models/reminder_mailing_volunteer.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces
Style/HashAsLastArrayItem:
Exclude:
- 'app/controllers/concerns/volunteer_attributes.rb'
- 'app/policies/user_policy.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/HashEachMethods:
......@@ -559,6 +716,13 @@ Style/NilComparison:
Exclude:
- 'app/models/semester_feedback.rb'
# Offense count: 2
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'app/helpers/filter_dropdown_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
......@@ -569,11 +733,9 @@ Style/PreferredHashMethods:
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Style/RedundantAssignment:
Exclude:
- 'app/models/client.rb'
- 'app/models/volunteer.rb'
# Offense count: 1
# Cop supports --auto-correct.
......@@ -581,6 +743,13 @@ Style/RedundantCondition:
Exclude:
- 'test/utility/group_offer_and_assignment.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: SafeForConstants.
Style/RedundantFetchBlock:
Exclude:
- 'config/puma.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
......@@ -597,6 +766,16 @@ Style/SafeNavigation: