Skip to content

VS Manifest SBOM path is set explicitly & Build Fails when file doesn't exist#6788

Merged
donnie-msft merged 18 commits intodevfrom
dev-donnie-msft-vsmanproj-validate-sbom-exists
Sep 24, 2025
Merged

VS Manifest SBOM path is set explicitly & Build Fails when file doesn't exist#6788
donnie-msft merged 18 commits intodevfrom
dev-donnie-msft-vsmanproj-validate-sbom-exists

Conversation

@donnie-msft
Copy link
Copy Markdown
Contributor

@donnie-msft donnie-msft commented Sep 18, 2025

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/3430

Description

Supersedes #6289

Fix path

Corrects the path so that the MicroBuild task no longer searches the root artifacts folder for an SBOM (which is both inefficient and has potential to find the wrong SBOM).

  • The key change is we need to look in the same subfolder as the generate-sbom templates do, specifically not just ManifestDirPath, but $(ManifestDirPath)\ $(ARTIFACT_NAME)

    Previous search behavior

    MSBuild Task AddSBOM had been searching the entire root artifacts folder for the SBOM.

    No SBOM file exists or explicitly mentioned by the user. Checking now at directory level: 'D:\a_work' and looking for pattern 'manifest.spdx.json' as per the documentation: ....

    image

    Corrected search behavior

    MSBuild Task AddSBOM now finds the SBOM immediately without searching the entire root artifacts folder .
    image

Fail if not found

Example Failing build:

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=12445368&view=results
image

Example Successful build:

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=12445358&view=results

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests See example builds
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@donnie-msft donnie-msft changed the title Fail build if vsmanproj if SBOM file doesn't exist VS Manifest SBOM path is now explicitly passed & Build Fails the file doesn't exist Sep 19, 2025
@donnie-msft donnie-msft marked this pull request as ready for review September 19, 2025 23:33
@donnie-msft donnie-msft requested a review from a team as a code owner September 19, 2025 23:33
@donnie-msft donnie-msft changed the title VS Manifest SBOM path is now explicitly passed & Build Fails the file doesn't exist VS Manifest SBOM path is now explicitly passed & Build Fails when file doesn't exist Sep 19, 2025
@donnie-msft donnie-msft changed the title VS Manifest SBOM path is now explicitly passed & Build Fails when file doesn't exist VS Manifest SBOM path is set explicitly & Build Fails when file doesn't exist Sep 20, 2025
Comment thread eng/pipelines/vs-test/build.yml Outdated
@donnie-msft donnie-msft requested a review from jeffkl September 22, 2025 20:45
@donnie-msft donnie-msft force-pushed the dev-donnie-msft-vsmanproj-validate-sbom-exists branch from 16701e8 to a4bc21f Compare September 22, 2025 22:53
zivkan
zivkan previously approved these changes Sep 23, 2025
Comment thread eng/pipelines/vs-test/build.yml Outdated
@donnie-msft donnie-msft force-pushed the dev-donnie-msft-vsmanproj-validate-sbom-exists branch from 1cbbe46 to 7bf783a Compare September 23, 2025 19:52
@donnie-msft donnie-msft requested a review from zivkan September 23, 2025 20:27
Comment thread eng/pipelines/templates/Build_and_UnitTest.yml
@donnie-msft donnie-msft requested a review from jeffkl September 23, 2025 22:22
Copy link
Copy Markdown
Contributor

@jeffkl jeffkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the quotation changes in the YAML but love the indentation fixes. We should do a follow-up PR to normalize the quotes

@donnie-msft
Copy link
Copy Markdown
Contributor Author

Thanks, Jeff. Filed NuGet/Home#14555!

@donnie-msft donnie-msft merged commit 28eeb09 into dev Sep 24, 2025
17 of 18 checks passed
@donnie-msft donnie-msft deleted the dev-donnie-msft-vsmanproj-validate-sbom-exists branch September 24, 2025 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants