BReg: the facility example's address correction writes the untrimmed postal code
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
Direzione di ricerca
Leggi products/breg/examples/facility/plans/correct-address.rhai, in particolare la pulizia dell’input e l’assegnazione dell’effetto intorno alla riga 20. Poi esamina crates/registry-bregctl/tests/refactor_cli_contract.rs per vedere come costruisce l’esempio facility ed esegue action-test. Aggiungi un caso con un codice postale con spazi iniziali e finali che si aspetti "1234"; il lavoro è concluso quando il caso passa e l’effetto memorizza il valore senza spazi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 9h 19m
- PR unite (30g)
- 275
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di registrystack/registry-stack
-
test(breg): postgres_startup needs the tooling feature its required-features does not declareApertaarea:breg bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
registrystack/registry-stack#2307 ·
I maintainer di solito rispondono entro 1 giorno
-
area:breg area:docs documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
registrystack/registry-stack#2302 ·
I maintainer di solito rispondono entro 1 giorno
-
area:docs documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
registrystack/registry-stack#2253 ·
I maintainer di solito rispondono entro 1 giorno
-
area:coordinator bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
registrystack/registry-stack#2252 ·
I maintainer di solito rispondono entro 1 giorno
-
area:release bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
registrystack/registry-stack#2248 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di registrystack/registry-stack
Issue simili
-
state:triage-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
pedrovgs/UseCaseCoverage#23 ·
-
area: library data-loss tier: p0 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno