Pull Request已成功合入, 合并人@CANN-robot
(感谢 Hyunbin 的贡献)变更摘要
本 PR 修复基线清单(baseline/manifest.tsv)不完整导致安装/卸载补丁失败的问题。原先 validate_baseline_coverage 在发现基线未覆盖已安装补丁路径时直接失败退出;现在将其拆分为 collect_missing_baseline_paths(收集缺失路径)、validate_baseline_recovery(仅在 --force 且原备份可用时才允许继续)、repair_baseline_manifest(将缺失路径以 present 状态补写回清单)三个函数,并在 install_patch 与 uninstall_patch 流程中接入,使清单不完整时可借助既有备份自动修复恢复。
主要改动
- 拆分
validate_baseline_coverage为三个函数:collect_missing_baseline_paths将基线未覆盖的路径写入指定输出文件;validate_baseline_recovery在清单不完整时非--force直接fail并提示use --force to recover from existing backups,--force时校验STATE_DIR/baseline/files/${path}备份存在且非符号链接,否则报backup is unavailable;repair_baseline_manifest以chmod 640打开清单、追加present\t<path>条目后再恢复chmod 440。 install_patch流程接入缺失路径收集与清单修复:新增missing_baseline_paths工作文件,将原来的硬失败校验替换为收集+恢复校验,并在snapshot_transaction之后调用repair_baseline_manifest补齐清单。uninstall_patch流程同步更新:同样改为收集缺失路径并执行validate_baseline_recovery,随后调用repair_baseline_manifest再执行restore_baseline。- 新增测试覆盖清单不完整场景:在
tests/package/test_run_package.sh中新增remove_baseline_entry辅助函数,验证无--force时失败并提示、--force且备份存在时成功恢复并补齐清单条目、以及备份不可用时报错的三种路径,并调整卸载测试为带--force的恢复流程。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/asc-comm | ✅ jiangxinyu3, 苏建加 (2/2) | ✅ jiangxinyu3 (1/1) |
| tests | ✅ 苏建加, jiangxinyu3 (2/2) | ✅ jiangxinyu3 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
hbhdhd, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm


/lgtm
/approve


Was This PR authored or co-authored using generative AI tooling?
[x] No
[ ] Yes
__1. AI Agent :
__2. AI Model :
__3. Prompt :
What this PR does / why we need it:
修复 run 包安装器在 baseline manifest 不完整时安装/卸载失败、且
--force无法绕过的问题(issue #12:使用不同 change-id 出包重复安装时报baseline does not cover installed patch path,带--force仍失败,用户被卡死)。Which issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Change Type / 改动类型
Testing / 测试信息
Checklist / 检查清单