@@ -32,157 +32,8 @@ const BreakingChangesModule = (function() {
32
32
let versionOrder = [ ] ;
33
33
let migrationMap = { sourceToTargets : { } , targetToSources : { } } ;
34
34
35
- // Breaking changes data
36
- const breakingChangesData = [
37
- {
38
- title : "Amazon OpenSearch Service: Upgrade Guidance" ,
39
- url : "https://docs.aws.amazon.com/opensearch-service/latest/developerguide/version-migration.html" ,
40
- introducedIn : "OpenSearch 1.3" ,
41
- affects : {
42
- minSource : "Elasticsearch 5.6" ,
43
- maxTarget : "OpenSearch 2.19"
44
- } ,
45
- comp : [ ]
46
- } ,
47
- {
48
- title : "Amazon OpenSearch Service: Rename - Summary of changes" ,
49
- url : "https://docs.aws.amazon.com/opensearch-service/latest/developerguide/rename.html" ,
50
- introducedIn : "OpenSearch 1.3" ,
51
- affects : {
52
- minSource : "Elasticsearch 5.6" ,
53
- maxTarget : "OpenSearch 2.19"
54
- } ,
55
- comp : [ ]
56
- } ,
57
- {
58
- title : "OpenSearch 2.0: Remove mapping types parameter" ,
59
- url : "/docs/latest/breaking-changes/#remove-mapping-types-parameter" ,
60
- introducedIn : "OpenSearch 2.19" ,
61
- affects : {
62
- minSource : "Elasticsearch 5.6" ,
63
- maxTarget : "OpenSearch 2.19"
64
- } ,
65
- comp : [ ] ,
66
- transformation : {
67
- title : "Type Mapping Deprecation" ,
68
- url : "/migration-assistant/migration-phases/planning-your-migration/handling-type-mapping-deprecation/"
69
- }
70
- } ,
71
- {
72
- title : "OpenSearch Notifications Plugins" ,
73
- url : "/breaking-changes/#add-opensearch-notifications-plugins" ,
74
- introducedIn : "OpenSearch 2.19" ,
75
- affects : {
76
- minSource : "Elasticsearch 5.6" ,
77
- maxTarget : "OpenSearch 2.19"
78
- } ,
79
- comp : [ ]
80
- } ,
81
- {
82
- title : "OpenSearch 2.0: Client JDK 8 Support Dropped" ,
83
- url : "/docs/latest/breaking-changes/#drop-support-for-jdk-8" ,
84
- introducedIn : "OpenSearch 2.19" ,
85
- affects : {
86
- minSource : "Elasticsearch 5.6" ,
87
- maxTarget : "OpenSearch 2.19"
88
- } ,
89
- comp : [ ]
90
- } ,
91
- {
92
- title : "Removal of Types in Elasticsearch 7.x" ,
93
- url : "https://www.elastic.co/guide/en/elasticsearch/reference/7.10/removal-of-types.html" ,
94
- introducedIn : "Elasticsearch 7.10" ,
95
- affects : {
96
- minSource : "Elasticsearch 5.6" ,
97
- maxTarget : "OpenSearch 2.19"
98
- } ,
99
- comp : [ ] ,
100
- transformation : {
101
- title : "Type Mapping Deprecation" ,
102
- url : "/migration-assistant/migration-phases/planning-your-migration/handling-type-mapping-deprecation/"
103
- }
104
- } ,
105
- {
106
- title : "Elasticsearch 6.0 Breaking Changes" ,
107
- url : "https://www.elastic.co/guide/en/elasticsearch/reference/6.8/breaking-changes-6.0.html" ,
108
- introducedIn : "Elasticsearch 6.8" ,
109
- affects : {
110
- minSource : "Elasticsearch 5.6" ,
111
- maxTarget : "OpenSearch 2.19"
112
- } ,
113
- comp : [ ]
114
- } ,
115
- {
116
- title : "Elasticsearch 6.7 Breaking Changes" ,
117
- url : "https://www.elastic.co/guide/en/elasticsearch/reference/6.8/breaking-changes-6.7.html" ,
118
- introducedIn : "Elasticsearch 6.8" ,
119
- affects : {
120
- minSource : "Elasticsearch 5.6" ,
121
- maxTarget : "OpenSearch 2.19"
122
- } ,
123
- comp : [ ]
124
- } ,
125
- {
126
- title : "Kibana 6.0 Breaking Changes" ,
127
- url : "https://www.elastic.co/guide/en/kibana/6.8/breaking-changes-6.0.html" ,
128
- introducedIn : "Elasticsearch 6.8" ,
129
- affects : {
130
- minSource : "Elasticsearch 5.6" ,
131
- maxTarget : "OpenSearch 2.19"
132
- } ,
133
- comp : [ "dashboards" ]
134
- } ,
135
- {
136
- title : "Kibana 6.3 Breaking Changes" ,
137
- url : "https://www.elastic.co/guide/en/kibana/6.8/release-notes-6.3.0.html#breaking-6.3.0" ,
138
- introducedIn : "Elasticsearch 6.8" ,
139
- affects : {
140
- minSource : "Elasticsearch 5.6" ,
141
- maxTarget : "OpenSearch 2.19"
142
- } ,
143
- comp : [ "dashboards" ]
144
- } ,
145
- {
146
- title : "Kibana 6.4 Breaking Changes" ,
147
- url : "https://www.elastic.co/guide/en/kibana/6.8/release-notes-6.4.0.html#breaking-6.4.0" ,
148
- introducedIn : "Elasticsearch 6.8" ,
149
- affects : {
150
- minSource : "Elasticsearch 5.6" ,
151
- maxTarget : "OpenSearch 2.19"
152
- } ,
153
- comp : [ "dashboards" ]
154
- } ,
155
- {
156
- title : "Kibana 6.6 Breaking Changes" ,
157
- url : "https://www.elastic.co/guide/en/kibana/6.8/release-notes-6.6.0.html#breaking-6.6.0" ,
158
- introducedIn : "Elasticsearch 6.8" ,
159
- affects : {
160
- minSource : "Elasticsearch 5.6" ,
161
- maxTarget : "OpenSearch 2.19"
162
- } ,
163
- comp : [ "dashboards" ]
164
- } ,
165
- {
166
- title : "Kibana 6.7 Breaking Changes" ,
167
- url : "https://www.elastic.co/guide/en/kibana/6.8/release-notes-6.7.0.html#breaking-6.7.0" ,
168
- introducedIn : "Elasticsearch 6.8" ,
169
- affects : {
170
- minSource : "Elasticsearch 5.6" ,
171
- maxTarget : "OpenSearch 2.19"
172
- } ,
173
- comp : [ "dashboards" ]
174
- } ,
175
- {
176
- title : "Kibana 7.0 Breaking Changes" ,
177
- url : "https://www.elastic.co/guide/en/kibana/7.10/breaking-changes-7.0.html" ,
178
- introducedIn : "Elasticsearch 7.10" ,
179
- affects : {
180
- minSource : "Elasticsearch 6.8" ,
181
- maxTarget : "OpenSearch 2.19"
182
- } ,
183
- comp : [ "dashboards" ]
184
- }
185
- ] ;
35
+ // Breaking changes data - will be loaded from the data attribute
36
+ let breakingChangesData = [ ] ;
186
37
187
38
/**
188
39
* Version Manager - Handles all version-related operations
@@ -282,11 +133,16 @@ const BreakingChangesModule = (function() {
282
133
// 1. The breaking change was introduced in a version that is between source and target (inclusive of target)
283
134
// 2. The source version is at or after the minimum source version affected
284
135
// 3. The target version is at or before the maximum target version affected
136
+
137
+ // Handle optional affects field by using defaults if not present
138
+ const minSource = change . affects && change . affects . minSource ? change . affects . minSource : versions [ 0 ] ; // Default to oldest version
139
+ const maxTarget = change . affects && change . affects . maxTarget ? change . affects . maxTarget : versions [ versions . length - 1 ] ; // Default to newest version
140
+
285
141
const versionMatch =
286
142
introducedInIdx <= targetVersionIdx && // Breaking change was introduced at or before target
287
143
sourceVersionIdx < targetVersionIdx && // Valid migration path (source before target)
288
- sourceVersionIdx >= VersionManager . getVersionIndex ( change . affects . minSource ) && // Source is affected
289
- targetVersionIdx <= VersionManager . getVersionIndex ( change . affects . maxTarget ) ; // Target is affected
144
+ sourceVersionIdx >= VersionManager . getVersionIndex ( minSource ) && // Source is affected
145
+ targetVersionIdx <= VersionManager . getVersionIndex ( maxTarget ) ; // Target is affected
290
146
291
147
// For component filtering:
292
148
// - Always include changes with empty comp array (default/data components)
@@ -317,6 +173,27 @@ const BreakingChangesModule = (function() {
317
173
* @param {Array } migrationPaths - Array of migration paths from YAML
318
174
*/
319
175
function initialize ( migrationPaths ) {
176
+ // Get the migration data element
177
+ const migrationDataElement = document . getElementById ( 'migration-data' ) ;
178
+
179
+ if ( ! migrationDataElement ) {
180
+ console . error ( 'Migration data element not found' ) ;
181
+ return ;
182
+ }
183
+
184
+ // Load breaking changes data if available
185
+ if ( migrationDataElement . dataset . breakingChanges ) {
186
+ try {
187
+ breakingChangesData = JSON . parse ( migrationDataElement . dataset . breakingChanges ) ;
188
+ console . log ( 'Loaded breaking changes data:' , breakingChangesData . length ) ;
189
+ } catch ( error ) {
190
+ console . error ( 'Failed to parse breaking changes data:' , error ) ;
191
+ breakingChangesData = [ ] ;
192
+ }
193
+ } else {
194
+ console . error ( 'Breaking changes data not found in migration-data element' ) ;
195
+ breakingChangesData = [ ] ;
196
+ }
320
197
try {
321
198
// Transform the data structure from YAML format to the expected JavaScript object format
322
199
const validMigrations = migrationPaths . reduce ( ( acc , path ) => {
0 commit comments