Skip to content

Commit d9458bb

Browse files
haonantttHaonan Tang
andauthored
disable non-fatal BinSkim errors (#5621)
Co-authored-by: Haonan Tang <haonantang@microsoft.com>
1 parent 6549492 commit d9458bb

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed

build/AzurePipelinesTemplates/WindowsAppSDK-Build-Per-Platform-Stage.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -193,25 +193,27 @@ stages:
193193
runPREfast : ${{ parameters.runPREfast }}
194194
runApiScan : ${{ parameters.runApiScan }}
195195

196-
- job: ExtractMatrix
197-
pool:
198-
type: windows
199-
isCustom: true
200-
name: 'ProjectReunionESPool-2022'
201-
steps:
202-
- powershell: |
203-
$testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json
204-
$targetPlatform = "${{ parameters.buildPlatform }}"
205-
$filteredMatrix = @{}
206-
foreach ($entry in $testMatrix.PSObject.Properties) {
207-
if ($entry.Value.buildPlatform -eq $targetPlatform) {
208-
$filteredMatrix[$entry.Name] = $entry.Value
196+
# Only run the test matrix extraction job in Build_{buildPlatform} job. The PREfast_{buildPlatform} job don't have the following test stages, don't need this job.
197+
- ${{ if not(parameters.runPREfast) }}:
198+
- job: ExtractMatrix
199+
pool:
200+
type: windows
201+
isCustom: true
202+
name: 'ProjectReunionESPool-2022'
203+
steps:
204+
- powershell: |
205+
$testMatrix = "${{ parameters.testMatrix }}" | ConvertFrom-Json
206+
$targetPlatform = "${{ parameters.buildPlatform }}"
207+
$filteredMatrix = @{}
208+
foreach ($entry in $testMatrix.PSObject.Properties) {
209+
if ($entry.Value.buildPlatform -eq $targetPlatform) {
210+
$filteredMatrix[$entry.Name] = $entry.Value
211+
}
209212
}
210-
}
211-
$matrixJson = $filteredMatrix | ConvertTo-Json -Compress
212-
Write-Host "##vso[task.setvariable variable=filteredTestMatrix;isOutput=true]$matrixJson"
213-
name: filterByPlatformStep
214-
displayName: "Extract matrix as json value filtering by build platform"
215-
- script: echo $(filterByPlatformStep.filteredTestMatrix)
216-
name: echoMatrix
217-
displayName: "Echo filtered matrix"
213+
$matrixJson = $filteredMatrix | ConvertTo-Json -Compress
214+
Write-Host "##vso[task.setvariable variable=filteredTestMatrix;isOutput=true]$matrixJson"
215+
name: filterByPlatformStep
216+
displayName: "Extract matrix as json value filtering by build platform"
217+
- script: echo $(filterByPlatformStep.filteredTestMatrix)
218+
name: echoMatrix
219+
displayName: "Echo filtered matrix"

build/AzurePipelinesTemplates/WindowsAppSDK-RunTestsInPipeline-Job.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ jobs:
3434
artifactAttempt: ''
3535
ob_artifactSuffix: '_$(buildConfiguration)$(buildPlatform)_$(Agent.JobStatus)$(artifactAttempt)'
3636
ob_artifactBaseName: '$(System.StageName)_$(imageName)'
37+
# As the name of this job suggests, we currently don't build any code here, but only run tests; therefore, not bothering to enable BinSkim scans
38+
# here. OTOH, if we leave BinSkim enabled, then the "Guardian: BinSkim" task in the Post* jobs injected into our pipeline by OneBranch
39+
# for this job would hit the following non-fatal, but noisy AnalyzeArgumentNoValuesException error:
40+
#
41+
# ##[error]Error running binskim job: 1 of 1
42+
# ##[error]AnalyzeArgumentNoValuesException: Argument Target has no values. Check your configuration. -- Additional arguments:Microsoft.Guardian.InvalidResponseFileContentsException: InvalidResponseFileContentsException: Cannot create a response file with zero arguments. Ensure that your arguments are correctly set up.
43+
# at Microsoft.Guardian.ResponseFileFormatterPlaintext.Format(IList`1 arguments, ResponseFileOptions Options)
44+
# at Microsoft.Guardian.ResponseFileManager.CreateResponseFile(IList`1 arguments, String formatterName, ResponseFileOptions options, String outputPathOverride)
45+
# at Microsoft.Guardian.CliAnalyzerResponseFileManager.SetupResponseFile(CliAnalyzerConfig analyzeConfig, ToolConfig toolConfig)
46+
ob_sdl_binskim_enabled: false
3747
steps:
3848
- template: WindowsAppSDK-RunTests-Steps.yml
3949
parameters:

0 commit comments

Comments
 (0)