Skip to content

Generate third-party notices from the build (UNI-33) - #5805

Open
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
mainfrom
feature/third-party-notices
Open

Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
mainfrom
feature/third-party-notices

Conversation

@GabrielDuf

@GabrielDuf Gabriel Dufresne (GabrielDuf) commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

UNI-33 / PI-831: UniGetUI now ships a THIRD-PARTY-NOTICES.txt (and .json) generated from what each build actually ships, in the format shared across Devolutions products, and the About page reads it instead of a hand-maintained list.

Generation

  • scripts/third-party-licenses/ is a copy of RDM's DevTools/ThirdPartyLicenses (commit 4020053), so our public CI does not depend on the private RDM repository. Scripts and template are unchanged; config/ holds UniGetUI's entries only. See its README.
  • scripts/generate-third-party-notices.ps1 reads UniGetUI.deps.json from the build folder (a NativeAOT publish folder has none) and the native files from the publish folder.
  • Declared by hand, since no build output describes them: the Inter font, the Icons8 icons, and on Windows the signature-check DLL, the WinGet COM metadata, Inno Setup and InnoDependencyInstaller (our 2024 copy predates its CPOL → MIT relicense). Skia/HarfBuzz native packages carry the notices of the libraries compiled into them; the Windows SDK projection gets the SDK license terms.
  • pinget's Rust crates (262): pinget does not commit its Cargo.lock, so Update-PingetCrates.ps1 resolves the v0.13.0 tag as crates.io stood at the tag's time and checks the result against the crate versions embedded in the shipped pinget.exe (127/127 match). Bumping Devolutions.Pinget.Cli.Rust without re-running it fails the release.

Release pipeline (build-release.yml)

  • Every runtime generates its own notices next to the binaries. License findings don't stop the release (PI-831 leaves enforcing an approved-license list out of scope); a missing file does.
  • After a stable, non-dry-run release, commit-third-party-notices opens a PR with the win-x64 copy into src/UniGetUI.Avalonia/ThirdPartyNotices/ only when a component changed. It uses DEVOLUTIONSBOT_TOKEN so the PR runs CI. Dev builds ship that copy.
  • Publish and size-report now download UniGetUI-* artifacts only, so the notices artifact isn't attached to the release.

In the app

  • About → Third-party licenses lists every component (name, version, license, source link), shows each license text on demand, and opens the full file. The TUI About dialog lists the same data.
  • LicenseData (Licenses.cs) and the separate Licenses/Tomlyn.txt are removed.

Licenses outside the allow-list (informational)

Reported by the tool, written into the notices with their full text, not blocking: Windows SDK, Inter (OFL-1.1), Icons8, Inno Setup, InnoDependencyInstaller (CPOL-1.02), and in pinget's crates Unicode-3.0, MPL-2.0, MIT-0, CC0-1.0/MIT-0, bzip2-1.0.6.

Test plan

  • New tests: ThirdPartyNoticesTests (4), ThirdPartyLicensesViewModelTests (8), TUI About_ListsThirdPartyComponents_AndOpensTheNoticesFile; TUI shell tests pass
  • Tool's Pester suite: 252 passed
  • dotnet format whitespace and style gates
  • Release build with trim/AOT analyzers: no new IL warnings
  • Local NativeAOT win-x64 publish run through the CI steps: both files written (320 components), require step and integrity tree pass
  • About page checked in Debug and NativeAOT builds
  • Dry-run release on GitHub (Linux and macOS jobs not run locally)
  • Commit-back job: first exercised by a real stable release

PI-831 asks every Devolutions product to ship a THIRD-PARTY-NOTICES.txt generated
from what the build actually ships, in one shared format, with an in-product view
for apps with a UI and a copy pushed back to the repository.

Generation
- scripts/third-party-licenses is a copy of RDM's DevTools/ThirdPartyLicenses
  (commit 4020053), so UniGetUI's public CI does not depend on the private RDM
  repository. Its scripts and template are unchanged; config/ holds UniGetUI's
  own entries only. The RDM-specific SixLabors.ImageSharp test is removed.
- scripts/generate-third-party-notices.ps1 reads UniGetUI.deps.json from the
  build folder, because a NativeAOT publish folder has none, and the shipped
  native files from the publish folder. It deletes any notices file in the
  output folder first, so a run that fails early never leaves the committed
  copy behind for a release to ship.
- Content no build output describes is declared by hand: the Inter font
  (OFL-1.1), the Icons8 icons, and on Windows the signature-check DLL
  (byte-identical to Microsoft.Security.Extensions 1.4.0), the WinGet COM
  metadata, Inno Setup and InnoDependencyInstaller. Our copy of the latter
  dates from 2024, before its relicense from CPOL to MIT, so it is listed
  under CPOL 1.02.
- The Skia and HarfBuzz native packages carry the notices of the libraries
  compiled into them; the Windows SDK projection gets the SDK license terms.

pinget's Rust crates
- pinget does not commit its Cargo.lock, so Update-PingetCrates.ps1 resolves
  the v<version> tag as crates.io stood at the tag's time and refuses the
  result unless every crate version found in the shipped pinget.exe is in it.
  For 0.13.0 all 127 match. License texts come from each crate's package.
- The wrapper refuses a crate list made for another pinget version, so a
  pinget bump cannot ship stale attributions.

Release pipeline
- Every runtime generates its own notices next to the binaries. The step may
  fail on license findings without stopping the release (PI-831 leaves
  enforcing an approved-license list out of scope); a missing file does.
- After a stable release, a job opens a pull request with the win-x64 copy
  when a component changed. It uses DEVOLUTIONSBOT_TOKEN because pull requests
  opened with GITHUB_TOKEN never run CI, and a re-run reuses the branch and
  pull request. Publish and size-report download only UniGetUI-* artifacts so
  the notices artifact is not attached to the release.

In the app
- The About page and the TUI About dialog read the bundled JSON through
  ThirdPartyNotices (source-generated JSON, NativeAOT-safe) instead of the
  hand-maintained, outdated LicenseData list. The About page lists name,
  version, license and source, shows each license text on demand and opens
  the full file. Licenses/Tomlyn.txt is no longer shipped separately.

Verified with a local NativeAOT win-x64 publish run through the CI steps:
both files are written (320 components) and pass the integrity tree check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The exclusion list omits the repository-built UniGetUIMacNotificationBridge.dylib, causing both macOS releases to misidentify it as a third-party component with missing license, source, and version metadata.

1 open issue
What changed in this PR

This PR replaces UniGetUI’s hand-maintained license list with build-generated third-party notices, shared by release packages and the graphical and terminal About views.

Changes:

  • Adds notice-generation tooling, component metadata, license texts, and regression tests.
  • Integrates per-runtime generation and stable-release notice update PRs into the release workflow.
  • Updates About views to display generated components and open the full notices file.
File Description
src/​UniGetUI.Tui/​Views/​Dialogs/​AboutDialog.cs Displays generated notices in the TUI.
src/​UniGetUI.Tui.Tests/​E2E/​OtherPagesE2ETests.cs Tests component display and file opening.
src/​UniGetUI.Tests/​ThirdPartyLicensesViewModelTests.cs Tests license display, expansion, and links.
src/​UniGetUI.PackageEngine.Managers.Cargo/​UniGetUI.PackageEngine.Managers.Cargo.csproj Removes separate Tomlyn license packaging.
src/​UniGetUI.PackageEngine.Managers.Cargo/​Tomlyn.LICENSE.txt Removes the standalone Tomlyn license copy.
src/​UniGetUI.Core.Data/​ThirdPartyNotices.cs Adds source-generated JSON notice loading.
src/​UniGetUI.Core.Data/​Licenses.cs Removes the hard-coded license inventory.
src/​UniGetUI.Core.Data.Tests/​ThirdPartyNoticesTests.cs Tests notice parsing and missing-file handling.
src/​UniGetUI.Core.Data.Tests/​LicensesTest.cs Removes obsolete inventory tests.
src/​UniGetUI.Avalonia/​Views/​Pages/​AboutPages/​ThirdPartyLicenses.axaml.cs Removes replaced click handlers.
src/​UniGetUI.Avalonia/​Views/​Pages/​AboutPages/​ThirdPartyLicenses.axaml Adds expandable licenses and notice-file access.
src/​UniGetUI.Avalonia/​ViewModels/​Pages/​AboutPages/​ThirdPartyLicensesViewModel.cs Supplies component data and commands.
src/​UniGetUI.Avalonia/​UniGetUI.Avalonia.csproj Copies notice files into build outputs.
src/​Languages/​lang_en.json Adds English strings for notice views.
scripts/​third-party-licenses/​Update-PingetCrates.ps1 Generates and checks pinget crate notices.
scripts/​third-party-licenses/​Tests/​Get-WebAssemblyComponents.Tests.ps1 Tests WebAssembly package notice preservation.
scripts/​third-party-licenses/​Tests/​Get-UnlistedBinaries.Tests.ps1 Tests binary exclusion exceptions.
scripts/​third-party-licenses/​Tests/​Get-RepositoryTagUrl.Tests.ps1 Tests version-specific source links.
scripts/​third-party-licenses/​Tests/​Get-RepositoryLicense.Tests.ps1 Tests repository license discovery.
scripts/​third-party-licenses/​Tests/​Get-ManualComponents.Tests.ps1 Tests manual component download links.
scripts/​third-party-licenses/​Tests/​Get-LgplNotice.Tests.ps1 Tests LGPL notices and shared texts.
scripts/​third-party-licenses/​Tests/​Get-DotnetDepsComponents.Tests.ps1 Tests shipped dependency filtering.
scripts/​third-party-licenses/​Tests/​Get-ComponentStatement.Tests.ps1 Tests statements and metadata overrides.
scripts/​third-party-licenses/​Tests/​Get-AngularComponents.Tests.ps1 Tests Angular license-list parsing.
scripts/​third-party-licenses/​Tests/​Find-Approval.Tests.ps1 Tests approval matching and text hashes.
scripts/​third-party-licenses/​templates/​default.txt Defines the shared notice format.
scripts/​third-party-licenses/​README.md Documents generation and maintenance.
scripts/​third-party-licenses/​Private/​Write-LicenseReport.ps1 Formats reports and CI annotations.
scripts/​third-party-licenses/​Private/​Get-WebpackComponents.ps1 Reads webpack component inventories.
scripts/​third-party-licenses/​Private/​Get-WebAssemblyComponents.ps1 Reads published WebAssembly dependencies.
scripts/​third-party-licenses/​Private/​Get-SourceComponents.ps1 Discovers source-level component notices.
scripts/​third-party-licenses/​Private/​Get-RepositoryNotice.ps1 Retrieves repository notices and license texts.
scripts/​third-party-licenses/​Private/​Get-PowerShellModuleComponents.ps1 Reads PowerShell module metadata.
scripts/​third-party-licenses/​Private/​Get-ManualComponents.ps1 Loads manually declared components.
scripts/​third-party-licenses/​Private/​Get-LgplNotice.ps1 Builds LGPL attribution statements.
scripts/​third-party-licenses/​Private/​Get-FileVersionProperties.ps1 Reads binary version metadata across platforms.
scripts/​third-party-licenses/​Private/​Get-ComponentStatement.ps1 Applies statements and component overrides.
scripts/​third-party-licenses/​Private/​Get-AngularComponents.ps1 Reads Angular license inventories.
scripts/​third-party-licenses/​Private/​Format-Notices.ps1 Renders notices and deduplicates shared texts.
scripts/​third-party-licenses/​Private/​Find-Approval.ps1 Matches approvals and hashes license texts.
scripts/​third-party-licenses/​Private/​ConvertTo-NoticesJson.ps1 Serializes and reloads notice documents.
scripts/​third-party-licenses/​Private/​ConvertTo-CycloneDxJson.ps1 Exports CycloneDX component inventories.
scripts/​third-party-licenses/​Private/​Compare-LicenseLock.ps1 Detects component and license changes.
scripts/​third-party-licenses/​config/​texts/​icons8.txt Adds Icons8 attribution.
scripts/​third-party-licenses/​config/​texts/​gsudo.LICENSE.txt Adds the elevator’s upstream license.
scripts/​third-party-licenses/​config/​texts/​Avalonia.Angle.Windows.Natives/​zlib.txt Adds bundled zlib license text.
scripts/​third-party-licenses/​config/​texts/​Avalonia.Angle.Windows.Natives/​xxhash.txt Adds bundled xxHash license text.
scripts/​third-party-licenses/​config/​texts/​Avalonia.Angle.Windows.Natives/​astc-encoder.txt Adds bundled astc-encoder license text.
scripts/​third-party-licenses/​config/​texts/​Avalonia.Angle.Windows.Natives/​abseil.txt Adds bundled Abseil license text.
scripts/​third-party-licenses/​config/​pinget-crate-overrides.json Supplies missing crate metadata.
scripts/​third-party-licenses/​config/​package-overrides.json Supplies package metadata and native notices.
scripts/​third-party-licenses/​config/​manual-components.windows.json Declares Windows-only bundled components.
scripts/​third-party-licenses/​config/​manual-components.json Declares shared fonts and icons.
scripts/​third-party-licenses/​config/​license-url-mappings.json Maps license URLs to identifiers.
scripts/​third-party-licenses/​config/​excluded-packages.json Configures component exclusions.
scripts/​third-party-licenses/​config/​approved-packages.json Initializes package approval configuration.
scripts/​third-party-licenses/​config/​allowed-licenses.json Defines licenses accepted without review.
scripts/​third-party-licenses/​config/​.gitignore Ignores temporary resolved metadata.
scripts/​generate-third-party-notices.ps1 Connects build artifacts to notice generation.
AGENTS.md Documents notice maintenance conventions.
.github/​workflows/​build-release.yml Generates, requires, and publishes notice updates.

Review effort: Balanced

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 This pull request will not be approved automatically: it modifies files listed in human-review-paths, so a human review is required.

  • .github/workflows/build-release.yml matches .github/
Integration Details
{
	"deliveryId": "72deb74c-e44b-11f1-8dab-693d44102456",
	"headSha": "720abada22de104a35f6534c3151d7f59a15e790"
}

UniGetUIMacNotificationBridge.dylib is built from scripts/macos by a
post-publish target, so no deps.json lists it, and a .dylib carries no
version resource to name Devolutions as its company. The notices tool
therefore reported it on both macOS builds as an unknown third-party binary
with no license, source or version. Exclusions are matched against the
binary's base name, hence the entry without the extension.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The notices glob matches no files, so removing the existing license data leaves clean development builds and publishes outside build-release.yml without third-party notices and both About views showing a missing-notices message.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Restore third-party notices for non-CI builds

src/​UniGetUI.Avalonia/​UniGetUI.Avalonia.csproj:321

This glob currently matches no files: src/UniGetUI.Avalonia/ThirdPartyNotices/ contains neither notices file. Since this PR also removes LicenseData and the separately shipped Tomlyn license, a clean development build or a publish outside build-release.yml now has no third-party notices at all, and both About views show only the missing-notices message. Please bootstrap the checked-in pair from CI before removing the old data, or generate the files for these build paths rather than relying on a follow-up PR after the first stable release.

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants