@@ -170,7 +170,7 @@ Policy Validation Report Summary
170
170
resourceLogicalId : 'DefaultResource' ,
171
171
templatePath : '/path/to/Stage1stack1DDED8B6C.template.json' ,
172
172
} ] ,
173
- } ] , '1.2.3' ) ,
173
+ } ] ) ,
174
174
] ,
175
175
} ) ;
176
176
const stage1 = new core . Stage ( app , 'Stage1' , {
@@ -183,7 +183,7 @@ Policy Validation Report Summary
183
183
resourceLogicalId : 'DefaultResource' ,
184
184
templatePath : '/path/to/Stage1stack1DDED8B6C.template.json' ,
185
185
} ] ,
186
- } ] ) ,
186
+ } ] , '1.2.3' ) ,
187
187
] ,
188
188
} ) ;
189
189
const stage2 = new core . Stage ( app , 'Stage2' , {
@@ -263,6 +263,7 @@ Policy Validation Report Summary
263
263
] ,
264
264
resourceLogicalId : 'DefaultResource' ,
265
265
description : 'do something' ,
266
+ version : '1.2.3' ,
266
267
} ,
267
268
{
268
269
pluginName : 'test-plugin4' ,
@@ -695,20 +696,18 @@ Policy Validation Report Summary
695
696
} ) ;
696
697
697
698
class FakePlugin implements core . IPolicyValidationPluginBeta1 {
698
- private _version ?: string ;
699
-
700
699
constructor (
701
700
public readonly name : string ,
702
701
private readonly violations : PolicyViolationBeta1 [ ] ,
703
- readonly version ?: string ) {
704
- this . _version = version ;
702
+ public readonly version ?: string ,
703
+ public readonly ruleIds ?: string [ ] ) {
705
704
}
706
705
707
706
validate ( _context : core . IPolicyValidationContextBeta1 ) : PolicyValidationPluginReportBeta1 {
708
707
return {
709
708
success : this . violations . length === 0 ,
710
709
violations : this . violations ,
711
- pluginVersion : this . _version ,
710
+ pluginVersion : this . version ,
712
711
} ;
713
712
}
714
713
}
@@ -744,6 +743,7 @@ interface ValidationReportData {
744
743
description ?: string ;
745
744
resourceLogicalId : string ;
746
745
severity ?: string ;
746
+ version ?: string ;
747
747
ruleMetadata ?: { [ key : string ] : string } ;
748
748
}
749
749
@@ -770,6 +770,7 @@ const validationReport = (data: ValidationReportData[]) => {
770
770
expect . stringMatching ( new RegExp ( 'Validation Report' ) ) ,
771
771
expect . stringMatching ( new RegExp ( '-----------------' ) ) ,
772
772
expect . stringMatching ( new RegExp ( `Plugin: ${ d . pluginName } ` ) ) ,
773
+ expect . stringMatching ( new RegExp ( `Version: ${ d . version ?? 'N/A' } ` ) ) ,
773
774
expect . stringMatching ( new RegExp ( `Status: ${ d . status } ` ) ) ,
774
775
expect . stringMatching ( new RegExp ( '\(Violations\)' ) ) ,
775
776
title ,
0 commit comments