bregctl: project lock adds a missing digest after the entry's trailing blank line
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 crates/registry-bregctl/src/module_lock_patch.rs 开始,重点查看 patch_module_locks 和 key_value_end,然后阅读该文件中的单元测试。检查最后一个条目以及后面跟着空行的条目中,item.end 位于何处。为这两种情况添加测试;当 digest 仍与其条目关联,并且下一个顶层键前的空行得到保留时,工作就完成了。
由索引模型根据 Issue 内容生成。
描述
When a modules[] entry has no digest yet, bregctl project lock adds one at the end of the
entry. If the entry ends with a blank line (the usual spacing before the next top-level key),
the digest goes after the blank line, so the entry is split by a blank line. The YAML is still
valid and check accepts it, so this is cosmetic, but the lock is meant to be a minimal patch that
leaves the author's layout alone.
Minimal repro, a registry.yaml with:
modules:
- id: inspections
version: 0.1.0
evidenceProviders:
# ...
After bregctl project lock <project>:
modules:
- id: inspections
version: 0.1.0
digest: "sha256:..."
evidenceProviders:
# ...
Expected:
modules:
- id: inspections
version: 0.1.0
digest: "sha256:..."
evidenceProviders:
# ...
Likely fix: in crates/registry-bregctl/src/module_lock_patch.rs, patch_module_locks inserts a
missing digest at item.end (around line 131). For the last entry that is the end of the
modules block, which key_value_end (line 230) places after blank lines; for an earlier entry
it is the next entry's first line, so a blank line between entries has the same effect. Inserting
after the last non-blank line of the item fixes both.
Tests: unit tests in the same file (mod tests, line 249): one for the last entry followed by a
blank line and a top-level key, one for a blank line between two entries.
- 主要语言
- Rust
- 星标
- 2
- 派生
- 0
- 平均合并
- 10 小时 32 分钟
- 30 天内合并 PR
- 269
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
registrystack/registry-stack 的其他 Issue
-
area:docs documentation
难度 2/5 1-3 小时 新手友好度 76/100
registrystack/registry-stack#2253 ·
维护者通常 1 天内回复
-
area:coordinator bug
难度 2/5 1-3 小时 新手友好度 82/100
registrystack/registry-stack#2252 ·
维护者通常 1 天内回复
-
area:release bug
难度 2/5 1-3 小时 新手友好度 74/100
registrystack/registry-stack#2248 ·
维护者通常 1 天内回复
-
area:breg documentation
难度 1/5 1-3 小时 新手友好度 88/100
registrystack/registry-stack#2233 ·
维护者通常 1 天内回复
-
area:breg bug
难度 2/5 1-3 小时 新手友好度 88/100
registrystack/registry-stack#2227 ·
维护者通常 1 天内回复
查看 registrystack/registry-stack 的全部 Issue
相似的 Issue
-
area:cli bug good first issue priority:medium
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
aaif-goose/goose#13031 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
meta.json, text.txt and try JSON are written non-atomically可能已有人在做 @qwertymuzaffar 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
qwertymuzaffar/parrot#47 ·
维护者通常 1 天内回复
-
priority: medium
难度 2/5 1-3 小时 新手友好度 66/100
storytold/photocraft#8041 · 1 条评论 ·
维护者通常 1 天内回复