Skip to content

fix: update sample server to use PackageType (v10.5.0-beta.6 compat)#131

Merged
JusterZhu merged 2 commits into
mainfrom
chore/update-server-api-to-beta.6
Jun 21, 2026
Merged

fix: update sample server to use PackageType (v10.5.0-beta.6 compat)#131
JusterZhu merged 2 commits into
mainfrom
chore/update-server-api-to-beta.6

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

适配 v10.5.0-beta.6 API 变更

变更背景

v10.5.0-beta.6 的 VersionEntry 移除了 IsCrossVersion/FromVersion 属性,改用 PackageType(0=Unspecified, 1=Chain, 2=Full)

变更内容

  • VerificationResultDTO: IsCrossVersion/FromVersion → PackageType
  • Program.cs (Server): 更新验证、日志输出逻辑
  • 4 个 PowerShell 脚本: 生成 versions.json 时输出 packageType
  • versions.json: 示例数据使用 packageType 字段

… IsCrossVersion/FromVersion

- Replace VerificationResultDTO.IsCrossVersion/FromVersion with PackageType
- Replace Server internal VersionEntry record fields with PackageType
- Update all 4 PowerShell scripts (generate, finalize, create_versions, gen_packages)
- Update versions.json sample data
- Update Program.cs verification/download logic
- Keep PatchGenerator backward-compat parsing for old fields
Copilot AI review requested due to automatic review settings June 20, 2026 17:15

Copilot AI 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.

Pull request overview

This PR updates the sample server and package-generation scripts to align with the v10.5.0-beta.6 API change that replaces IsCrossVersion/FromVersion with PackageType.

Changes:

  • Replace IsCrossVersion/FromVersion with PackageType in server DTO/model and verification/logging output.
  • Update PowerShell package generation scripts to emit PackageType.
  • Update sample versions.json data to include PackageType.

Reviewed changes

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

Show a summary per file
File Description
src/Server/Program.cs Switch server-side filtering/log output and internal VersionEntry model to PackageType.
src/Server/DTOs/VerificationResultDTO.cs Replace cross-version fields with PackageType in the verification response DTO.
src/Server/wwwroot/packages/versions.json Update sample metadata to use PackageType instead of cross-version fields.
src/Server/generate_packages.ps1 Emit PackageType in generated metadata and bridge PatchGenerator output.
src/Server/finalize_packages.ps1 Emit PackageType when finalizing/aggregating packages into versions.json.
src/Server/create_versions_json.ps1 Emit PackageType when rebuilding versions.json from existing zip files.
src/gen_packages.ps1 Emit PackageType in the quick package generation script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to 16
"Hash": "a1f180bfc0a58429a42be59d15421b810c993274af65b23a0b049880bb415d47",
"packageType": 2
},
Comment on lines +29 to 31
"Hash": "0d7727be7ea8520fe60ce37ce30b1a956ee6e33b252489045b4d852134b4abc6",
"packageType": 2
},
Comment on lines +44 to 46
"Hash": "47e693ac91230db216cf4ece7d6775e7bc73b79028eb76f847f74ad01d125ef6",
"packageType": 2
},
Comment on lines +59 to 61
"Hash": "47e693ac91230db216cf4ece7d6775e7bc73b79028eb76f847f74ad01d125ef6",
"packageType": 2
},
Comment on lines +74 to 76
"Hash": "d0e74a16a230eb53cfd6d3d955582f3b1c22f838822e61a3148afcd2336ef94c",
"packageType": 2
},
Comment thread src/Server/Program.cs
Comment on lines 88 to +89
foreach (var r in results)
Console.WriteLine($" {r.Version} — {r.Name} ({(r.IsCrossVersion == true ? $"Cross {r.FromVersion} → {r.Version}" : "Full")})");
Console.WriteLine($" {r.Version} — {r.Name} ({(r.PackageType == 1 ? "Chain" : "Full")})");
Comment thread src/Server/Program.cs
Comment on lines 163 to +164
foreach (var v in versionStore.OrderBy(v => new Version(v.Version!)))
Console.WriteLine($" {v.Version,-12} AppType={v.AppType} {(v.IsCrossVersion == true ? $"Cross {v.FromVersion} → {v.Version}" : "Full")} {v.PacketName}");
Console.WriteLine($" {v.Version,-12} AppType={v.AppType} {(v.PackageType == 1 ? "Chain" : "Full")} {v.PacketName}");
Comment thread src/Server/Program.cs
Comment on lines +234 to +236
/// <summary>
/// 包类型: 0=Unspecified, 1=Chain(差分), 2=Full(完整包), 3=Driver
/// </summary>
Comment on lines 153 to 156
Size = $pe.Size
IsFreeze = $pe.IsFreeze
IsCrossVersion = $(if ($pe.IsCrossVersion) { $true } else { $false })
FromVersion = $pe.FromVersion
ToVersion = $pe.ToVersion
PackageType = $(if ($pe.PackageType) { $pe.PackageType } elseif ($pe.IsCrossVersion) { 1 } else { 2 })
}
Comment on lines 75 to 77
/// <summary>
/// 是否为跨版本升级包
/// 包类型: 0=Unspecified, 1=Chain(差分), 2=Full(完整包), 3=Driver
/// </summary>
…rap example

- New StandardUpdateSample (Index=1): clean, minimal GeneralUpdateBootstrap
  config with all essential listeners, no mock files
- Shift all existing sample indices by +1 to accommodate
- StandardUpdateSample is the go-to reference for first-time integrators
@JusterZhu JusterZhu merged commit 6fc2ba6 into main Jun 21, 2026
2 checks passed
@JusterZhu JusterZhu deleted the chore/update-server-api-to-beta.6 branch June 21, 2026 02:50
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.

2 participants