From 552ec8e3e9983334c34fd91fdd95fef44fe14335 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Fri, 30 Oct 2026 16:42:42 +0100 Subject: [PATCH] THRIFT-6473: Raise the WinGet manifest version to 1.28.0 Client: build winget-pkgs flags manifest version 1.12.0 as deprecated and asks for 1.28.0, as it did for the 0.25.0 submission. The three templates move to 1.28.0, in ManifestVersion and in the $schema comment. No field changes: of the three schemas the package uses, only the installer schema gains a field, the optional DesiredStateConfiguration, which the package does not use. test-winget-manifests.ps1 now checks that each $schema comment names the type and version of the manifest under it, and that the three manifests share one version, as WinGet's own validation requires. build/windows/README.md says where the version is set and what to check before raising it. Co-Authored-By: Claude Opus 5.5 --- build/windows/README.md | 14 +++++++++++--- .../winget/Apache.Thrift.installer.yaml.in | 4 ++-- .../winget/Apache.Thrift.locale.en-US.yaml.in | 4 ++-- build/windows/winget/Apache.Thrift.yaml.in | 4 ++-- build/windows/winget/test-winget-manifests.ps1 | 18 ++++++++++++++++++ 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/build/windows/README.md b/build/windows/README.md index 0a0f83ec614..9920b19659f 100644 --- a/build/windows/README.md +++ b/build/windows/README.md @@ -275,12 +275,20 @@ goes into the manifest and hashed, so the manifest cannot claim a checksum the published file does not have. That also means this cannot be run before the installer is there: for the archive, before the release has reached it. +Each template names the manifest version twice, in `ManifestVersion` and in the +`$schema` comment. winget-pkgs flags a submission that uses a version it has +deprecated, so the version has to be raised now and then, in all six lines. +Raise it only to a version the latest `wingetcreate` release knows: +`wingetcreate submit` validates the manifests first, rejects a newer version, +and then opens no pull request. + ### `winget/test-winget-manifests.ps1` Tests the renderer: that the values land where they belong, that no placeholder -survives into a file that would be submitted verbatim, that the output is UTF-8 -without a BOM and with LF endings, and that a malformed version, checksum or -date, or an unknown installer source, is refused. +survives into a file that would be submitted verbatim, that each `$schema` +comment names the type and version of the manifest under it, that the output is +UTF-8 without a BOM and with LF endings, and that a malformed version, checksum +or date, or an unknown installer source, is refused. ### `winget/validate_manifests.py` diff --git a/build/windows/winget/Apache.Thrift.installer.yaml.in b/build/windows/winget/Apache.Thrift.installer.yaml.in index 7c4acaa746e..d3eccc4493e 100644 --- a/build/windows/winget/Apache.Thrift.installer.yaml.in +++ b/build/windows/winget/Apache.Thrift.installer.yaml.in @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.12.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.28.0.schema.json PackageIdentifier: Apache.Thrift PackageVersion: __VERSION__ @@ -48,4 +48,4 @@ Installers: # read as a YAML number and rejected by the schema as not a string. InstallerSha256: '__INSTALLER_SHA256__' ManifestType: installer -ManifestVersion: 1.12.0 +ManifestVersion: 1.28.0 diff --git a/build/windows/winget/Apache.Thrift.locale.en-US.yaml.in b/build/windows/winget/Apache.Thrift.locale.en-US.yaml.in index 5e73e5c864d..a8313b8a0e8 100644 --- a/build/windows/winget/Apache.Thrift.locale.en-US.yaml.in +++ b/build/windows/winget/Apache.Thrift.locale.en-US.yaml.in @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.12.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.28.0.schema.json PackageIdentifier: Apache.Thrift PackageVersion: __VERSION__ @@ -56,4 +56,4 @@ Documentations: - DocumentLabel: Tutorial DocumentUrl: https://thrift.apache.org/tutorial/ ManifestType: defaultLocale -ManifestVersion: 1.12.0 +ManifestVersion: 1.28.0 diff --git a/build/windows/winget/Apache.Thrift.yaml.in b/build/windows/winget/Apache.Thrift.yaml.in index 0e2f84e2584..ad8842c9026 100644 --- a/build/windows/winget/Apache.Thrift.yaml.in +++ b/build/windows/winget/Apache.Thrift.yaml.in @@ -15,10 +15,10 @@ # specific language governing permissions and limitations # under the License. -# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.12.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.28.0.schema.json PackageIdentifier: Apache.Thrift PackageVersion: __VERSION__ DefaultLocale: en-US ManifestType: version -ManifestVersion: 1.12.0 +ManifestVersion: 1.28.0 diff --git a/build/windows/winget/test-winget-manifests.ps1 b/build/windows/winget/test-winget-manifests.ps1 index 13c52465a73..50490df2e3f 100644 --- a/build/windows/winget/test-winget-manifests.ps1 +++ b/build/windows/winget/test-winget-manifests.ps1 @@ -111,6 +111,24 @@ try { Assert-True "$name holds no placeholders" ($content -notmatch '__[A-Z0-9_]+__') } + # WinGet checks the $schema comment against the manifest under it: the + # type and version it names have to be the ManifestType and the + # ManifestVersion, and the three manifests have to share that version. A + # new manifest version has to reach all six lines. + $manifestVersions = foreach ($name in $names) { + $content = Get-Content -LiteralPath (Join-Path $targetDir $name) -Raw + $header = [regex]::Match($content, '\$schema=https://aka\.ms/winget-manifest\.(\w+)\.(\d+\.\d+\.\d+)\.schema\.json') + $type = [regex]::Match($content, '(?m)^ManifestType: (\w+)\s*$') + $manifestVersion = [regex]::Match($content, '(?m)^ManifestVersion: (\d+\.\d+\.\d+)\s*$') + Assert-True "$name names its own type and version in the schema comment" ` + ($header.Success -and $type.Success -and $manifestVersion.Success -and + ($header.Groups[1].Value -eq $type.Groups[1].Value) -and + ($header.Groups[2].Value -eq $manifestVersion.Groups[1].Value)) $content + $manifestVersion.Groups[1].Value + } + Assert-True 'the manifests share one manifest version' ` + (@($manifestVersions | Select-Object -Unique).Count -eq 1) ($manifestVersions -join ', ') + Assert-True 'the version reaches every manifest' ` (($installer -match "PackageVersion: $([regex]::Escape($version))") -and ($locale -match "PackageVersion: $([regex]::Escape($version))") -and