Skip to content

Split TPN manifest and Component Governance manifest#26891

Merged
TravisEz13 merged 3 commits intoPowerShell:masterfrom
TravisEz13:split-tpn-and-cg
Feb 25, 2026
Merged

Split TPN manifest and Component Governance manifest#26891
TravisEz13 merged 3 commits intoPowerShell:masterfrom
TravisEz13:split-tpn-and-cg

Conversation

@TravisEz13
Copy link
Member

@TravisEz13 TravisEz13 commented Feb 25, 2026

PR Summary

This pull request introduces several improvements to the ClearlyDefined compliance tooling, focusing on enhanced cache management, improved package version handling, and updates to manifest file paths. The most significant changes include new cache persistence functions, a new script for finding the last harvested NuGet package version, and updates to how cgmanifest files are referenced across build and CI scripts.

ClearlyDefined cache and package version improvements:

  • Added functions for cache persistence (Save-ClearlyDefinedCache, Import-ClearlyDefinedCache, Test-ClearlyDefinedCachePersistenceAllowed, Get-ClearlyDefinedCachePath) to ClearlyDefined.psm1, allowing cache import/export except in CI environments. [1] [2]
  • Updated cache TTL logic in Get-ClearlyDefinedData to use different expiration times for harvested and non-harvested results, improving efficiency and accuracy. [1] [2]
  • Added Search-ClearlyDefined and Get-ClearlyDefinedPackageVersions functions to enable querying ClearlyDefined for available package versions and their harvest status. [1] [2]

New script and manifest path updates:

  • Added new script Find-LastHarvestedVersion.ps1 to locate the most recent harvested NuGet package version, supporting fallback to NuGet search if ClearlyDefined API is unavailable.
  • Updated references to cgmanifest.json throughout scripts and pipelines to use the new path tools/cgmanifest/main/cgmanifest.json or tools/cgmanifest/*, improving organization and consistency. [1] [2] [3] [4] [5] [6] [7]

These changes collectively enhance the reliability and maintainability of the compliance tooling, especially in CI environments and when handling package version harvesting.

PR Context

PR Checklist

Add Find-LastHarvestedVersion function and cache management for ClearlyDefined data

- Introduced Find-LastHarvestedVersion.ps1 to find the last harvested version of a NuGet package.
- Enhanced ClearlyDefined.psm1 with cache persistence functions: Save-ClearlyDefinedCache and Import-ClearlyDefinedCache.
- Updated Get-ClearlyDefinedData to utilize cache for improved performance and added cache expiration logic based on harvest status.
- Modified findMissingNotices.ps1 to include a new -ForceHarvestedOnly switch for filtering harvested packages.
- Adjusted packaging.psm1 to correct paths for cgmanifest.json and ensure compatibility with new directory structure.
Copilot AI review requested due to automatic review settings February 25, 2026 16:01
@TravisEz13 TravisEz13 requested review from a team and jshigetomi as code owners February 25, 2026 16:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR splits the repository’s Component Governance manifest into separate “main” and “TPN” manifests and updates compliance tooling to use the new locations, alongside enhancements to the ClearlyDefined helper module for cache persistence and package-version discovery.

Changes:

  • Introduces tools/cgmanifest/main/cgmanifest.json and tools/cgmanifest/tpn/cgmanifest.json, updating scripts/pipelines to reference these new paths.
  • Extends the ClearlyDefined PowerShell module with cache import/export and version search helpers, and updates caching behavior in Get-ClearlyDefinedData.
  • Adds Find-LastHarvestedVersion.ps1 and extends findMissingNotices.ps1 with a -ForceHarvestedOnly mode to produce a harvested-only TPN manifest.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/packaging/packaging.psm1 Updates CG manifest path used during global tool packaging to point at tools/cgmanifest/main/cgmanifest.json.
tools/findMissingNotices.ps1 Updates manifest path, adds -ForceHarvestedOnly, and adds logic to write/update the TPN manifest.
tools/clearlyDefined/src/ClearlyDefined/ClearlyDefined.psm1 Adds cache persistence helpers, search/version helpers, and revises cache TTL behavior in Get-ClearlyDefinedData.
tools/clearlyDefined/Find-LastHarvestedVersion.ps1 New helper to locate most recent harvested NuGet package version (ClearlyDefined-first, NuGet fallback).
tools/clearlyDefined/ClearlyDefined.ps1 Updates manifest path consumed by the ClearlyDefined harvesting/verification script.
tools/cgmanifest/main/cgmanifest.json New “main” manifest file location.
tools/cgmanifest/tpn/cgmanifest.json New “TPN” manifest file location (intended for notice/component detection workflows).
.vsts-ci/windows-arm64.yml Updates PR path filters to watch tools/cgmanifest/* instead of a single file.
.vsts-ci/psresourceget-acr.yml Updates PR path filters to watch tools/cgmanifest/*.
.vsts-ci/mac.yml Updates PR path filters to watch tools/cgmanifest/*.
.vsts-ci/linux-internal.yml Updates PR path filters to watch tools/cgmanifest/*.
.pipelines/templates/compliance/generateNotice.yml Points component detection scanning to tools/cgmanifest/tpn for notice generation.

@TravisEz13 TravisEz13 enabled auto-merge (squash) February 25, 2026 18:19
@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Feb 25, 2026
@TravisEz13 TravisEz13 merged commit 6e2b4c7 into PowerShell:master Feb 25, 2026
40 of 42 checks passed
@TravisEz13 TravisEz13 deleted the split-tpn-and-cg branch February 25, 2026 20:14
jshigetomi pushed a commit to jshigetomi/PowerShell that referenced this pull request Mar 9, 2026
jshigetomi added a commit that referenced this pull request Mar 9, 2026
jshigetomi added a commit to jshigetomi/PowerShell that referenced this pull request Mar 9, 2026
jshigetomi added a commit that referenced this pull request Mar 9, 2026
adityapatwardhan pushed a commit to adityapatwardhan/PowerShell that referenced this pull request Mar 9, 2026
daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.4.x-Migrated Backport-7.5.x-Migrated Backport-7.6.x-Migrated CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants