BReg: the facility example's address correction writes the untrimmed postal code
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
調査の方向性
products/breg/examples/facility/plans/correct-address.rhaiを読み、特に20行目付近の入力のクリーンアップとエフェクトの割り当てを確認してください。次に、crates/registry-bregctl/tests/refactor_cli_contract.rsを調べ、facilityの例をどのように構築してaction-testを実行しているかを確認してください。前後に空白のある郵便番号を指定し、"1234"を期待するケースを追加してください。そのケースが成功し、エフェクトに空白を除いた値が保存されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 2
- フォーク
- 0
- 平均マージ
- 9時間 24分
- マージ済み PR(30日)
- 271
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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時間 初心者へのやさしさ 90/100
registrystack/registry-stack#2231 ·
メンテナーはふだん 1 日以内に返信
registrystack/registry-stack の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
Negative subscript on a sparse array counts from the number of elements, not from the highest indexオープンarea: compat bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
reubeno/brush#1570 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
longbridge/gpui-kit#3620 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
mongodb/kingfisher#564 ·
メンテナーはふだん 1 日以内に返信