ticket-replicator 0.1.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -0
- data/README.md +7 -8
- data/config/examples/ticket-replicator.mappings.yml +1 -28
- data/cucumber.yml +1 -1
- data/features/load_tickets_in_jira.feature +65 -69
- data/features/setup_ticket_replicator.feature +1 -28
- data/features/step_definitions/load_tickets_in_jira_steps.rb +1 -1
- data/features/transform-solution-manager-tickets-into-jira-loadable-tickets.feature +51 -104
- data/features/transform_and_load_extracted_ticket_queue.feature +23 -46
- data/lib/ticket/replicator/file_loader.rb +1 -1
- data/lib/ticket/replicator/jira_project.rb +4 -0
- data/lib/ticket/replicator/row_loader.rb +66 -3
- data/lib/ticket/replicator/row_transformer.rb +29 -6
- data/lib/ticket/replicator/ticket.rb +19 -0
- data/lib/ticket/replicator/version.rb +1 -1
- data/spec/ticket/replicator/file_loader_spec.rb +1 -1
- data/spec/ticket/replicator/file_replicator_spec.rb +0 -2
- data/spec/ticket/replicator/file_transformer_spec.rb +2 -1
- data/spec/ticket/replicator/jira_project_spec.rb +19 -0
- data/spec/ticket/replicator/row_loader_spec.rb +208 -15
- data/spec/ticket/replicator/row_transformer_spec.rb +72 -5
- data/spec/ticket/replicator/ticket_spec.rb +72 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c470d25146cd29253a36275e23181f072d7131333f271f748ebe3560d9849825
|
4
|
+
data.tar.gz: 72393510381f5d4abdd4aa3bccafbec872fc30f585ddee5fdf7a8ae4e0f28f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1460f599c98ef9bdd4c0852cbf9c0b3734a7cba3453c96c4ab25e7dbac7a6e3303cf3b051b2d54ac80f7296113e383fafd1236eb62b8c4b57fe1d1cf190dc12
|
7
|
+
data.tar.gz: d641aa5a31b2efab1f6028383d534caf55336eeb49f43ceae446044df1cd0073873d6ca5f0b835d0581de049a402813a50a03478fdd81b9914259af079fbdadc
|
data/.rubocop.yml
CHANGED
@@ -7,12 +7,20 @@ Metrics/BlockLength:
|
|
7
7
|
AllowedMethods:
|
8
8
|
- describe
|
9
9
|
|
10
|
+
Metrics/ClassLength:
|
11
|
+
Max: 150
|
12
|
+
|
10
13
|
Style/Documentation:
|
11
14
|
Enabled: false
|
12
15
|
|
13
16
|
Style/HashSyntax:
|
14
17
|
Enabled: false
|
15
18
|
|
19
|
+
Style/SafeNavigation:
|
20
|
+
Enabled: true
|
21
|
+
AllowedMethods:
|
22
|
+
- '[]'
|
23
|
+
|
16
24
|
Style/StringLiterals:
|
17
25
|
EnforcedStyle: double_quotes
|
18
26
|
|
data/README.md
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
## Purpose
|
6
6
|
|
7
7
|
In order to:
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
8
|
+
* Have an overall transparency about all the activities pertaining to a project/product,
|
9
|
+
* Track progress
|
10
|
+
* Act accordingly
|
11
11
|
|
12
12
|
As a stakeholder
|
13
13
|
|
@@ -20,17 +20,15 @@ I need to replicate defect information from one system to a single reference sys
|
|
20
20
|
* ... and add to the application's Gemfile by executing:
|
21
21
|
|
22
22
|
```bash
|
23
|
-
bundle add
|
23
|
+
bundle add ticket-replicator
|
24
24
|
```
|
25
25
|
|
26
26
|
* ... if bundler is not being used to manage dependencies, by executing:
|
27
27
|
|
28
28
|
```bash
|
29
|
-
gem install
|
29
|
+
gem install ticket-replicator
|
30
30
|
```
|
31
31
|
|
32
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
33
|
-
|
34
32
|
## Setup
|
35
33
|
|
36
34
|
### Set environment variables
|
@@ -38,6 +36,7 @@ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_O
|
|
38
36
|
Define the following environment variables
|
39
37
|
- `TICKET_REPLICATOR_JIRA_PROJECT_KEY`
|
40
38
|
- `TICKET_REPLICATOR_JIRA_TICKET_TYPE_NAME`
|
39
|
+
- `TICKET_REPLICATOR_SOURCE_TICKET_URL_ERB`
|
41
40
|
|
42
41
|
For your JIRA access the following variables have to be defined:
|
43
42
|
|
@@ -61,7 +60,7 @@ Optional environment variables:
|
|
61
60
|
```
|
62
61
|
1. Edit the field mapping configuration file to fit your context.
|
63
62
|
|
64
|
-
###
|
63
|
+
### Jira Ticket Type Workflow Expectation - Any to Any
|
65
64
|
|
66
65
|
The target issue type in Jira must have a workflow that allows direct transitions between any states. This avoids
|
67
66
|
the need for administrative rights to calculate complex transition paths or discover workflow states through trial
|
@@ -20,35 +20,8 @@ status_mapping:
|
|
20
20
|
defaults_to: keep_original_value
|
21
21
|
|
22
22
|
resolution_mapping:
|
23
|
-
defaults_to:
|
24
|
-
"New":
|
25
|
-
"Open":
|
26
|
-
"In Process":
|
27
|
-
"In Review":
|
28
|
-
"On Hold":
|
29
|
-
Deferred:
|
30
|
-
Defect Correction in Process:
|
23
|
+
defaults_to: blank_value
|
31
24
|
"Fixed": "Fixed"
|
32
25
|
"Closed": "Done"
|
33
26
|
"Rejected": "Won't Do"
|
34
27
|
"Resolved": "Fixed"
|
35
|
-
"Confirmed":
|
36
|
-
"Forwarded":
|
37
|
-
"Information Required":
|
38
|
-
Wait for Defect Correction:
|
39
|
-
Solution Proposal:
|
40
|
-
Tester Action:
|
41
|
-
Wait on External:
|
42
|
-
|
43
|
-
team_mapping:
|
44
|
-
defaults_to: keep_original_value
|
45
|
-
"Frontend": "Web Team"
|
46
|
-
"Backend": "Server Team"
|
47
|
-
"Integration": "Integration Team"
|
48
|
-
"Mobile": "Mobile Team"
|
49
|
-
"Security": "Security Team"
|
50
|
-
"DevOps": "DevOps Team"
|
51
|
-
"QA": "Quality Assurance"
|
52
|
-
"Architecture": "Architecture Team"
|
53
|
-
"UX": "Design Team"
|
54
|
-
"Performance": "Performance Team"
|
data/cucumber.yml
CHANGED
@@ -4,4 +4,4 @@
|
|
4
4
|
%>
|
5
5
|
default: <%= shared_args %> --format pretty --tags ' <%= default_tags %>'
|
6
6
|
guard: <%= shared_args %> --format rerun --out rerun_failures.txt --format progress --tags ' <%= default_tags %>'
|
7
|
-
rake: <%= shared_args %> --format progress --tags 'not @wip'
|
7
|
+
rake: <%= shared_args %> --format progress --tags 'not @wip and <%= default_tags %>'
|
@@ -8,122 +8,118 @@ Feature: Load tickets into Jira
|
|
8
8
|
| name |
|
9
9
|
| TICKET_REPLICATOR_JIRA_PROJECT_KEY |
|
10
10
|
| TICKET_REPLICATOR_JIRA_TICKET_TYPE_NAME |
|
11
|
+
# And the following environment variables have been set:
|
12
|
+
# | name | value |
|
13
|
+
# | TICKET_REPLICATOR_SOURCE_TICKET_URL | http://url/to/source/ticket/<%= source_ticket_id %> |
|
11
14
|
And the project has no tickets
|
12
15
|
|
13
16
|
Scenario: Load tickets in Jira
|
14
17
|
Given a file named "queue/20.transformed/sap_solution_manager_defects.csv" with:
|
15
18
|
"""
|
16
|
-
"ID","Status","Resolution","Priority","
|
17
|
-
"10001","Open","","Highest","
|
18
|
-
"10002","In Process","","Highest","
|
19
|
-
"10003","Confirmed","
|
20
|
-
"10004","Closed","Done","Low","
|
21
|
-
"10005","Open","","High","
|
22
|
-
"10006","Solution Proposal","","Medium","
|
23
|
-
"10007","Withdrawn","Won't Do","Low","
|
24
|
-
"10008","Open","","Highest","
|
25
|
-
"10009","Wait on External","","Medium","
|
19
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
20
|
+
"10001","Open","","Highest","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
21
|
+
"10002","In Process","","Highest","SMAN-10002 | Database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
22
|
+
"10003","Confirmed","Done","Medium","SMAN-10003 | Invalid date format in SOAP response (10003)","http://url/to/source/ticket/10003"
|
23
|
+
"10004","Closed","Done","Low","SMAN-10004 | App crashes when offline on Android 12 (10004)","http://url/to/source/ticket/10004"
|
24
|
+
"10005","Open","","High","SMAN-10005 | Session tokens not properly invalidated (10005)","http://url/to/source/ticket/10005"
|
25
|
+
"10006","Solution Proposal","","Medium","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)","http://url/to/source/ticket/10006"
|
26
|
+
"10007","Withdrawn","Won't Do","Low","SMAN-10007 | Test data missing edge case scenarios (10007)","http://url/to/source/ticket/10007"
|
27
|
+
"10008","Open","","Highest","SMAN-10008 | Memory leak in caching implementation (10008)","http://url/to/source/ticket/10008"
|
28
|
+
"10009","Wait on External","","Medium","SMAN-10009 | Inconsistent button styles across modules (10009)","http://url/to/source/ticket/10009"
|
26
29
|
"""
|
27
30
|
When I successfully run `ticket-replicator --load`
|
28
31
|
Then the Jira project should only have the following tickets:
|
29
|
-
| status | resolution | priority |
|
30
|
-
| Open | | Highest |
|
31
|
-
| In Process | | Highest |
|
32
|
-
| Confirmed |
|
33
|
-
| Closed | Done | Low |
|
34
|
-
| Open | | High |
|
35
|
-
| Solution Proposal | | Medium |
|
36
|
-
| Withdrawn | Won't Do | Low |
|
37
|
-
| Open | | Highest |
|
38
|
-
| Wait on External | | Medium |
|
39
|
-
And the source ticket URL is found in the ticket descriptions of those tickets
|
32
|
+
| status | resolution | priority | summary | source_ticket_url |
|
33
|
+
| Open | | Highest | SMAN-10001 \| Login page randomly fails to load CSS assets (10001) | http://url/to/source/ticket/10001 |
|
34
|
+
| In Process | | Highest | SMAN-10002 \| Database deadlock during order processing (10002) | http://url/to/source/ticket/10002 |
|
35
|
+
| Confirmed | Done | Medium | SMAN-10003 \| Invalid date format in SOAP response (10003) | http://url/to/source/ticket/10003 |
|
36
|
+
| Closed | Done | Low | SMAN-10004 \| App crashes when offline on Android 12 (10004) | http://url/to/source/ticket/10004 |
|
37
|
+
| Open | | High | SMAN-10005 \| Session tokens not properly invalidated (10005) | http://url/to/source/ticket/10005 |
|
38
|
+
| Solution Proposal | | Medium | SMAN-10006 \| Jenkins pipeline timeout on large builds (10006) | http://url/to/source/ticket/10006 |
|
39
|
+
| Withdrawn | Won't Do | Low | SMAN-10007 \| Test data missing edge case scenarios (10007) | http://url/to/source/ticket/10007 |
|
40
|
+
| Open | | Highest | SMAN-10008 \| Memory leak in caching implementation (10008) | http://url/to/source/ticket/10008 |
|
41
|
+
| Wait on External | | Medium | SMAN-10009 \| Inconsistent button styles across modules (10009) | http://url/to/source/ticket/10009 |
|
40
42
|
|
41
43
|
Scenario: Loading the ticket information twice in Jira does not create additional tickets
|
42
44
|
Given a file named "queue/20.transformed/sap_solution_manager_defects.csv" with:
|
43
45
|
"""
|
44
|
-
"ID","Status","Resolution","Priority","
|
45
|
-
"10001","Open","","Highest","
|
46
|
-
"10002","In Process","","Highest","
|
46
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
47
|
+
"10001","Open","","Highest","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
48
|
+
"10002","In Process","","Highest","SMAN-10002 | Database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
47
49
|
"""
|
48
50
|
And a file named "queue/20.transformed/sap_solution_manager_defects.SAME_CONTENT.csv" with:
|
49
51
|
"""
|
50
|
-
"ID","Status","Resolution","Priority","
|
51
|
-
"10001","Open","","Highest","
|
52
|
-
"10002","In Process","","Highest","
|
52
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
53
|
+
"10001","Open","","Highest","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
54
|
+
"10002","In Process","","Highest","SMAN-10002 | Database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
53
55
|
"""
|
54
56
|
When I successfully run `ticket-replicator --load`
|
55
57
|
Then the Jira project should only have the following tickets:
|
56
|
-
| status | resolution | priority |
|
57
|
-
| Open | | Highest |
|
58
|
-
| In Process | | Highest |
|
59
|
-
And the source ticket URL is found in the ticket descriptions of those tickets
|
58
|
+
| status | resolution | priority | summary | source_ticket_url |
|
59
|
+
| Open | | Highest | SMAN-10001 \| Login page randomly fails to load CSS assets (10001) | http://url/to/source/ticket/10001 |
|
60
|
+
| In Process | | Highest | SMAN-10002 \| Database deadlock during order processing (10002) | http://url/to/source/ticket/10002 |
|
60
61
|
|
61
62
|
Scenario: Tickets are updated only if changes happened or they were not replicated before
|
62
63
|
Given a file named "queue/20.transformed/2025-03-29.16h16.sap_solution_manager_defects.csv" with:
|
63
64
|
"""
|
64
|
-
"ID","Status","Resolution","Priority","
|
65
|
-
"10001","Open","","Highest","
|
66
|
-
"10002","In Process","","Medium","
|
67
|
-
"10016","Confirmed","
|
65
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
66
|
+
"10001","Open","","Highest","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
67
|
+
"10002","In Process","Cannot Reproduce","Medium","SMAN-10002 | Database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
68
|
+
"10016","Confirmed","Done","High","SMAN-10016 | Slow response time on product search API (10016)","http://url/to/source/ticket/10016"
|
68
69
|
"""
|
69
70
|
And I successfully run `ticket-replicator --load`
|
70
71
|
When a file named "queue/20.transformed/2025-03-29.19h56.update_tickets.csv" with:
|
71
72
|
"""
|
72
|
-
"ID","Status","Resolution","Priority","
|
73
|
-
"10001","Closed","","Highest","
|
74
|
-
"10002","In Process","","High","
|
75
|
-
"10008","Open","","Highest","
|
76
|
-
"10016","Confirmed","
|
73
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
74
|
+
"10001","Closed","","Highest","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
75
|
+
"10002","In Process","","High","SMAN-10002 | *Recurring* database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
76
|
+
"10008","Open","","Highest","SMAN-10008 | Memory leak in caching implementation (10008)","http://url/to/source/ticket/10008"
|
77
|
+
"10016","Confirmed","Done","High","SMAN-10016 | Slow response time on product search API (10016)","http://url/to/source/ticket/10016"
|
77
78
|
"""
|
78
79
|
And I successfully run `ticket-replicator --jira-http-debug --load`
|
79
80
|
Then the Jira project should only have the following tickets:
|
80
|
-
| example purpose
|
81
|
-
| one update due to status change
|
82
|
-
| one update due to priority and summary updates
|
83
|
-
|
|
84
|
-
| no update since no status or field change
|
85
|
-
And only
|
81
|
+
| example purpose | status | resolution | priority | summary | source_ticket_url |
|
82
|
+
| one update due to status change | Closed | | Highest | SMAN-10001 \| Login page randomly fails to load CSS assets (10001) | http://url/to/source/ticket/10001 |
|
83
|
+
| one update due to priority, resolution and summary updates | In Process | | High | SMAN-10002 \| *Recurring* database deadlock during order processing (10002) | http://url/to/source/ticket/10002 |
|
84
|
+
| three updates due to new ticket created (fields, source ticket link and status) | Open | | Highest | SMAN-10008 \| Memory leak in caching implementation (10008) | http://url/to/source/ticket/10008 |
|
85
|
+
| no update since no status or field change | Confirmed | Done | High | SMAN-10016 \| Slow response time on product search API (10016) | http://url/to/source/ticket/10016 |
|
86
|
+
And only 5 Jira update requests were emitted
|
86
87
|
|
87
88
|
Scenario: Attempting to set an unexpected status generates information about the current row being loaded
|
88
89
|
Given a file named "queue/20.transformed/sap_solution_manager_defects.csv" with:
|
89
90
|
"""
|
90
|
-
"ID","Status","Resolution","Priority","
|
91
|
-
"10001","Open","","Highest","
|
92
|
-
"10002","In Process","","Highest","
|
93
|
-
"10003","Confirmed","
|
94
|
-
"10004","____ INEXISTING STATUS ____","Done","Low","
|
95
|
-
"10005","Open","","High","
|
96
|
-
"10006","Solution Proposal","","Medium","
|
97
|
-
"10007","Withdrawn","Won't Do","Low","
|
98
|
-
"10008","Open","","Highest","
|
99
|
-
"10009","Wait on External","","Medium","
|
91
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
92
|
+
"10001","Open","","Highest","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
93
|
+
"10002","In Process","","Highest","SMAN-10002 | Database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
94
|
+
"10003","Confirmed","Done","Medium","SMAN-10003 | Invalid date format in SOAP response (10003)","http://url/to/source/ticket/10003"
|
95
|
+
"10004","____ INEXISTING STATUS ____","Done","Low","SMAN-10004 | App crashes when offline on Android 12 (10004)","http://url/to/source/ticket/10004"
|
96
|
+
"10005","Open","","High","SMAN-10005 | Session tokens not properly invalidated (10005)","http://url/to/source/ticket/10005"
|
97
|
+
"10006","Solution Proposal","","Medium","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)","http://url/to/source/ticket/10006"
|
98
|
+
"10007","Withdrawn","Won't Do","Low","SMAN-10007 | Test data missing edge case scenarios (10007)","http://url/to/source/ticket/10007"
|
99
|
+
"10008","Open","","Highest","SMAN-10008 | Memory leak in caching implementation (10008)","http://url/to/source/ticket/10008"
|
100
|
+
"10009","Wait on External","","Medium","SMAN-10009 | Inconsistent button styles across modules (10009)","http://url/to/source/ticket/10009"
|
100
101
|
"""
|
101
102
|
When I run `ticket-replicator --load`
|
102
103
|
Then it should fail with:
|
103
104
|
"""
|
104
105
|
ERROR Object : Ticket::Replicator::FileLoader::LoadError: queue/20.transformed/sap_solution_manager_defects.csv:5: error while loading row:
|
105
106
|
No transition found for "____ INEXISTING STATUS ____" in ["No Error -> No Error", "Tester Action -> Tester Action", "Close Bug -> Closed", "Confirmed -> Confirmed", "Defect Correction in Process -> Defect Correction in Process", "Deferred -> Deferred", "Forwarded -> Forwarded", "Information Required -> Information Required", "New -> New", "Open -> Open", "Solution Proposal -> Solution Proposal", "Wait for Defect Correction -> Wait for Defect Correction", "Wait on External -> Wait on External", "Withdrawn -> Withdrawn", "In Process -> In Process"].:
|
106
|
-
#<CSV::Row id:"10004" status:"____ INEXISTING STATUS ____" resolution:"Done" priority:"Low"
|
107
|
+
#<CSV::Row id:"10004" status:"____ INEXISTING STATUS ____" resolution:"Done" priority:"Low" summary:"SMAN-10004 | App crashes when offline on Android 12 (10004)" source_ticket_url:"http://url/to/source/ticket/10004">
|
107
108
|
"""
|
108
109
|
|
109
110
|
Scenario: Attempting to set an unexpected priority generates information about the current row being loaded
|
110
111
|
Given a file named "queue/20.transformed/sap_solution_manager_defects.csv" with:
|
111
112
|
"""
|
112
|
-
"ID","Status","Resolution","Priority","
|
113
|
-
"
|
114
|
-
"
|
115
|
-
"10003","Confirmed","Fixed","Medium","A16 Logistic","SMAN-10003 | Invalid date format in SOAP response (10003)"
|
116
|
-
"10004","Closed","Done","Low","A16 Market","SMAN-10004 | App crashes when offline on Android 12 (10004)"
|
117
|
-
"10005","Open","","High","A16 CRM","SMAN-10005 | Session tokens not properly invalidated (10005)"
|
118
|
-
"10006","Solution Proposal","","Medium","A16 Supply","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)"
|
119
|
-
"10007","Withdrawn","Won't Do","Low","A16 E2E-Test","SMAN-10007 | Test data missing edge case scenarios (10007)"
|
120
|
-
"10008","Open","","____ UNEXPECTED PRIORITY ____","A16 Markets","SMAN-10008 | Memory leak in caching implementation (10008)"
|
121
|
-
"10009","Wait on External","","Medium","A16 Platform","SMAN-10009 | Inconsistent button styles across modules (10009)"
|
113
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
114
|
+
"10008","Open","","____ UNEXPECTED PRIORITY ____","SMAN-10008 | Memory leak in caching implementation (10008)","http://url/to/source/ticket/10008"
|
115
|
+
"10009","Wait on External","","Medium","SMAN-10009 | Inconsistent button styles across modules (10009)","http://url/to/source/ticket/10009"
|
122
116
|
"""
|
123
117
|
When I run `ticket-replicator --load`
|
124
118
|
Then it should fail with:
|
125
119
|
"""
|
126
|
-
ERROR Object : Ticket::Replicator::FileLoader::LoadError: queue/20.transformed/sap_solution_manager_defects.csv:
|
120
|
+
ERROR Object : Ticket::Replicator::FileLoader::LoadError: queue/20.transformed/sap_solution_manager_defects.csv:2: error while loading row:
|
127
121
|
Bad Request:
|
128
|
-
#<CSV::Row id:"10008" status:"Open" resolution:"" priority:"____ UNEXPECTED PRIORITY ____"
|
122
|
+
#<CSV::Row id:"10008" status:"Open" resolution:"" priority:"____ UNEXPECTED PRIORITY ____" summary:"SMAN-10008 | Memory leak in caching implementation (10008)" source_ticket_url:"http://url/to/source/ticket/10008">
|
129
123
|
"""
|
124
|
+
|
125
|
+
|
@@ -36,38 +36,11 @@ Feature: Setup Ticket Replicator
|
|
36
36
|
defaults_to: keep_original_value
|
37
37
|
|
38
38
|
resolution_mapping:
|
39
|
-
defaults_to:
|
40
|
-
"New":
|
41
|
-
"Open":
|
42
|
-
"In Process":
|
43
|
-
"In Review":
|
44
|
-
"On Hold":
|
45
|
-
Deferred:
|
46
|
-
Defect Correction in Process:
|
39
|
+
defaults_to: blank_value
|
47
40
|
"Fixed": "Fixed"
|
48
41
|
"Closed": "Done"
|
49
42
|
"Rejected": "Won't Do"
|
50
43
|
"Resolved": "Fixed"
|
51
|
-
"Confirmed":
|
52
|
-
"Forwarded":
|
53
|
-
"Information Required":
|
54
|
-
Wait for Defect Correction:
|
55
|
-
Solution Proposal:
|
56
|
-
Tester Action:
|
57
|
-
Wait on External:
|
58
|
-
|
59
|
-
team_mapping:
|
60
|
-
defaults_to: keep_original_value
|
61
|
-
"Frontend": "Web Team"
|
62
|
-
"Backend": "Server Team"
|
63
|
-
"Integration": "Integration Team"
|
64
|
-
"Mobile": "Mobile Team"
|
65
|
-
"Security": "Security Team"
|
66
|
-
"DevOps": "DevOps Team"
|
67
|
-
"QA": "Quality Assurance"
|
68
|
-
"Architecture": "Architecture Team"
|
69
|
-
"UX": "Design Team"
|
70
|
-
"Performance": "Performance Team"
|
71
44
|
"""
|
72
45
|
And a directory named "queue/10.extracted" should exist
|
73
46
|
|
@@ -12,7 +12,7 @@ Given(/^the project has no tickets$/) do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
Then(/^the Jira project should only have the following tickets:$/) do |table|
|
15
|
-
keys = table.headers - ["example purpose", "source ticket url"
|
15
|
+
keys = table.headers - ["example purpose", "source ticket url"]
|
16
16
|
|
17
17
|
expected_tickets = table.hashes.map { |ticket| keys.collect { |key| ticket[key] } }.sort
|
18
18
|
|
@@ -5,9 +5,8 @@ Feature: Transform SAP tickets to Jira format
|
|
5
5
|
|
6
6
|
Background:
|
7
7
|
Given the following environment variables have been set:
|
8
|
-
| name
|
9
|
-
|
|
10
|
-
|
8
|
+
| name | value |
|
9
|
+
| TICKET_REPLICATOR_SOURCE_TICKET_URL | http://url/to/source/ticket/<%= source_ticket_id %> |
|
11
10
|
|
12
11
|
Scenario: Transform valid ticket CSV
|
13
12
|
Given a file named "config/ticket-replicator.mappings.yml" with:
|
@@ -39,57 +38,40 @@ Feature: Transform SAP tickets to Jira format
|
|
39
38
|
"Confirmed": "Open"
|
40
39
|
|
41
40
|
resolution_mapping:
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"In Progress": ""
|
45
|
-
"In Review": ""
|
46
|
-
"On Hold": ""
|
47
|
-
"Fixed": "Fixed"
|
41
|
+
"defaults_to": blank_value
|
42
|
+
"Fixed": "Done"
|
48
43
|
"Closed": "Done"
|
49
44
|
"Rejected": "Won't Do"
|
50
|
-
"Resolved": "
|
51
|
-
"Confirmed": ""
|
52
|
-
|
53
|
-
team_mapping:
|
54
|
-
"Frontend": "Web Team"
|
55
|
-
"Backend": "Server Team"
|
56
|
-
"Integration": "Integration Team"
|
57
|
-
"Mobile": "Mobile Team"
|
58
|
-
"Security": "Security Team"
|
59
|
-
"DevOps": "DevOps Team"
|
60
|
-
"QA": "Quality Assurance"
|
61
|
-
"Architecture": "Architecture Team"
|
62
|
-
"UX": "Design Team"
|
63
|
-
"Performance": "Performance Team"
|
45
|
+
"Resolved": "Done"
|
64
46
|
"""
|
65
47
|
Given a file named "queue/10.extracted/sap_solution_manager_defects.csv" with:
|
66
48
|
"""
|
67
|
-
"ID","Status","Priority","
|
68
|
-
"10001","New","2-High","
|
69
|
-
"10002","In Progress","1-Critical","
|
70
|
-
"10003","Resolved","3-Medium","
|
71
|
-
"10004","Closed","4-Low","
|
72
|
-
"10005","Open","2-High","
|
73
|
-
"10006","In Review","3-Medium","
|
74
|
-
"10007","Rejected","4-Low","
|
75
|
-
"10008","Confirmed","1-Critical","
|
76
|
-
"10009","On Hold","3-Medium","
|
77
|
-
"10010","Fixed","2-High","
|
49
|
+
"ID","Status","Priority","Summary"
|
50
|
+
"10001","New","2-High","Login page randomly fails to load CSS assets (10001)"
|
51
|
+
"10002","In Progress","1-Critical","Database deadlock during order processing (10002)"
|
52
|
+
"10003","Resolved","3-Medium","Invalid date format in SOAP response (10003)"
|
53
|
+
"10004","Closed","4-Low","App crashes when offline on Android 12 (10004)"
|
54
|
+
"10005","Open","2-High","Session tokens not properly invalidated (10005)"
|
55
|
+
"10006","In Review","3-Medium","Jenkins pipeline timeout on large builds (10006)"
|
56
|
+
"10007","Rejected","4-Low","Test data missing edge case scenarios (10007)"
|
57
|
+
"10008","Confirmed","1-Critical","Memory leak in caching implementation (10008)"
|
58
|
+
"10009","On Hold","3-Medium","Inconsistent button styles across modules (10009)"
|
59
|
+
"10010","Fixed","2-High","Slow response time on product search API (10010)"
|
78
60
|
"""
|
79
61
|
When I successfully run `ticket-replicator --transform`
|
80
62
|
Then a file named "queue/20.transformed/sap_solution_manager_defects.csv" should contain exactly:
|
81
63
|
"""
|
82
|
-
"ID","Status","Resolution","Priority","
|
83
|
-
"10001","Open","","High","
|
84
|
-
"10002","In Progress","","Highest","
|
85
|
-
"10003","Resolved","
|
86
|
-
"10004","Closed","Done","Low","
|
87
|
-
"10005","Open","","High","
|
88
|
-
"10006","In Review","","Medium","
|
89
|
-
"10007","Closed","Won't Do","Low","
|
90
|
-
"10008","Open","","Highest","
|
91
|
-
"10009","Blocked","","Medium","
|
92
|
-
"10010","Resolved","
|
64
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
65
|
+
"10001","Open","","High","SMAN-10001 | Login page randomly fails to load CSS assets (10001)","http://url/to/source/ticket/10001"
|
66
|
+
"10002","In Progress","","Highest","SMAN-10002 | Database deadlock during order processing (10002)","http://url/to/source/ticket/10002"
|
67
|
+
"10003","Resolved","Done","Medium","SMAN-10003 | Invalid date format in SOAP response (10003)","http://url/to/source/ticket/10003"
|
68
|
+
"10004","Closed","Done","Low","SMAN-10004 | App crashes when offline on Android 12 (10004)","http://url/to/source/ticket/10004"
|
69
|
+
"10005","Open","","High","SMAN-10005 | Session tokens not properly invalidated (10005)","http://url/to/source/ticket/10005"
|
70
|
+
"10006","In Review","","Medium","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)","http://url/to/source/ticket/10006"
|
71
|
+
"10007","Closed","Won't Do","Low","SMAN-10007 | Test data missing edge case scenarios (10007)","http://url/to/source/ticket/10007"
|
72
|
+
"10008","Open","","Highest","SMAN-10008 | Memory leak in caching implementation (10008)","http://url/to/source/ticket/10008"
|
73
|
+
"10009","Blocked","","Medium","SMAN-10009 | Inconsistent button styles across modules (10009)","http://url/to/source/ticket/10009"
|
74
|
+
"10010","Resolved","Done","High","SMAN-10010 | Slow response time on product search API (10010)","http://url/to/source/ticket/10010"
|
93
75
|
"""
|
94
76
|
|
95
77
|
Scenario: Transform valid ticket Excel
|
@@ -113,38 +95,12 @@ Feature: Transform SAP tickets to Jira format
|
|
113
95
|
defaults_to: keep_original_value
|
114
96
|
|
115
97
|
resolution_mapping:
|
116
|
-
defaults_to:
|
117
|
-
"
|
118
|
-
"Open":
|
119
|
-
"In Process":
|
120
|
-
"In Review":
|
121
|
-
"On Hold":
|
122
|
-
Deferred:
|
123
|
-
Defect Correction in Process:
|
124
|
-
"Fixed": "Fixed"
|
98
|
+
defaults_to: blank_value
|
99
|
+
"Fixed": "Done"
|
125
100
|
"Closed": "Done"
|
126
101
|
"Rejected": "Won't Do"
|
127
|
-
"Resolved": "
|
128
|
-
"
|
129
|
-
"Forwarded":
|
130
|
-
"Information Required":
|
131
|
-
Wait for Defect Correction:
|
132
|
-
Solution Proposal:
|
133
|
-
Tester Action:
|
134
|
-
Wait on External:
|
135
|
-
|
136
|
-
team_mapping:
|
137
|
-
defaults_to: keep_original_value
|
138
|
-
"Frontend": "Web Team"
|
139
|
-
"Backend": "Server Team"
|
140
|
-
"Integration": "Integration Team"
|
141
|
-
"Mobile": "Mobile Team"
|
142
|
-
"Security": "Security Team"
|
143
|
-
"DevOps": "DevOps Team"
|
144
|
-
"QA": "Quality Assurance"
|
145
|
-
"Architecture": "Architecture Team"
|
146
|
-
"UX": "Design Team"
|
147
|
-
"Performance": "Performance Team"
|
102
|
+
"Resolved": "Done"
|
103
|
+
"Withdrawn": "Cannot Reproduce"
|
148
104
|
"""
|
149
105
|
And an Excel file named "queue/10.extracted/sap_solution_manager_defects.xlsx"
|
150
106
|
And it has a tab named "SAP Document Export" with the following rows:
|
@@ -170,24 +126,24 @@ Feature: Transform SAP tickets to Jira format
|
|
170
126
|
When I successfully run `ticket-replicator --transform`
|
171
127
|
Then a file named "queue/20.transformed/sap_solution_manager_defects.csv" should contain exactly:
|
172
128
|
"""
|
173
|
-
"ID","Status","Resolution","Priority","
|
174
|
-
"3000017049","Closed","Done","Medium","
|
175
|
-
"9400011377","Confirmed","","Low","
|
176
|
-
"3000016618","Defect Correction in Process","","Medium","
|
177
|
-
"9400013805","Deferred","","Medium","
|
178
|
-
"9400013816","Forwarded","","High","
|
179
|
-
"9400011382","In Process","","Medium","
|
180
|
-
"9400011393","Information Required","","Medium","
|
181
|
-
"9400011381","New","","Medium","
|
182
|
-
"3000016617","No Error","
|
183
|
-
"9400011372","Open","","Highest","
|
184
|
-
"9400011403","Solution Proposal","","Medium","
|
185
|
-
"9400011380","Tester Action","","Medium","
|
186
|
-
"9400011705","Wait for Defect Correction","","Medium","
|
187
|
-
"9400011437","Wait on External","","Medium","
|
188
|
-
"9400011466","Withdrawn","
|
189
|
-
"3000017667","Closed","Done","Medium","
|
190
|
-
"3000018423","No Error","
|
129
|
+
"ID","Status","Resolution","Priority","Summary","Source Ticket URL"
|
130
|
+
"3000017049","Closed","Done","Medium","SMAN-3000017049 | Summary","http://url/to/source/ticket/3000017049"
|
131
|
+
"9400011377","Confirmed","","Low","SMAN-9400011377 | Summary","http://url/to/source/ticket/9400011377"
|
132
|
+
"3000016618","Defect Correction in Process","","Medium","SMAN-3000016618 | Summary","http://url/to/source/ticket/3000016618"
|
133
|
+
"9400013805","Deferred","","Medium","SMAN-9400013805 | Summary","http://url/to/source/ticket/9400013805"
|
134
|
+
"9400013816","Forwarded","","High","SMAN-9400013816 | Summary","http://url/to/source/ticket/9400013816"
|
135
|
+
"9400011382","In Process","","Medium","SMAN-9400011382 | Summary","http://url/to/source/ticket/9400011382"
|
136
|
+
"9400011393","Information Required","","Medium","SMAN-9400011393 | Summary","http://url/to/source/ticket/9400011393"
|
137
|
+
"9400011381","New","","Medium","SMAN-9400011381 | Summary","http://url/to/source/ticket/9400011381"
|
138
|
+
"3000016617","No Error","","Medium","SMAN-3000016617 | Summary","http://url/to/source/ticket/3000016617"
|
139
|
+
"9400011372","Open","","Highest","SMAN-9400011372 | Summary","http://url/to/source/ticket/9400011372"
|
140
|
+
"9400011403","Solution Proposal","","Medium","SMAN-9400011403 | Summary","http://url/to/source/ticket/9400011403"
|
141
|
+
"9400011380","Tester Action","","Medium","SMAN-9400011380 | Summary","http://url/to/source/ticket/9400011380"
|
142
|
+
"9400011705","Wait for Defect Correction","","Medium","SMAN-9400011705 | Summary","http://url/to/source/ticket/9400011705"
|
143
|
+
"9400011437","Wait on External","","Medium","SMAN-9400011437 | Summary","http://url/to/source/ticket/9400011437"
|
144
|
+
"9400011466","Withdrawn","Cannot Reproduce","Medium","SMAN-9400011466 | Summary","http://url/to/source/ticket/9400011466"
|
145
|
+
"3000017667","Closed","Done","Medium","SMAN-3000017667 | Summary","http://url/to/source/ticket/3000017667"
|
146
|
+
"3000018423","No Error","","Medium","SMAN-3000018423 | Summary","http://url/to/source/ticket/3000018423"
|
191
147
|
"""
|
192
148
|
|
193
149
|
Scenario: Processing an invalid Excel file generates an error with relevant information
|
@@ -213,9 +169,6 @@ Feature: Transform SAP tickets to Jira format
|
|
213
169
|
resolution_mapping:
|
214
170
|
defaults_to: keep_original_value
|
215
171
|
|
216
|
-
team_mapping:
|
217
|
-
defaults_to: keep_original_value
|
218
|
-
|
219
172
|
"""
|
220
173
|
And a file named "queue/10.extracted/invalid_file.xlsx" with:
|
221
174
|
"""
|
@@ -249,10 +202,7 @@ Feature: Transform SAP tickets to Jira format
|
|
249
202
|
defaults_to: keep_original_value
|
250
203
|
|
251
204
|
resolution_mapping:
|
252
|
-
defaults_to:
|
253
|
-
|
254
|
-
team_mapping:
|
255
|
-
defaults_to: keep_original_value
|
205
|
+
defaults_to: blank_value
|
256
206
|
|
257
207
|
"""
|
258
208
|
And an Excel file named "queue/10.extracted/sap_solution_manager_defects_with_missing_priority_column.xlsx"
|
@@ -291,10 +241,7 @@ Feature: Transform SAP tickets to Jira format
|
|
291
241
|
defaults_to: keep_original_value
|
292
242
|
|
293
243
|
resolution_mapping:
|
294
|
-
defaults_to:
|
295
|
-
|
296
|
-
team_mapping:
|
297
|
-
defaults_to: keep_original_value
|
244
|
+
defaults_to: blank_value
|
298
245
|
|
299
246
|
"""
|
300
247
|
And an Excel file named "queue/10.extracted/sap_solution_manager_defects.xlsx"
|