bregctl: project lock adds a missing digest after the entry's trailing blank line
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 90/100
Línea de trabajo
Empieza en crates/registry-bregctl/src/module_lock_patch.rs, especialmente en patch_module_locks y key_value_end, y luego lee las pruebas unitarias de ese archivo. Comprueba dónde queda item.end en una entrada final y en una entrada seguida de una línea en blanco. Añade pruebas para ambos casos; el trabajo estará terminado cuando el digest permanezca junto a su entrada y se conserve la línea en blanco antes de la siguiente clave de nivel superior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 2
- Forks
- 0
- Merge medio
- 9 h 24 min
- PR fusionados (30 d)
- 271
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de registrystack/registry-stack
-
area:docs documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
registrystack/registry-stack#2253 ·
Los mantenedores suelen responder en 1 día
-
area:coordinator bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
registrystack/registry-stack#2252 ·
Los mantenedores suelen responder en 1 día
-
area:release bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
registrystack/registry-stack#2248 ·
Los mantenedores suelen responder en 1 día
-
BReg docs: the WASM upgrade step points at a compatibility member that explain no longer emitsAbiertoarea:breg documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
registrystack/registry-stack#2233 ·
Los mantenedores suelen responder en 1 día
-
area:breg bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
registrystack/registry-stack#2227 ·
Los mantenedores suelen responder en 1 día
Todos los issues de registrystack/registry-stack
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
chrisdickinson/trivia#26 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100