Repository navigation
fix(scripts): build, then run the command after a leading --build - #65
Conversation
The wallet picker listed only a name and an ID, so a USD wallet looked like a BTC wallet. Each wallet now shows its currency between the two when all of its balances report the same one, and typing the currency filters on it. A wallet with no balance currency, or with balances that disagree, shows only its name and ID. Closes #50
d8fdb1a to
386c61c
Compare
a4e0621 to
8dd04b0
Compare
thebrandonlucas
left a comment
There was a problem hiding this comment.
Review at 8dd04b0 (Aurelius). No findings.
I ran both wrappers on this head:
voltage-local --build --config-dir xrefuses before building, with exit 1.- A stub
cargothat exits 3:voltage-local --build --versionandvoltage-staging --build --versionboth exit 3 without running the binary. voltage-local --build --versionbuilds, then printsvoltage 0.1.0 (8dd04b0).voltage-local --buildalone builds, then exits 0.voltage-staging --build --versionwith no.envbuilds, then stops at "Missing .env".
The build environment is now a copy, so the cargo PATH and RUSTUP_HOME no longer leak into the binary's environment in voltage-local. That is an improvement.
Note: the repository has no test harness for scripts/, so these paths have no automated test. I don't count that as a finding for this PR.
Checks on 8dd04b0: fmt, clippy, machete, tests (109 unit, 93 integration) and coverage pass, and the tree is clean. CRAP: 0 functions at or above 20. The highest is wait_for_payment at 19.60. Signed G blu@blu.cx, with no trailers.
thebrandonlucas
left a comment
There was a problem hiding this comment.
First review at 8dd04b0, against 386c61c. This is not an approval. The change does what #37 asks: a leading --build builds, then runs the rest of the arguments. The refused flags are still checked before the build.
1. Low: voltage-staging --build CMD builds before it checks .env (scripts/voltage-staging:37-46). With a missing or bad .env, the person waits for a full cargo build and then gets "Missing .env". I reproduced this: with no .env, --build --version builds, then exits 1. Fix: when args is not empty after --build, check .env first. --build alone should still not read .env, and its build environment should still have no VOLTAGE_* variables. One way is to move the .env checks into a function, and call it before the build when args is not empty.
2. Nit: the PR description's Checks are for head a4e0621, not 8dd04b0. Update the head hash.
Untested paths: the repository has no tests for the wrapper scripts, so the new paths (build failure, --build alone, --build with a command) are covered only by the manual runs in the description. That is acceptable for development scripts. If you add tests later, a test that runs --build --config-dir x and expects the refusal would be cheap.
Checks on 8dd04b0:
- Gate in
nix develop: fmt, clippy, machete, tests (109 unit, 93 integration) and coverage pass, and the tree is clean afterwards. - By hand:
voltage-local --build --versionprints the version, exit 0.voltage-local --build --config-dir xis refused, exit 1.voltage-staging --build --api-url=xis refused before any build, exit 1.voltage-staging --build --versionwith no.envbuilds, then exits 1 with "Missing .env".
- CRAP: not run, because there is no change to
src/ortests/. The base scores 0 functions at or above 20.
There was a problem hiding this comment.
Duplicate of #65 (review) (Cicero). A GitHub error made me post it twice.
`scripts/voltage-staging --build login ...` passed `--build` to the binary, which rejected it. A leading `--build` in either wrapper now builds and then runs the remaining arguments, if any. The wrapper still refuses `--config-dir`, `--api-url` and `--auth-url` before it builds, and a failed build exits with cargo's status without running the command. Closes #37.
8dd04b0 to
e3e0c9a
Compare
|
Fixed Cicero's findings in |
thebrandonlucas
left a comment
There was a problem hiding this comment.
Re-review at e3e0c9a. This is not an approval. Both of my findings are fixed, and I found nothing new.
- With a command after
--build,.envis now checked beforecargo_build()runs. --buildalone still exits before it reads.env.- The build environment is still built from
os.environwithVOLTAGE_*removed, and the.envvalues are never merged into it. - The PR description now names
e3e0c9a.
Checks, run by hand with a cargo stub and VOLTAGE_API_KEY exported:
--build --versionwith no.env: "Missing .env", exit 1, and no build.--buildalone: builds, and the build sees 0VOLTAGE_*variables. Exit 0.--buildalone with a build that exits 3: the wrapper exits 3.- The commit is signed
G blu@blu.cx. I did not run the gate or CRAP, because onlyscripts/anddocs/changed since8dd04b0, where both passed.
tee8z
left a comment
There was a problem hiding this comment.
Reviewed at e3e0c9a. I ran each row of the description's behavior table against both wrappers with a stubbed cargo, and every row holds. No src/ or tests/ changes, so no CRAP run is needed. No blocking issues.
docs/development.mdnow documentsvoltage --build login …, and step 4 then suggests folding--profile staginginto the alias. After that,--buildis no longer first: it is forwarded to the binary and clap rejects it, the same symptom as #37. Either strip--buildwherever it appears, or add a sentence saying it must come first.- Nit:
scripts/voltage-staginghas acargo_build()helper whilescripts/voltage-localinlines the same logic. One shape would keep them from drifting. - The PR description ends with a "Generated with Claude Code" line; AGENTS.md says to leave tool attribution out of PR descriptions.
tee8z
left a comment
There was a problem hiding this comment.
Approved e3e0c9a against feat/cli-picker-currency. The leading --build behavior, failed-build exit status, pre-build rejection paths, and credential isolation passed wrapper checks. The profile alias limitation is a nonblocking documentation follow-up: --build must be the first wrapper argument.
Validation on this unchanged head: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata, cargo test --locked, and python3 scripts/check-coverage.py passed. Wrapper behavior checks also passed. CRAP is not required because this layer changes no Rust source or tests.
c1dc498
into
feat/cli-next-step-after-accept
* feat(cli): show each wallet's currency in the picker The wallet picker listed only a name and an ID, so a USD wallet looked like a BTC wallet. Each wallet now shows its currency between the two when all of its balances report the same one, and typing the currency filters on it. A wallet with no balance currency, or with balances that disagree, shows only its name and ID. Closes #50 * fix(scripts): build, then run the command after a leading --build `scripts/voltage-staging --build login ...` passed `--build` to the binary, which rejected it. A leading `--build` in either wrapper now builds and then runs the remaining arguments, if any. The wrapper still refuses `--config-dir`, `--api-url` and `--auth-url` before it builds, and a failed build exits with cargo's status without running the command. Closes #37.
* feat(cli): name the next step after an accepted receive or quote An accepted payments receive or quotes create returns no body, so human output now names the command that shows the invoice, address, or quote, with the --org, --env, and --account that the command used. --quiet and machine-readable output leave the hint out, and so does a request body without an ID. A command that takes a resource ID also takes it as --id, as quotes create and payments send do, and rejects both at once. Closes #52 Closes #36 * feat(cli): show each wallet's currency in the picker (#64) The wallet picker listed only a name and an ID, so a USD wallet looked like a BTC wallet. Each wallet now shows its currency between the two when all of its balances report the same one, and typing the currency filters on it. A wallet with no balance currency, or with balances that disagree, shows only its name and ID. Closes #50 * fix(scripts): build, then run the command after a leading --build (#65) * feat(cli): show each wallet's currency in the picker The wallet picker listed only a name and an ID, so a USD wallet looked like a BTC wallet. Each wallet now shows its currency between the two when all of its balances report the same one, and typing the currency filters on it. A wallet with no balance currency, or with balances that disagree, shows only its name and ID. Closes #50 * fix(scripts): build, then run the command after a leading --build `scripts/voltage-staging --build login ...` passed `--build` to the binary, which rejected it. A leading `--build` in either wrapper now builds and then runs the remaining arguments, if any. The wrapper still refuses `--config-dir`, `--api-url` and `--auth-url` before it builds, and a failed build exits with cargo's status without running the command. Closes #37.
Stack 4 of 6. Base:
feat/cli-picker-currency(#64). Next:feat/cli-403-credential-source.Closes #37.
Problem
scripts/voltage-stagingandscripts/voltage-localaccepted--buildonly as the sole argument.scripts/voltage-staging --build login --account mepassed--buildto the binary, and clap rejected it with a usage line that showed the wrapper's injected flags.docs/development.mdshowsvoltage --buildin an alias block, so it looks like a flag you can combine with a command.Behavior
--build--build CMD ...CMD ...through the wrapper.--buildwith--config-dir,--api-urlor--auth-urlvoltage-staging --build CMD ...with a missing or invalid.env--buildalone needs no.env.--build CMD ...and the build fails--buildanywhere but firstVOLTAGE_*variables, so it does not see staging credentials.docs/development.mddescribes the leading--buildin the scripts list and in the staging walkthrough.voltage.Checks
On head
e3e0c9a:cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo machete --with-metadata,cargo test --locked(109 unit, 93 integration), andpython3 scripts/check-coverage.pypass innix develop. These ran on8dd04b0, the previous head of this PR.e3e0c9achanges onlyscripts/voltage-staginganddocs/development.mdfrom it, and this PR changes no Rust.nix develop:voltage-local --buildbuilds, exit 0.voltage-local --build --versionprints the version.voltage-local --build --config-dir xis refused, exit 1.RUSTFLAGS=--bogus voltage-local --build --versionexits 101 and prints no version.voltage-staging --build --versionwith a test.envprints the version. Without.env, it reports the missing.envand does not build. With a.envof mode 644, it reports the mode and does not build.voltage-staging --buildwith no.envbuilds, exit 0. The build sees noVOLTAGE_*variables, checked with acargostub.voltage-staging --build --api-url=xis refused before building.RUSTFLAGS=--bogus voltage-staging --build --versionexits 101. Acargostub that exits 3 makes it exit 3 and run nothing.src/ortests/changed. The base scores 0 functions at or above 20, highestwait_for_paymentat 19.60.voltage-pr-review.Current-head reviewer validation
Reviewed
e3e0c9aagainstfeat/cli-picker-currency. The head is unchanged from the completed local review.cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo machete --with-metadata,cargo test --locked, andpython3 scripts/check-coverage.py. These reviewer checks used Rust 1.98.1 on Linux.src/ortests/files. Wrapper success, rejection, missing/private.env, build failure, and environment-isolation checks passed.