diff --git a/package-lock.json b/package-lock.json index 4bd2d4a..2971709 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@netcracker/qubership-apihub-api-processor", - "version": "3.0.6", + "version": "3.0.6-feature-rename-semi-breaking-changes.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@netcracker/qubership-apihub-api-processor", - "version": "3.0.6", + "version": "3.0.6-feature-rename-semi-breaking-changes.0", "license": "Apache-2.0", "dependencies": { - "@netcracker/qubership-apihub-api-diff": "1.0.4", + "@netcracker/qubership-apihub-api-diff": "feature-rename-semi-breaking-changes", "@netcracker/qubership-apihub-api-unifier": "1.0.4", "@netcracker/qubership-apihub-graphapi": "1.0.8", "@netcracker/qubership-apihub-json-crawl": "1.0.4", @@ -1749,9 +1749,9 @@ } }, "node_modules/@netcracker/qubership-apihub-api-diff": { - "version": "1.0.4", - "resolved": "https://npm.pkg.github.com/download/@netcracker/qubership-apihub-api-diff/1.0.4/e1013aba1eb2d5e29d5f49bd9b6ffe9f247287d0", - "integrity": "sha512-unF/MwiGYS4QO8/JFOsiOx07skoNnYywXLWqcnjFq/xqEDpirZfq5A6Tq/7zdL87E7sOY2UMQjvt1UQ0U/qSHw==", + "version": "1.0.5-feature-rename-semi-breaking-changes.20250217072428", + "resolved": "https://npm.pkg.github.com/download/@netcracker/qubership-apihub-api-diff/1.0.5-feature-rename-semi-breaking-changes.20250217072428/b5020a798201451a731e2b4c4aa94f20f2140d97", + "integrity": "sha512-2k8kDR5LvPsS2LO0jTHWSA9tGALhit1BuBnAsi09TpSxlvR0xoyYwNwcGbz7MAKu38ZpviwSrODSMqLnjfL+Vw==", "dependencies": { "@netcracker/qubership-apihub-api-unifier": "1.0.4", "@netcracker/qubership-apihub-json-crawl": "1.0.4", diff --git a/package.json b/package.json index 027d622..32f4276 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netcracker/qubership-apihub-api-processor", - "version": "3.0.6", + "version": "3.0.6-feature-rename-semi-breaking-changes.0", "description": "", "license": "Apache-2.0", "module": "dist/esm/src/index.js", @@ -34,10 +34,10 @@ "release-finish": "release-finish" }, "dependencies": { - "@netcracker/qubership-apihub-api-diff": "1.0.4", + "@netcracker/qubership-apihub-api-diff": "feature-rename-semi-breaking-changes", "@netcracker/qubership-apihub-api-unifier": "1.0.4", - "@netcracker/qubership-apihub-json-crawl": "1.0.4", "@netcracker/qubership-apihub-graphapi": "1.0.8", + "@netcracker/qubership-apihub-json-crawl": "1.0.4", "adm-zip": "0.5.10", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", diff --git a/src/consts.ts b/src/consts.ts index c7e8d12..ee8c7b5 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -20,7 +20,7 @@ import { BREAKING_CHANGE_TYPE, ChangeSummary, DEPRECATED_CHANGE_TYPE, - NON_BREAKING_CHANGE_TYPE, + NON_BREAKING_CHANGE_TYPE, RISKY_CHANGE_SEVERITY, SEMI_BREAKING_CHANGE_TYPE, UNCLASSIFIED_CHANGE_TYPE, } from './types' @@ -133,6 +133,7 @@ export const NORMALIZE_OPTIONS: NormalizeOptions = { export const EMPTY_CHANGE_SUMMARY: ChangeSummary = { [BREAKING_CHANGE_TYPE]: 0, + [RISKY_CHANGE_SEVERITY]: 0, [NON_BREAKING_CHANGE_TYPE]: 0, [SEMI_BREAKING_CHANGE_TYPE]: 0, [DEPRECATED_CHANGE_TYPE]: 0, diff --git a/src/types/external/comparison.ts b/src/types/external/comparison.ts index 612014c..371ac9f 100644 --- a/src/types/external/comparison.ts +++ b/src/types/external/comparison.ts @@ -51,6 +51,8 @@ export const UNCLASSIFIED_CHANGE_TYPE = 'unclassified' export const SEMI_BREAKING_CHANGE_TYPE = 'semi-breaking' export const DEPRECATED_CHANGE_TYPE = 'deprecated' export const ANNOTATION_CHANGE_TYPE = 'annotation' +export const RISKY_CHANGE_SEVERITY = 'risky' + export type ChangeSummary = Record export type ImpactedOperationSummary = Record diff --git a/src/utils/builder.ts b/src/utils/builder.ts index 6c24d82..1120ff3 100644 --- a/src/utils/builder.ts +++ b/src/utils/builder.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ApiAudienceTransition } from './../types/external/comparison' +import { ApiAudienceTransition, RISKY_CHANGE_SEVERITY } from './../types/external/comparison' import { ApiKind, ChangeSummary, ResolvedOperation } from '../types' import { ANNOTATION_CHANGE_TYPE, @@ -106,6 +106,7 @@ export const removeSecurityDuplicates = (originalArray: any[]): any[] => { export const calculateChangeSummary = (changes: Diff[]): ChangeSummary => ({ [BREAKING_CHANGE_TYPE]: countByType(BREAKING_CHANGE_TYPE, changes), + [RISKY_CHANGE_SEVERITY]: countByType(RISKY_CHANGE_SEVERITY, changes), [NON_BREAKING_CHANGE_TYPE]: countByType(NON_BREAKING_CHANGE_TYPE, changes), [UNCLASSIFIED_CHANGE_TYPE]: countByType(UNCLASSIFIED_CHANGE_TYPE, changes), [SEMI_BREAKING_CHANGE_TYPE]: countByType(SEMI_BREAKING_CHANGE_TYPE, changes), @@ -118,6 +119,7 @@ export const countByType = (changeType: string, changes: Diff[]): number => { } export const calculateImpactedSummary = (changeSummaries: ChangeSummary[]): ImpactedOperationSummary => ({ + [RISKY_CHANGE_SEVERITY]: checkIfHaveChanges(RISKY_CHANGE_SEVERITY, changeSummaries), [BREAKING_CHANGE_TYPE]: checkIfHaveChanges(BREAKING_CHANGE_TYPE, changeSummaries), [NON_BREAKING_CHANGE_TYPE]: checkIfHaveChanges(NON_BREAKING_CHANGE_TYPE, changeSummaries), [UNCLASSIFIED_CHANGE_TYPE]: checkIfHaveChanges(UNCLASSIFIED_CHANGE_TYPE, changeSummaries),