• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / 0fa44f37-9401-471e-84d4-efbabcf424ab

22 Oct 2025 02:10PM UTC coverage: 91.212% (+0.2%) from 91.051%
0fa44f37-9401-471e-84d4-efbabcf424ab

push

circleci

web-flow
Getting rid of the New Project Wizard flipper (#2072)

3 of 4 new or added lines in 1 file covered. (75.0%)

794 existing lines in 41 files now uncovered.

2740 of 3004 relevant lines covered (91.21%)

751.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/app/services/user_error_parser.rb
1
# frozen_string_literal: true
UNCOV
2
class UserErrorParser
3✔
UNCOV
3
  class << self
3✔
UNCOV
4
    def csv_users(errors_str)
3✔
UNCOV
5
      users = parse(errors_str)
2✔
UNCOV
6
      "uid,email,given_name,family_name,display_name,eligible_sponsor," \
2✔
UNCOV
7
      "eligible_manager,developer,sysadmin,tester_trainer,DateAdded,AddedBy,Notes\n" \
UNCOV
8
      "#{users.join("\n")}"
UNCOV
9
    end
10

UNCOV
11
    def parse(errors_str)
3✔
UNCOV
12
      errors = errors_str.split("\n")
10✔
UNCOV
13
      roles = errors.map { |error| parse_line(error) }.flatten
32✔
UNCOV
14
      user_roles = roles.group_by { |role| role[:uid] }
96✔
UNCOV
15
      user_roles.map do |uid, user_role|
10✔
UNCOV
16
        "#{uid},,,,,#{sponsor_flag(user_role)},#{manager_flag(user_role)},,,,#{report_date},ImportProcess,\"Capacity Early Adopter\""
72✔
UNCOV
17
      end
UNCOV
18
    end
19

UNCOV
20
      private
3✔
21

UNCOV
22
        def parse_line(error)
3✔
UNCOV
23
          error_messages = error.split(";")
22✔
UNCOV
24
          error_messages.map do |str|
22✔
UNCOV
25
            user_role = str.split(":").last
86✔
UNCOV
26
            parts = user_role.split(" for role ")
86✔
UNCOV
27
            uid = parts.first
86✔
UNCOV
28
            role = parts.last
86✔
UNCOV
29
            { uid: uid.strip, role: role.strip }
86✔
UNCOV
30
          end
UNCOV
31
        end
32

UNCOV
33
        def report_date
3✔
UNCOV
34
          Time.current.in_time_zone("America/New_York").strftime("%Y-%m-%d")
72✔
UNCOV
35
        end
36

UNCOV
37
        def sponsor_flag(roles)
3✔
UNCOV
38
          if roles.count { |data| data[:role] == "Data Sponsor" }.positive?
158✔
UNCOV
39
            "TRUE"
22✔
UNCOV
40
          else
UNCOV
41
            ""
50✔
UNCOV
42
          end
UNCOV
43
        end
44

UNCOV
45
        def manager_flag(roles)
3✔
UNCOV
46
          if roles.count { |data| data[:role] == "Data Manager" }.positive?
158✔
UNCOV
47
            "TRUE"
16✔
UNCOV
48
          else
UNCOV
49
            ""
56✔
UNCOV
50
          end
UNCOV
51
        end
UNCOV
52
  end
UNCOV
53
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc