BReg: the facility example's address correction writes the untrimmed postal code
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
- 88/100
Línea de trabajo
Lee products/breg/examples/facility/plans/correct-address.rhai, especialmente la limpieza de la entrada y la asignación del efecto alrededor de la línea 20. Después, revisa crates/registry-bregctl/tests/refactor_cli_contract.rs para ver cómo construye el ejemplo de facility y ejecuta action-test. Añade un caso con un código postal con espacios alrededor que espere "1234"; estará hecho cuando el caso pase y el efecto almacene el valor sin espacios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The facility example's address correction Action trims the postal code, checks it, and then
writes the original input. products/breg/examples/facility/plans/correct-address.rhai reads
the input on line 2, calls postal_code.trim() on line 3 (Rhai's trim changes the string in
place and returns nothing), refuses an empty value on line 4, and then on line 20 sets the field
from ctx.inputs["postal-code"] instead of postal_code. A padded value passes the check and is
stored with its spaces. Readers copy this example as the pattern for input cleanup, so it
teaches the bug.
Minimal repro, with a copy of products/breg/examples/facility in facility/:
cat > in.json <<'E'
{"facility":"00000000-0000-4000-8000-000000000001","address-line":"2 Market Street","city":"Example city","postal-code":" 1234 "}
E
cat > trimmed.json <<'E'
{"effects":[{"id":"facility-address","set":{"address-line":"2 Market Street","city":"Example city","postal-code":"1234"}}]}
E
bregctl --format json project action-test --action correct-address --input in.json --expect trimmed.json facility
The run fails with action-test.expect.mismatch at expect/effects/0/set/postal-code. The same
run passes when the expectation's postal-code is " 1234 ".
Expected: the effect sets postal-code to "1234".
Likely fix: on line 20 of correct-address.rhai, write "postal-code": postal_code. The docs
page docs/site/src/content/docs/configure/breg-actions.mdx excerpts only lines 1 to 11 of this
script (its test-excerpt), so the excerpt gate is unaffected.
Tests: the example has no action-test case today. crates/registry-bregctl/tests/refactor_cli_contract.rs
already builds a project from products/breg/examples/facility; an action-test run there with
a padded postal code and an --expect of "1234" would pin the behavior. The example's own
examples/inputs/correction.json uses an unpadded postal code, so it does not catch this.
- 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 90/100
registrystack/registry-stack#2231 ·
Los mantenedores suelen responder en 1 día
Todos los issues de registrystack/registry-stack
Issues similares
-
llm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BerriAI/litellm#47884 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug(stubgen): `typing` / `_typeshed` imports are emitted above `from __future__ import annotations`Abiertostubgen
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
bug-hunt confirmed good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area: pcb area: rendering priority: high status: needs-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
Update webpki-root-certsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
rustls/rustls-platform-verifier#262 · 2 comentarios · 2 reacciones ·