Skip to content

Commit 2a7b532

Browse files
authored
Merge branch 'master' into feature/64535-evaluator-employee-vacation-column
2 parents ba8cebb + d7924c0 commit 2a7b532

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+373
-293
lines changed

.reek.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
### Generic smell configuration
2-
32
---
43
# detectors:
54
## You can disable smells completely
@@ -49,7 +48,6 @@
4948
# - lib/rake/legacy_tasks
5049
# - lib/smelly.rb
5150

52-
5351
# FIXME: Fix these, piece by piece
5452

5553
# Auto generated by Reeks --todo flag
@@ -1955,21 +1953,17 @@ detectors:
19551953
- WorkloadReportController#default_period
19561954
- Apidocs::Setup#setup_property
19571955
- Apidocs::Setup#setup_tags
1958-
- Crm::Highrise#airbrake?
19591956
- Crm::Highrise#base_url
19601957
- Crm::Highrise#contact_attributes
19611958
- Crm::Highrise#existing_contact_crm_keys
19621959
- Crm::Highrise#find_people_by_email
19631960
- Crm::Highrise#record_to_params
1964-
- Crm::Highrise#sentry?
19651961
- Crm::Highrise#sync_additional_order
1966-
- Crm::Odoo#airbrake?
19671962
- Crm::Odoo#base_url
19681963
- Crm::Odoo#contact_attributes
19691964
- Crm::Odoo#existing_contact_crm_keys
19701965
- Crm::Odoo#find_people_by_email
19711966
- Crm::Odoo#record_to_params
1972-
- Crm::Odoo#sentry?
19731967
- Crm::Odoo#sync_additional_order
19741968
- Evaluations::AbsencesEval#divisions
19751969
- Evaluations::ClientsEval#divisions
@@ -2094,8 +2088,6 @@ detectors:
20942088
- WorktimeHelper#week_number
20952089
- WorktimeHelper#worktime_account
20962090
- WorktimeHelper#worktime_description
2097-
- ApplicationJob#airbrake?
2098-
- ApplicationJob#sentry?
20992091
- CommitReminderJob#perform
21002092
- CrmSyncJob#perform
21012093
- InvoicingSyncJob#perform

.rubocop_todo.yml

Lines changed: 21 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,20 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-04-24 12:14:19 UTC using RuboCop version 1.72.2.
3+
# on 2025-12-03 15:37:34 UTC using RuboCop version 1.75.3.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
---
10-
# FIXME: Fix these, piece by piece
11-
129
# Offense count: 1
13-
# This cop supports safe autocorrection (--autocorrect).
14-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
15-
# SupportedStyles: space, no_space, compact
16-
# SupportedStylesForEmptyBrackets: space, no_space
17-
Layout/SpaceInsideArrayLiteralBrackets:
18-
Exclude:
19-
- 'app/models/employment.rb'
20-
21-
# Offense count: 2
22-
# This cop supports safe autocorrection (--autocorrect).
23-
Lint/AmbiguousOperator:
24-
Exclude:
25-
- 'test/models/employee_test.rb'
26-
27-
# Offense count: 3
2810
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
2911
Lint/DuplicateBranch:
3012
Exclude:
31-
- 'app/controllers/concerns/worktimes_report.rb'
3213
- 'app/domain/plannings/employee_board.rb'
3314

34-
# Offense count: 4
15+
# Offense count: 1
3516
Lint/DuplicateMethods:
3617
Exclude:
37-
- 'app/domain/forms/multi_absence.rb'
38-
- 'app/domain/order/copier.rb'
3918
- 'app/helpers/dry_crud/form/control.rb'
4019

4120
# Offense count: 1
@@ -45,6 +24,8 @@ Lint/EmptyBlock:
4524
- 'test/helpers/table_helper_test.rb'
4625

4726
# Offense count: 2
27+
# This cop supports safe autocorrection (--autocorrect).
28+
# Configuration parameters: AutoCorrect.
4829
Lint/LiteralAsCondition:
4930
Exclude:
5031
- 'test/helpers/dry_crud/form/builder_test.rb'
@@ -80,44 +61,44 @@ Lint/UnreachableLoop:
8061
Exclude:
8162
- 'app/models/working_condition.rb'
8263

83-
# Offense count: 98
64+
# Offense count: 110
8465
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
8566
Metrics/AbcSize:
8667
Max: 282
8768

88-
# Offense count: 51
69+
# Offense count: 55
8970
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
9071
# AllowedMethods: refine
9172
Metrics/BlockLength:
9273
Max: 97
9374

94-
# Offense count: 36
75+
# Offense count: 38
9576
# Configuration parameters: CountComments, CountAsOne.
9677
Metrics/ClassLength:
9778
Max: 314
9879

99-
# Offense count: 17
80+
# Offense count: 18
10081
# Configuration parameters: AllowedMethods, AllowedPatterns.
10182
Metrics/CyclomaticComplexity:
10283
Max: 13
10384

104-
# Offense count: 110
85+
# Offense count: 129
10586
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
10687
Metrics/MethodLength:
10788
Max: 312
10889

10990
# Offense count: 5
11091
# Configuration parameters: CountComments, CountAsOne.
11192
Metrics/ModuleLength:
112-
Max: 205
93+
Max: 157
11394

11495
# Offense count: 2
11596
# Configuration parameters: CountKeywordArgs.
11697
Metrics/ParameterLists:
11798
Max: 6
11899
MaxOptionalParameters: 4
119100

120-
# Offense count: 7
101+
# Offense count: 8
121102
# Configuration parameters: AllowedMethods, AllowedPatterns.
122103
Metrics/PerceivedComplexity:
123104
Max: 13
@@ -145,7 +126,7 @@ Naming/HeredocDelimiterNaming:
145126
Exclude:
146127
- 'lib/tasks/license.rake'
147128

148-
# Offense count: 14
129+
# Offense count: 13
149130
# This cop supports unsafe autocorrection (--autocorrect-all).
150131
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
151132
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
@@ -160,7 +141,6 @@ Naming/MemoizedInstanceVariableName:
160141
- 'app/controllers/ordertimes_controller.rb'
161142
- 'app/controllers/plannings/employees_controller.rb'
162143
- 'app/controllers/plannings/orders_controller.rb'
163-
- 'app/domain/order/cockpit/accounting_post_row.rb'
164144
- 'app/domain/order/report/entry.rb'
165145
- 'app/models/util/period.rb'
166146

@@ -187,30 +167,23 @@ Naming/MethodParameterName:
187167

188168
# Offense count: 3
189169
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
190-
# NamePrefix: is_, has_, have_
191-
# ForbiddenPrefixes: is_, has_, have_
170+
# NamePrefix: is_, has_, have_, does_
171+
# ForbiddenPrefixes: is_, has_, have_, does_
192172
# AllowedMethods: is_a?
193173
# MethodDefinitionMacros: define_method, define_singleton_method
194174
Naming/PredicateName:
195175
Exclude:
196176
- 'app/helpers/dry_crud/form/builder.rb'
197177
- 'app/models/concerns/belonging_to_work_item.rb'
198178

199-
# Offense count: 5
200-
# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns.
201-
# SupportedStyles: snake_case, camelCase
202-
Naming/VariableName:
203-
Exclude:
204-
- 'test/models/worktime_test.rb'
205-
206179
# Offense count: 15
207180
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
208181
# SupportedStyles: snake_case, normalcase, non_integer
209-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
182+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
210183
Naming/VariableNumber:
211184
Exclude:
185+
- 'test/controllers/clients_controller_test.rb'
212186
- 'test/controllers/contacts_controller_test.rb'
213-
- 'test/controllers/employments_controller_test.rb'
214187
- 'test/controllers/invoices_controller_test.rb'
215188
- 'test/controllers/orders_controller_test.rb'
216189
- 'test/controllers/overtime_vacations_controller_test.rb'
@@ -219,12 +192,6 @@ Naming/VariableNumber:
219192
- 'test/models/invoice_test.rb'
220193
- 'test/models/order_test.rb'
221194

222-
# Offense count: 1
223-
# Configuration parameters: MinSize.
224-
Performance/CollectionLiteralInLoop:
225-
Exclude:
226-
- 'test/controllers/evaluator_controller_test.rb'
227-
228195
# Offense count: 1
229196
Performance/FixedSize:
230197
Exclude:
@@ -236,14 +203,6 @@ Performance/MethodObjectAsBlock:
236203
- 'app/domain/apidocs/setup.rb'
237204
- 'app/helpers/order_helper.rb'
238205

239-
# Offense count: 2
240-
# This cop supports unsafe autocorrection (--autocorrect-all).
241-
# Configuration parameters: EnforcedStyle, AllowToTime.
242-
# SupportedStyles: strict, flexible
243-
Rails/Date:
244-
Exclude:
245-
- 'test/models/employee_test.rb'
246-
247206
# Offense count: 3
248207
# Configuration parameters: Include.
249208
# Include: app/models/**/*.rb
@@ -269,7 +228,7 @@ Rails/HasManyOrHasOneDependent:
269228
- 'app/models/service.rb'
270229
- 'app/models/work_item.rb'
271230

272-
# Offense count: 55
231+
# Offense count: 61
273232
# Configuration parameters: Include.
274233
# Include: app/helpers/**/*.rb
275234
Rails/HelperInstanceVariable:
@@ -426,7 +385,7 @@ Style/ConditionalAssignment:
426385
Exclude:
427386
- 'app/controllers/concerns/worktimes_report.rb'
428387

429-
# Offense count: 315
388+
# Offense count: 324
430389
# Configuration parameters: AllowedConstants.
431390
Style/Documentation:
432391
Enabled: false
@@ -440,21 +399,11 @@ Style/FrozenStringLiteralComment:
440399
- 'app/models/application_record.rb'
441400
- 'test/models/employee_test.rb'
442401

443-
# Offense count: 2
444-
# Configuration parameters: MinBranchesCount.
445-
Style/HashLikeCase:
446-
Exclude:
447-
- 'app/domain/order/report.rb'
448-
- 'app/helpers/order_helper.rb'
449-
450-
# Offense count: 4
402+
# Offense count: 1
451403
# This cop supports safe autocorrection (--autocorrect).
452404
Style/IfUnlessModifier:
453405
Exclude:
454-
- 'app/controllers/order_targets_controller.rb'
455-
- 'app/domain/forms/worktime_edit.rb'
456406
- 'app/domain/plannings/employee_board.rb'
457-
- 'app/models/accounting_post.rb'
458407

459408
# Offense count: 2
460409
Style/MissingRespondToMissing:
@@ -473,25 +422,15 @@ Style/OpenStructUse:
473422
- 'app/controllers/order_services_controller.rb'
474423
- 'test/controllers/employees_controller_test.rb'
475424

476-
# Offense count: 25
425+
# Offense count: 27
477426
# Configuration parameters: AllowedMethods.
478427
# AllowedMethods: respond_to_missing?
479428
Style/OptionalBooleanParameter:
480429
Enabled: false
481430

482-
# Offense count: 3
483-
# This cop supports unsafe autocorrection (--autocorrect-all).
484-
# Configuration parameters: Mode.
485-
Style/StringConcatenation:
486-
Exclude:
487-
- 'app/controllers/evaluator_controller.rb'
488-
- 'app/domain/order/services/csv_filename_generator.rb'
489-
- 'lib/tasks/license.rake'
490-
491-
# Offense count: 38
431+
# Offense count: 66
492432
# This cop supports safe autocorrection (--autocorrect).
493433
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
494434
# URISchemes: http, https
495435
Layout/LineLength:
496436
Max: 234
497-
...

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ gem 'validates_by_schema'
7272
gem 'validates_timeliness'
7373
gem 'xmlrpc'
7474

75-
# Error reporting, they are required in their respective initializers
76-
gem 'airbrake', require: false
77-
gem 'sentry-raven', require: false
75+
# Error reporting
76+
gem 'airbrake', require: false # required in its respective initializers
77+
gem 'sentry-delayed_job'
78+
gem 'sentry-rails'
79+
gem 'sentry-ruby'
7880

7981
## assets
8082
gem 'autoprefixer-rails'

Gemfile.lock

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,15 @@ GEM
604604
rexml (~> 3.2, >= 3.2.5)
605605
rubyzip (>= 1.2.2, < 3.0)
606606
websocket (~> 1.0)
607-
sentry-raven (3.1.2)
608-
faraday (>= 1.0)
607+
sentry-delayed_job (6.2.0)
608+
delayed_job (>= 4.0)
609+
sentry-ruby (~> 6.2.0)
610+
sentry-rails (6.2.0)
611+
railties (>= 5.2.0)
612+
sentry-ruby (~> 6.2.0)
613+
sentry-ruby (6.2.0)
614+
bigdecimal
615+
concurrent-ruby (~> 1.0, >= 1.0.2)
609616
simpleidn (0.2.3)
610617
snaky_hash (2.0.1)
611618
hashie
@@ -770,7 +777,9 @@ DEPENDENCIES
770777
seed-fu
771778
selectize-rails
772779
selenium-webdriver
773-
sentry-raven
780+
sentry-delayed_job
781+
sentry-rails
782+
sentry-ruby
774783
spring
775784
swagger-blocks
776785
terser

app/controllers/application_controller.rb

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# Likewise, all the methods added will be available for all controllers.
1010

1111
class ApplicationController < ActionController::Base
12-
before_action :set_sentry_request_context
1312
protect_from_forgery with: :exception
1413
skip_forgery_protection if: :saml_callback_path? # HACK: https://github.com/heartcombo/devise/issues/5210
1514

1615
# before_action :authenticate
16+
before_action :set_error_tracker_request_context
1717
before_action :store_employee_location!, if: :storable_location?
1818
before_action :authenticate_employee!
19-
before_action :set_sentry_user_context
19+
before_action :set_error_tracker_user_context
2020
before_action :set_paper_trail_whodunnit
2121
check_authorization unless: :devise_controller?
2222

@@ -71,12 +71,22 @@ def not_found
7171
raise ActionController::RoutingError, 'Not Found'
7272
end
7373

74-
def set_sentry_request_context
75-
Raven.extra_context(params: params.to_unsafe_h, url: request.url) if ENV['SENTRY_DSN']
74+
def set_error_tracker_request_context
75+
commit = Settings.puzzletime.build.commit
76+
project = Settings.puzzletime.run.project
77+
customer = Settings.puzzletime.run.customer
78+
79+
ErrorTracker.set_tags(commit:) if commit
80+
ErrorTracker.set_tags(project:) if project
81+
ErrorTracker.set_tags(customer:) if customer
7682
end
7783

78-
def set_sentry_user_context
79-
Raven.user_context(id: current_user.try(:id), name: current_user.try(:shortname)) if ENV['SENTRY_DSN']
84+
def set_error_tracker_user_context
85+
ErrorTracker.set_user(
86+
id: current_user.try(:id),
87+
username: current_user.try(:shortname),
88+
email: current_user.try(:email)
89+
)
8090
end
8191

8292
def saml_callback_path?

app/controllers/concerns/cockpit_csv.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ def send_cockpit_csv(cockpit, filename)
1919

2020
def cockpit_csv(cockpit)
2121
CSV.generate do |csv|
22-
csv << ['Position', 'Budget', 'Geleistete Stunden', 'Nicht verrechenbar', 'Offenes Budget', 'Geplantes Budget']
22+
csv << ['Position', 'Name der Position', 'Budget', 'Geleistete Stunden', 'Nicht verrechenbar', 'Offenes Budget', 'Geplantes Budget']
2323
cockpit.rows.each do |row|
2424
csv << [row.respond_to?(:shortnames) ? row.shortnames : 'Total',
25+
row.respond_to?(:name) ? row.name : '',
2526
row.cells[:budget].hours,
2627
row.cells[:supplied_services].hours,
2728
row.cells[:not_billable].hours,

0 commit comments

Comments
 (0)