@elisra-devops/docgen-data-provider 1.75.0 → 1.77.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.
@@ -0,0 +1,120 @@
1
+ export type MewpRunStatus = 'Pass' | 'Fail' | 'Not Run';
2
+ export interface MewpExternalFileRef {
3
+ url?: string;
4
+ text?: string;
5
+ name?: string;
6
+ bucketName?: string;
7
+ objectName?: string;
8
+ etag?: string;
9
+ contentType?: string;
10
+ sizeBytes?: number;
11
+ sourceType?: 'mewpExternalIngestion' | 'generic';
12
+ }
13
+ export interface MewpCoverageRequestOptions {
14
+ useRelFallback?: boolean;
15
+ externalBugsFile?: MewpExternalFileRef | null;
16
+ externalL3L4File?: MewpExternalFileRef | null;
17
+ mergeDuplicateL2Cells?: boolean;
18
+ }
19
+ export interface MewpInternalValidationRequestOptions {
20
+ useRelFallback?: boolean;
21
+ }
22
+ export interface MewpRequirementStepSummary {
23
+ passed: number;
24
+ failed: number;
25
+ notRun: number;
26
+ }
27
+ export interface MewpL2RequirementWorkItem {
28
+ workItemId: number;
29
+ requirementId: string;
30
+ baseKey: string;
31
+ title: string;
32
+ subSystem: string;
33
+ responsibility: string;
34
+ linkedTestCaseIds: number[];
35
+ relatedWorkItemIds: number[];
36
+ areaPath: string;
37
+ }
38
+ export interface MewpL2RequirementFamily {
39
+ requirementId: string;
40
+ baseKey: string;
41
+ title: string;
42
+ subSystem: string;
43
+ responsibility: string;
44
+ linkedTestCaseIds: number[];
45
+ }
46
+ export interface MewpLinkedRequirementEntry {
47
+ baseKeys: Set<string>;
48
+ fullCodes: Set<string>;
49
+ bugIds: Set<number>;
50
+ }
51
+ export type MewpLinkedRequirementsByTestCase = Map<number, MewpLinkedRequirementEntry>;
52
+ export type MewpRequirementIndex = Map<string, Map<number, MewpRequirementStepSummary>>;
53
+ export interface MewpBugLink {
54
+ id: number;
55
+ title: string;
56
+ responsibility: string;
57
+ requirementBaseKey?: string;
58
+ }
59
+ export interface MewpL3L4Link {
60
+ id: string;
61
+ title: string;
62
+ level: 'L3' | 'L4';
63
+ }
64
+ export interface MewpCoverageBugCell {
65
+ id: number | '';
66
+ title: string;
67
+ responsibility: string;
68
+ }
69
+ export interface MewpCoverageL3L4Cell {
70
+ l3Id: string;
71
+ l3Title: string;
72
+ l4Id: string;
73
+ l4Title: string;
74
+ }
75
+ export interface MewpCoverageRow {
76
+ 'L2 REQ ID': string;
77
+ 'L2 REQ Title': string;
78
+ 'L2 SubSystem': string;
79
+ 'L2 Run Status': MewpRunStatus;
80
+ 'Bug ID': number | '';
81
+ 'Bug Title': string;
82
+ 'Bug Responsibility': string;
83
+ 'L3 REQ ID': string;
84
+ 'L3 REQ Title': string;
85
+ 'L4 REQ ID': string;
86
+ 'L4 REQ Title': string;
87
+ }
88
+ export interface MewpCoverageFlatPayload {
89
+ sheetName: string;
90
+ columnOrder: string[];
91
+ rows: MewpCoverageRow[];
92
+ }
93
+ export interface MewpInternalValidationRow {
94
+ 'Test Case ID': number;
95
+ 'Test Case Title': string;
96
+ 'Mentioned but Not Linked': string;
97
+ 'Linked but Not Mentioned': string;
98
+ 'Validation Status': 'Pass' | 'Fail';
99
+ }
100
+ export interface MewpInternalValidationFlatPayload {
101
+ sheetName: string;
102
+ columnOrder: string[];
103
+ rows: MewpInternalValidationRow[];
104
+ }
105
+ export interface MewpExternalTableValidationResult {
106
+ tableType: 'bugs' | 'l3l4';
107
+ sourceName: string;
108
+ valid: boolean;
109
+ headerRow: 'A3' | 'A1' | '';
110
+ matchedRequiredColumns: number;
111
+ totalRequiredColumns: number;
112
+ missingRequiredColumns: string[];
113
+ rowCount: number;
114
+ message: string;
115
+ }
116
+ export interface MewpExternalFilesValidationResponse {
117
+ valid: boolean;
118
+ bugs?: MewpExternalTableValidationResult;
119
+ l3l4?: MewpExternalTableValidationResult;
120
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mewp-reporting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mewp-reporting.js","sourceRoot":"","sources":["../../src/models/mewp-reporting.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { OpenPcrRequest } from '../models/tfs-data';
2
+ import type { MewpCoverageFlatPayload, MewpExternalFilesValidationResponse, MewpCoverageRequestOptions, MewpExternalFileRef, MewpInternalValidationFlatPayload, MewpInternalValidationRequestOptions } from '../models/mewp-reporting';
2
3
  /**
3
4
  * Provides methods to fetch, process, and summarize test data from Azure DevOps.
4
5
  *
@@ -23,6 +24,7 @@ import { OpenPcrRequest } from '../models/tfs-data';
23
24
  */
24
25
  export default class ResultDataProvider {
25
26
  private static readonly MEWP_L2_COVERAGE_COLUMNS;
27
+ private static readonly INTERNAL_VALIDATION_COLUMNS;
26
28
  orgUrl: string;
27
29
  token: string;
28
30
  private limit;
@@ -30,6 +32,8 @@ export default class ResultDataProvider {
30
32
  private testToAssociatedItemMap;
31
33
  private querySelectedColumns;
32
34
  private workItemDiscussionCache;
35
+ private mewpExternalTableUtils;
36
+ private mewpExternalIngestionUtils;
33
37
  constructor(orgUrl: string, token: string);
34
38
  /**
35
39
  * Combines the results of test group result summary, test results summary, and detailed results summary into a single key-value pair array.
@@ -65,37 +69,73 @@ export default class ResultDataProvider {
65
69
  * Builds MEWP L2 requirement coverage rows for audit reporting.
66
70
  * Rows are one Requirement-TestCase pair; uncovered requirements are emitted with empty test-case columns.
67
71
  */
68
- getMewpL2CoverageFlatResults(testPlanId: string, projectName: string, selectedSuiteIds: number[] | undefined): Promise<{
69
- sheetName: string;
70
- columnOrder: string[];
71
- rows: any[];
72
- }>;
72
+ getMewpL2CoverageFlatResults(testPlanId: string, projectName: string, selectedSuiteIds: number[] | undefined, linkedQueryRequest?: any, options?: MewpCoverageRequestOptions): Promise<MewpCoverageFlatPayload>;
73
+ getMewpInternalValidationFlatResults(testPlanId: string, projectName: string, selectedSuiteIds: number[] | undefined, linkedQueryRequest?: any, options?: MewpInternalValidationRequestOptions): Promise<MewpInternalValidationFlatPayload>;
74
+ validateMewpExternalFiles(options: {
75
+ externalBugsFile?: MewpExternalFileRef | null;
76
+ externalL3L4File?: MewpExternalFileRef | null;
77
+ }): Promise<MewpExternalFilesValidationResponse>;
73
78
  /**
74
79
  * Mapping each attachment to a proper URL for downloading it
75
80
  * @param runResults Array of run results
76
81
  */
77
82
  mapAttachmentsUrl(runResults: any[], project: string): any[];
78
83
  private buildMewpCoverageSheetName;
84
+ private buildInternalValidationSheetName;
79
85
  private createMewpCoverageRow;
86
+ private createEmptyMewpCoverageBugCell;
87
+ private createEmptyMewpCoverageL3L4Cell;
88
+ private buildMewpCoverageL3L4Rows;
80
89
  private formatMewpCustomerId;
81
90
  private buildMewpCoverageRows;
91
+ private resolveCoverageBugResponsibility;
92
+ private resolveMewpL2RunStatus;
93
+ private fetchMewpScopedTestData;
94
+ private extractRelNumberFromSuite;
95
+ private resolveMaxRelNumberFromSuites;
96
+ private reduceToLatestRelRunPerTestCase;
97
+ private loadExternalBugsByTestCase;
98
+ private loadExternalL3L4ByBaseKey;
99
+ private buildRequirementSapWbsByBaseKey;
100
+ private isExternalStateInScope;
101
+ private invertBaseRequirementLinks;
82
102
  private buildMewpTestCaseTitleMap;
83
103
  private extractMewpTestCaseId;
84
104
  private buildTestCaseStepsXmlMap;
85
105
  private extractStepsXmlFromWorkItemFields;
86
106
  private classifyRequirementStepOutcome;
87
- private accumulateRequirementCountsFromStepText;
107
+ private accumulateRequirementCountsFromActionResults;
108
+ private resolveRequirementStatusForWindow;
88
109
  private extractRequirementCodesFromText;
110
+ private extractRequirementMentionsFromExpectedSteps;
111
+ private extractRequirementCodesFromExpectedSteps;
112
+ private extractRequirementCodesFromExpectedText;
113
+ private extractRequirementCandidatesFromToken;
114
+ private expandRequirementTokenByComma;
115
+ private normalizeRequirementCodeToken;
89
116
  private normalizeRequirementStepText;
117
+ private resolveValidationStepReference;
90
118
  private toRequirementKey;
91
119
  private fetchMewpL2Requirements;
120
+ private isMewpL2AreaPath;
121
+ private collapseMewpRequirementFamilies;
122
+ private buildRequirementFamilyMap;
123
+ private buildLinkedRequirementsByTestCase;
124
+ private resolveMewpRequirementScopeKeysFromQuery;
125
+ private isTestCaseToRequirementRelation;
126
+ private extractLinkedWorkItemIdFromRelation;
92
127
  private fetchMewpRequirementTypeNames;
93
128
  private fetchWorkItemsByIds;
94
129
  private extractLinkedTestCaseIdsFromRequirement;
130
+ private extractLinkedWorkItemIdsFromRelations;
95
131
  private extractMewpRequirementIdentifier;
96
132
  private deriveMewpResponsibility;
133
+ private deriveMewpSubSystem;
134
+ private resolveBugResponsibility;
97
135
  private resolveMewpResponsibility;
136
+ private isExcludedL3L4BySapWbs;
98
137
  private normalizeMewpRequirementCode;
138
+ private normalizeMewpRequirementCodeWithSuffix;
99
139
  private toMewpComparableText;
100
140
  private fetchTestPlanName;
101
141
  /**