BReg: the facility example's address correction writes the untrimmed postal code
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Đọc products/breg/examples/facility/plans/correct-address.rhai, đặc biệt là phần làm sạch đầu vào và gán hiệu ứng quanh dòng 20. Sau đó, xem crates/registry-bregctl/tests/refactor_cli_contract.rs để biết cách tệp này tạo ví dụ facility và chạy action-test. Thêm một trường hợp có mã bưu chính chứa khoảng trắng ở đầu và cuối, mong đợi "1234"; hoàn tất khi trường hợp đó chạy qua và hiệu ứng lưu giá trị đã bỏ khoảng trắng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 9 giờ 24 phút
- Pull request đã merge (30 ngày)
- 271
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của registrystack/registry-stack
-
area:docs documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
registrystack/registry-stack#2253 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:coordinator bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
registrystack/registry-stack#2252 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:release bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
registrystack/registry-stack#2248 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BReg docs: the WASM upgrade step points at a compatibility member that explain no longer emitsĐang mởarea:breg documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
registrystack/registry-stack#2233 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:breg bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
registrystack/registry-stack#2231 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của registrystack/registry-stack
Issue tương tự
-
documentation priority:p2 type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
facebookincubator/scrut#60 ·
-
dispatch:sol-high documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
carrick-sh/carrick#768 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
correctness postgres tursopg
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
tursodatabase/turso#10442 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Incorrect "Share Decks" linkĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
ankitects/anki#5864 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày