Skip to content

Commit d371b2d

Browse files
authored
Repair Aggregate Reports / analyze job (#36377)
* use eng/common policheck * remove ref to interdependencygraph.xml failing the analyze job * analyze_dependencies python version safe
1 parent b5b8521 commit d371b2d

File tree

3 files changed

+12
-34
lines changed

3 files changed

+12
-34
lines changed

eng/pipelines/aggregate-reports.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -77,33 +77,10 @@ stages:
7777
parameters:
7878
BaselineFilePath: $(Build.SourcesDirectory)\eng\python.gdnbaselines
7979

80-
- pwsh: |
81-
azcopy copy "https://azuresdkartifacts.blob.core.windows.net/policheck/PythonPoliCheckExclusion.mdb?$(azuresdk-policheck-blob-SAS)" `
82-
"$(Build.BinariesDirectory)"
83-
displayName: 'Download PoliCheck Exclusion Database'
84-
condition: succeededOrFailed()
85-
86-
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2
87-
displayName: 'Run PoliCheck'
88-
inputs:
89-
targetType: F
90-
targetArgument: '$(Build.SourcesDirectory)'
91-
result: PoliCheck.sarif
92-
optionsFC: 0
93-
optionsXS: 1
94-
optionsPE: 1|2|3|4
95-
optionsRulesDBPath: "$(Build.BinariesDirectory)/PythonPoliCheckExclusion.mdb"
96-
optionsUEPATH: "$(Build.SourcesDirectory)/eng/guardian-tools/policheck/PolicheckExclusions.xml"
97-
condition: succeededOrFailed()
98-
99-
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
100-
displayName: 'Post Analysis (PoliCheck)'
101-
inputs:
102-
GdnBreakAllTools: false
103-
GdnBreakGdnToolPoliCheck: true
104-
GdnBreakGdnToolPoliCheckSeverity: Warning
105-
condition: succeededOrFailed()
106-
continueOnError: true
80+
- template: /eng/common/pipelines/templates/steps/policheck.yml
81+
parameters:
82+
PublishAnalysisLogs: false
83+
ExclusionDataBaseFileName: PythonPoliCheckExclusion
10784

10885
- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3
10986
displayName: 'Publish Security Analysis Logs'

eng/pipelines/templates/steps/analyze_dependency.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ steps:
1818
parameters:
1919
ScanPath: ${{ parameters.ScanPath }}
2020

21-
- pwsh: |
22-
mkdir "$(Build.ArtifactStagingDirectory)/reports"
23-
Copy-Item -Path "$(Build.SourcesDirectory)/eng/common/InterdependencyGraph.html" -Destination "$(Build.ArtifactStagingDirectory)/reports/InterdependencyGraph.html"
24-
displayName: 'Populate Reports Staging Folder'
25-
condition: and(succeededOrFailed(),ne(variables['Skip.AnalyzeDependencies'],'true'))
26-
2721
- pwsh: |
2822
sdk_analyze_deps --verbose --out "$(Build.ArtifactStagingDirectory)/reports/dependencies.html" --dump "$(Build.ArtifactStagingDirectory)/reports"
2923
displayName: 'Analyze dependencies'

tools/azure-sdk-tools/ci_tools/dependency_analysis.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
import sys
1212
import textwrap
1313
from typing import List, Set, Dict, Tuple, Any
14-
from collections import Sized
14+
try:
15+
from collections import Sized
16+
except:
17+
from collections.abc import Sized
1518

1619
from pkg_resources import Requirement
1720
from packaging.specifiers import SpecifierSet, Version
@@ -313,6 +316,10 @@ def analyze_dependencies() -> None:
313316
if args.out:
314317
external = [k for k in dependencies if k not in packages and not k.startswith("azure")]
315318

319+
complete_dir = os.path.abspath(args.out)
320+
report_dir = os.path.dirname(complete_dir)
321+
os.makedirs(report_dir, exist_ok=True)
322+
316323
def display_order(k):
317324
if k in incompatible:
318325
return "a" + k if k in external else "b" + k

0 commit comments

Comments
 (0)