已合并
fix(package): allow --force to recover from incomplete baseline manifest #184
Hyunbin创建于 8 天前
fix(package): allow --force to recover from incomplete baseline manifest #184
已合并
Hyunbin创建于 8 天前
Hyunbin
Hyunbin成员
8 天前

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 / 检查清单

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Hyunbin 的贡献)
HyunbinHyunbin成员
8 天前 创建了 pull request,commit 17530e0d
atomgit-bot
atomgit-bot
8 天前 评论:

变更摘要

本 PR 修复基线清单(baseline/manifest.tsv)不完整导致安装/卸载补丁失败的问题。原先 validate_baseline_coverage 在发现基线未覆盖已安装补丁路径时直接失败退出;现在将其拆分为 collect_missing_baseline_paths(收集缺失路径)、validate_baseline_recovery(仅在 --force 且原备份可用时才允许继续)、repair_baseline_manifest(将缺失路径以 present 状态补写回清单)三个函数,并在 install_patchuninstall_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 unavailablerepair_baseline_manifestchmod 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 的恢复流程。
likedislike
不准确?
atomgit-bot
atomgit-bot
8 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
8 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8 天前 评论:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
HyunbinHyunbin成员
8 天前 修改标题为 “fix(package): allow --force to recover from incomplete baseline manifest”,原标题为“fix bug”
HyunbinHyunbin成员
8 天前 关联了issue:[Bug-Report|缺陷反馈]: asc-comm安装包,安装失败
HyunbinHyunbin成员
8 天前 修改了pull request 的描述
Hyunbin
Hyunbin成员
8 天前 评论:

compile

likedislike
HyunbinHyunbin成员
8 天前 预合并成功(commit_id: 4c03b984a9c70396d61bbccfdab3d950bb6c0db2)
CANN-robot
CANN-robot成员
8 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
8 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
8 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8 天前 添加了label:ci-pipeline-passed
Hyunbin
Hyunbin成员
6 天前 评论:

compile

likedislike
HyunbinHyunbin成员
6 天前 预合并成功(commit_id: fd331a3184fbf6c4234993db54a805c47f1c4e9c)
CANN-robot
CANN-robot成员
6 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
6 天前 删除了label:ci-pipeline-passed
CANN-robotCANN-robot成员
6 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
6 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6 天前 添加了label:ci-pipeline-passed
suqwe
suqwe成员
5 天前 评论:

/lgtm

likedislike
izanaami
izanaami成员
5 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5 天前 添加了label:lgtmapproved
CANN-robotCANN-robot成员
5 天前 合入了pull request