dotnet / docker-tools

This is a repo to house some common tools for our various docker repos.
MIT License
122 stars 46 forks source link

Generate SBOMs step failing in dotnet-docker-tools-eng-validation pipeline #1285

Closed mthalman closed 4 months ago

mthalman commented 4 months ago
Starting: Generate SBOMs
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Linux, macOS, or Windows
Version      : 2.237.5
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/mnt/vss/_work/_temp/c4d0b84b-ac51-4c7d-a7ec-47d4473b4363.ps1'
InvalidOperation: /mnt/vss/_work/_temp/c4d0b84b-ac51-4c7d-a7ec-47d4473b4363.ps1:7
Line |
   7 |  … taskDir = $(Get-ChildItem -Recurse -Directory -Filter "ManifestGenera …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot index into a null array.

##[error]PowerShell exited with code '1'.
Finishing: Generate SBOMs

This is a regression from the changes in https://github.com/dotnet/docker-tools/pull/1283. That presumed that ManifestGeneratorTask is being automatically injected and called by the 1ES templates, via the Generate SBoM Manifest step. That's true for the logic in the product repos but not for the validation pipeline in this repo which doesn't include that injected step.

dotnet-issue-labeler[bot] commented 4 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

lbussell commented 4 months ago

We should be able to fix this by opting in to SBOM generation on our unofficial pipelines. https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sbom