Commit 3817366
committed
fix(submit-proposals): pipe commit message and PR body via stdin (B10)
Bug surfaced in production on 2026-04-19 while opening a proposal batch
PR via `submit-proposals.ts --pr`. Two symptoms:
1. commit message came out with empty slots where term IDs should be:
- (zk-compression): Bubblegum Asset PDA
- (zk-compression): cNFT Tree Pool
instead of the expected `bubblegum-asset-pda (zk-compression): ...`.
2. `gh pr create` failed outright with errors like
/bin/sh: 1: bubblegum-asset-pda: not found
/bin/sh: 1: validate-term-proposal.ts: not found
(one per backtick in the body) and returned exit code 1, so
`pr_url` came back null even though the branch + commit had been
made successfully.
Root cause: both `commitProposals` and `submitPr` embedded the message/
body into the shell command string via template literal, only escaping
double quotes. Any backtick in the text (plentiful: term IDs are
formatted as `` `id` ``, and the PR body had an inline code block
mentioning `validate-term-proposal.ts`) was interpreted as command
substitution by /bin/sh, which then tried to execute each ID as a
shell command.
Fix: pipe the message via stdin using the native "read from stdin"
options — `git commit -F -` and `gh pr create --body-file -`. execSync
accepts an `input` option that pipes a string to stdin of the spawned
process, so there is no shell quoting step at all.
Validation: full submit-proposals --pr flow run end-to-end, produced a
real PR (solanabr#47 against solanabr/solana-glossary) with correct commit
message and correctly-rendered body. typecheck clean.1 parent 215b080 commit 3817366
1 file changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
558 | | - | |
559 | | - | |
560 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
561 | 566 | | |
562 | 567 | | |
563 | 568 | | |
| |||
587 | 592 | | |
588 | 593 | | |
589 | 594 | | |
590 | | - | |
591 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
592 | 601 | | |
593 | | - | |
594 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
595 | 608 | | |
596 | 609 | | |
597 | 610 | | |
| |||
0 commit comments