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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a75b95b01e3dcdc1937e0b795196c22c1bf351e856fe07880c2151b1c7f2eeee
4
- data.tar.gz: e5c1ab35f039f7e1e07bfe1ad06103053602f25a2c7f17273730b0383cc7f871
3
+ metadata.gz: c470d25146cd29253a36275e23181f072d7131333f271f748ebe3560d9849825
4
+ data.tar.gz: 72393510381f5d4abdd4aa3bccafbec872fc30f585ddee5fdf7a8ae4e0f28f2e
5
5
  SHA512:
6
- metadata.gz: 5c0923f1770341ee1e9c106c6073c60c7316bb58694069b9abffa5e023ed538d83a4a8af195050da47d9d664a8176adc5edaff7c03bea88c24b5e22869decf2c
7
- data.tar.gz: c15c602ec455f084eddcf051644e359783ff3ac2366aa4935233a97731d28c3731f2c31c540161d563be626e7c34237cde171975ffa5725d1eb436d7f8ae1bc9
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
- * have an overall transparency about all the activities pertaining to a project/product,
9
- * track progress
10
- * act accordingly
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 TODO: GEM_NAME
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 TODO: GEM_NAME
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
- ### Target Jira Ticket Type Workflow Expectation - Any to Any
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: keep_original_value
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","Team","Summary"
17
- "10001","Open","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
18
- "10002","In Process","","Highest","A16 Platform","SMAN-10002 | Database deadlock during order processing (10002)"
19
- "10003","Confirmed","Fixed","Medium","A16 Logistic","SMAN-10003 | Invalid date format in SOAP response (10003)"
20
- "10004","Closed","Done","Low","A16 Market","SMAN-10004 | App crashes when offline on Android 12 (10004)"
21
- "10005","Open","","High","A16 CRM","SMAN-10005 | Session tokens not properly invalidated (10005)"
22
- "10006","Solution Proposal","","Medium","A16 Supply","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)"
23
- "10007","Withdrawn","Won't Do","Low","A16 E2E-Test","SMAN-10007 | Test data missing edge case scenarios (10007)"
24
- "10008","Open","","Highest","A16 Markets","SMAN-10008 | Memory leak in caching implementation (10008)"
25
- "10009","Wait on External","","Medium","A16 Platform","SMAN-10009 | Inconsistent button styles across modules (10009)"
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 | team | summary | source ticket url |
30
- | Open | | Highest | A16 Restaurant | SMAN-10001 \| Login page randomly fails to load CSS assets (10001) | https://sap.example/id/10001 |
31
- | In Process | | Highest | A16 Platform | SMAN-10002 \| Database deadlock during order processing (10002) | https://sap.example/id/10002 |
32
- | Confirmed | Fixed | Medium | A16 Logistic | SMAN-10003 \| Invalid date format in SOAP response (10003) | https://sap.example/id/10003 |
33
- | Closed | Done | Low | A16 Market | SMAN-10004 \| App crashes when offline on Android 12 (10004) | https://sap.example/id/10004 |
34
- | Open | | High | A16 CRM | SMAN-10005 \| Session tokens not properly invalidated (10005) | https://sap.example/id/10005 |
35
- | Solution Proposal | | Medium | A16 Supply | SMAN-10006 \| Jenkins pipeline timeout on large builds (10006) | https://sap.example/id/10006 |
36
- | Withdrawn | Won't Do | Low | A16 E2E-Test | SMAN-10007 \| Test data missing edge case scenarios (10007) | https://sap.example/id/10007 |
37
- | Open | | Highest | A16 Markets | SMAN-10008 \| Memory leak in caching implementation (10008) | https://sap.example/id/10008 |
38
- | Wait on External | | Medium | A16 Platform | SMAN-10009 \| Inconsistent button styles across modules (10009) | https://sap.example/id/10009 |
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","Team","Summary"
45
- "10001","Open","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
46
- "10002","In Process","","Highest","A16 Platform","SMAN-10002 | Database deadlock during order processing (10002)"
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","Team","Summary"
51
- "10001","Open","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
52
- "10002","In Process","","Highest","A16 Platform","SMAN-10002 | Database deadlock during order processing (10002)"
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 | team | summary | source ticket url |
57
- | Open | | Highest | A16 Restaurant | SMAN-10001 \| Login page randomly fails to load CSS assets (10001) | https://sap.example/id/10001 |
58
- | In Process | | Highest | A16 Platform | SMAN-10002 \| Database deadlock during order processing (10002) | https://sap.example/id/10002 |
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","Team","Summary"
65
- "10001","Open","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
66
- "10002","In Process","","Medium","A16 Platform","SMAN-10002 | Database deadlock during order processing (10002)"
67
- "10016","Confirmed","Fixed","High","Performance Team","SMAN-10016 | Slow response time on product search API (10016)"
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","Team","Summary"
73
- "10001","Closed","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
74
- "10002","In Process","","High","A16 Platform","SMAN-10002 | *Recurring* database deadlock during order processing (10002)"
75
- "10008","Open","","Highest","A16 Markets","SMAN-10008 | Memory leak in caching implementation (10008)"
76
- "10016","Confirmed","Fixed","High","Performance Team","SMAN-10016 | Slow response time on product search API (10016)"
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 | status | resolution | priority | team | summary | source ticket url |
81
- | one update due to status change | Closed | | Highest | A16 Restaurant | SMAN-10001 \| Login page randomly fails to load CSS assets (10001) | https://sap.example/id/10001 |
82
- | one update due to priority and summary updates | In Process | | High | A16 Platform | SMAN-10002 \| *Recurring* database deadlock during order processing (10002) | https://sap.example/id/10002 |
83
- | two updates due to new ticket created (fields and status changes) | Open | | Highest | A16 Markets | SMAN-10008 \| Memory leak in caching implementation (10008) | https://sap.example/id/10008 |
84
- | no update since no status or field change | Confirmed | Fixed | High | Performance Team | SMAN-10016 \| Slow response time on product search API (10016) | https://sap.example/id/10016 |
85
- And only 4 Jira update requests were emitted
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","Team","Summary"
91
- "10001","Open","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
92
- "10002","In Process","","Highest","A16 Platform","SMAN-10002 | Database deadlock during order processing (10002)"
93
- "10003","Confirmed","Fixed","Medium","A16 Logistic","SMAN-10003 | Invalid date format in SOAP response (10003)"
94
- "10004","____ INEXISTING STATUS ____","Done","Low","A16 Market","SMAN-10004 | App crashes when offline on Android 12 (10004)"
95
- "10005","Open","","High","A16 CRM","SMAN-10005 | Session tokens not properly invalidated (10005)"
96
- "10006","Solution Proposal","","Medium","A16 Supply","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)"
97
- "10007","Withdrawn","Won't Do","Low","A16 E2E-Test","SMAN-10007 | Test data missing edge case scenarios (10007)"
98
- "10008","Open","","Highest","A16 Markets","SMAN-10008 | Memory leak in caching implementation (10008)"
99
- "10009","Wait on External","","Medium","A16 Platform","SMAN-10009 | Inconsistent button styles across modules (10009)"
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" team:"A16 Market" summary:"SMAN-10004 | App crashes when offline on Android 12 (10004)">
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","Team","Summary"
113
- "10001","Open","","Highest","A16 Restaurant","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
114
- "10002","In Process","","Highest","A16 Platform","SMAN-10002 | Database deadlock during order processing (10002)"
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:9: error while loading row:
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 ____" team:"A16 Markets" summary:"SMAN-10008 | Memory leak in caching implementation (10008)">
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: keep_original_value
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", "team", "resolution"]
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 | value |
9
- | TICKET_REPLICATOR_SOURCE_TICKET_BASE_URL_ERB | http://url/to/source/ticket/<%= source_id %> |
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
- "New": ""
43
- "Open": ""
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": "Fixed"
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","Team","Summary"
68
- "10001","New","2-High","Frontend","Login page randomly fails to load CSS assets (10001)"
69
- "10002","In Progress","1-Critical","Backend","Database deadlock during order processing (10002)"
70
- "10003","Resolved","3-Medium","Integration","Invalid date format in SOAP response (10003)"
71
- "10004","Closed","4-Low","Mobile","App crashes when offline on Android 12 (10004)"
72
- "10005","Open","2-High","Security","Session tokens not properly invalidated (10005)"
73
- "10006","In Review","3-Medium","DevOps","Jenkins pipeline timeout on large builds (10006)"
74
- "10007","Rejected","4-Low","QA","Test data missing edge case scenarios (10007)"
75
- "10008","Confirmed","1-Critical","Architecture","Memory leak in caching implementation (10008)"
76
- "10009","On Hold","3-Medium","UX","Inconsistent button styles across modules (10009)"
77
- "10010","Fixed","2-High","Performance","Slow response time on product search API (10010)"
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","Team","Summary"
83
- "10001","Open","","High","Web Team","SMAN-10001 | Login page randomly fails to load CSS assets (10001)"
84
- "10002","In Progress","","Highest","Server Team","SMAN-10002 | Database deadlock during order processing (10002)"
85
- "10003","Resolved","Fixed","Medium","Integration Team","SMAN-10003 | Invalid date format in SOAP response (10003)"
86
- "10004","Closed","Done","Low","Mobile Team","SMAN-10004 | App crashes when offline on Android 12 (10004)"
87
- "10005","Open","","High","Security Team","SMAN-10005 | Session tokens not properly invalidated (10005)"
88
- "10006","In Review","","Medium","DevOps Team","SMAN-10006 | Jenkins pipeline timeout on large builds (10006)"
89
- "10007","Closed","Won't Do","Low","Quality Assurance","SMAN-10007 | Test data missing edge case scenarios (10007)"
90
- "10008","Open","","Highest","Architecture Team","SMAN-10008 | Memory leak in caching implementation (10008)"
91
- "10009","Blocked","","Medium","Design Team","SMAN-10009 | Inconsistent button styles across modules (10009)"
92
- "10010","Resolved","Fixed","High","Performance Team","SMAN-10010 | Slow response time on product search API (10010)"
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: keep_original_value
117
- "New":
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": "Fixed"
128
- "Confirmed":
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","Team","Summary"
174
- "3000017049","Closed","Done","Medium","A Team","SMAN-3000017049 | Summary"
175
- "9400011377","Confirmed","","Low","A Team","SMAN-9400011377 | Summary"
176
- "3000016618","Defect Correction in Process","","Medium","A Team","SMAN-3000016618 | Summary"
177
- "9400013805","Deferred","","Medium","A Team","SMAN-9400013805 | Summary"
178
- "9400013816","Forwarded","","High","A Team","SMAN-9400013816 | Summary"
179
- "9400011382","In Process","","Medium","A Team","SMAN-9400011382 | Summary"
180
- "9400011393","Information Required","","Medium","A Team","SMAN-9400011393 | Summary"
181
- "9400011381","New","","Medium","A Team","SMAN-9400011381 | Summary"
182
- "3000016617","No Error","No Error","Medium","A Team","SMAN-3000016617 | Summary"
183
- "9400011372","Open","","Highest","A Team","SMAN-9400011372 | Summary"
184
- "9400011403","Solution Proposal","","Medium","A Team","SMAN-9400011403 | Summary"
185
- "9400011380","Tester Action","","Medium","A Team","SMAN-9400011380 | Summary"
186
- "9400011705","Wait for Defect Correction","","Medium","A Team","SMAN-9400011705 | Summary"
187
- "9400011437","Wait on External","","Medium","A Team","SMAN-9400011437 | Summary"
188
- "9400011466","Withdrawn","Withdrawn","Medium","A Team","SMAN-9400011466 | Summary"
189
- "3000017667","Closed","Done","Medium","Another Team","SMAN-3000017667 | Summary"
190
- "3000018423","No Error","No Error","Medium","A Team","SMAN-3000018423 | Summary"
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: keep_original_value
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: keep_original_value
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"