1616
1717import { RestOperationData , VersionRestOperation } from './rest.types'
1818import { areDeprecatedOriginsNotEmpty , isOperationRemove , removeComponents } from '../../utils'
19- import { apiDiff , breaking , COMPARE_MODE_OPERATION , Diff , DiffAction , semiBreaking } from '@netcracker/qubership-apihub-api-diff'
19+ import {
20+ apiDiff ,
21+ breaking ,
22+ COMPARE_MODE_OPERATION ,
23+ Diff ,
24+ DiffAction ,
25+ risky ,
26+ } from '@netcracker/qubership-apihub-api-diff'
2027import { MESSAGE_SEVERITY , NORMALIZE_OPTIONS , ORIGINS_SYMBOL } from '../../consts'
2128import { BREAKING_CHANGE_TYPE , CompareOperationsPairContext , SEMI_BREAKING_CHANGE_TYPE } from '../../types'
2229import { isObject } from '@netcracker/qubership-apihub-json-crawl'
@@ -85,7 +92,7 @@ async function reclassifyBreakingChanges(
8592 const deprecatedInVersionsCount = previousOperation ?. deprecatedInPreviousVersions ?. length ?? 0
8693 if ( isOperationRemove ( diff ) && deprecatedInVersionsCount > 1 ) {
8794 console . log ( 'Тутэн' )
88- diff . type = semiBreaking
95+ diff . type = risky
8996 continue
9097 }
9198
@@ -96,7 +103,7 @@ async function reclassifyBreakingChanges(
96103 if ( ! isObject ( diff . beforeNormalizedValue ) ) {
97104 ctx . notifications . push ( {
98105 severity : MESSAGE_SEVERITY . Error ,
99- message : '[Semi-breaking validation] Something wrong with beforeNormalizedValue from diff' ,
106+ message : '[Risky validation] Something wrong with beforeNormalizedValue from diff' ,
100107 } )
101108 continue
102109 }
@@ -105,7 +112,7 @@ async function reclassifyBreakingChanges(
105112 if ( ! areDeprecatedOriginsNotEmpty ( diff . beforeNormalizedValue ) ) {
106113 ctx . notifications . push ( {
107114 severity : MESSAGE_SEVERITY . Error ,
108- message : '[Semi-breaking validation] Something wrong with origins' ,
115+ message : '[Risky validation] Something wrong with origins' ,
109116 } )
110117 continue
111118 }
@@ -128,16 +135,20 @@ async function reclassifyBreakingChanges(
128135 }
129136
130137 if ( deprecatedItem && deprecatedItem ?. deprecatedInPreviousVersions ?. length > 1 ) {
131- diff . type = semiBreaking
138+ diff . type = risky
132139 }
133140 }
141+
142+
134143 // mark removed required status of the property as semi-breaking
135144 if ( diffs . length ) {
136145 const requiredProperties = findRequiredRemovedProperties ( mergedJso , diffs )
146+ //console.log('requiredProperties----->', requiredProperties)
137147
138148 requiredProperties ?. forEach ( prop => {
149+ // console.log('requiredProperties----->', prop.propDiff)
139150 if ( prop . propDiff . type === SEMI_BREAKING_CHANGE_TYPE && prop . requiredDiff ?. type === BREAKING_CHANGE_TYPE ) {
140- prop . requiredDiff . type = semiBreaking
151+ prop . requiredDiff . type = risky
141152 }
142153 } )
143154 }
0 commit comments