Skip to content

Commit 8bbacc1

Browse files
author
Iurii Golovinskii
committed
[FE][Part 2] Rename Semi-breaking chang
1 parent 7ed413e commit 8bbacc1

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"release-finish": "release-finish"
3535
},
3636
"dependencies": {
37-
"@netcracker/qubership-apihub-api-diff": "1.0.4",
37+
"@netcracker/qubership-apihub-api-diff": "feature-rename-label-semi-breaking-changes-two",
3838
"@netcracker/qubership-apihub-api-unifier": "1.0.4",
3939
"@netcracker/qubership-apihub-json-crawl": "1.0.4",
4040
"@netcracker/qubership-apihub-graphapi": "1.0.8",

src/apitypes/rest/rest.changes.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616

1717
import { RestOperationData, VersionRestOperation } from './rest.types'
1818
import { 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'
2027
import { MESSAGE_SEVERITY, NORMALIZE_OPTIONS, ORIGINS_SYMBOL } from '../../consts'
2128
import { BREAKING_CHANGE_TYPE, CompareOperationsPairContext, SEMI_BREAKING_CHANGE_TYPE } from '../../types'
2229
import { 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
}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ export * from './components'
2121
export * from './consts'
2222
export * from './types'
2323
export { calculateChangeId, calculateDiffId, calculateImpactedSummary, convertToSlug, removeComponents } from './utils'
24+
console.log('dfsfsdfsdfsdf TEST')

src/types/external/comparison.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { ApiAudience } from '../package'
1818
import { OperationsApiType, PackageId, VersionId } from './types'
19-
import { ClassifierType, DiffType } from '@netcracker/qubership-apihub-api-diff'
19+
import { ClassifierType, DiffType, risky } from '@netcracker/qubership-apihub-api-diff'
2020

2121
export type VersionComparisonResolver = (
2222
version: VersionId,
@@ -48,7 +48,7 @@ export interface OperationType {
4848
export const BREAKING_CHANGE_TYPE = 'breaking'
4949
export const NON_BREAKING_CHANGE_TYPE = 'non-breaking'
5050
export const UNCLASSIFIED_CHANGE_TYPE = 'unclassified'
51-
export const SEMI_BREAKING_CHANGE_TYPE = 'semi-breaking'
51+
export const SEMI_BREAKING_CHANGE_TYPE = risky
5252
export const DEPRECATED_CHANGE_TYPE = 'deprecated'
5353
export const ANNOTATION_CHANGE_TYPE = 'annotation'
5454

0 commit comments

Comments
 (0)