#15
feat(stack): add landing commands
Summary
- add
try stack land,try stack land-status, andtry stack land-cancel - resolve repository context and render current landing status for human and JSON output
- cover the public API methods, paths, and request bodies with command tests
Verification
cargo fmt --checkcargo test config::cli::tests::test_stack_api_flags_parsecargo test --test trylle_cli_commands_mock stack_landing_commands_use_the_public_api- full
cargo test: all 263 unit tests pass; the existing macOS/private/varversus/varpath assertion intests/about_cli.rsfails
Companion platform branch: stylessh/stack-landing
Activity
3trylle-botreviewed4mo ago
This pull request is a draft
Merging is unavailable until it is marked ready for review.
Reviewed the full diff against the surrounding code in
src/trylle/mod.rs,src/trylle/api.rs, andsrc/main.rs. The command wiring, request paths, and body shapes all match the existing conventions in this file, and the test coverage of the API surface (methods, paths,Do/allow_stack_partial_mergebodies) is genuinely good —stack_landing_commands_use_the_public_apiasserts the request bodies, not just the responses.Three findings, left inline. One I'd consider blocking.
Blocking
stack statusexits 1 when no landing exists (src/trylle/mod.rs:2807).stack_landing_from_statuserrors on absent/nullstackLanding, andmain.rsturns that intoexit(1)with empty stdout — even under--json. "Not started yet" is the normal state for the obvious polling loop, sotry stack status --json | jqbreaks andset -escripts abort. Suggest emittingValue::Nullforstatus(the prevailing idiom in this file) while keeping the hard error forcancel.Non-blocking
landing_idin the request path (src/trylle/mod.rs:2827). Every other dynamic segment here goes throughapi::encode_segment; this one is server-controlled and interpolated raw.reqwest::Url::parsecollapses../, so a malformed id retargets an authenticated POST rather than 404ing. Latent today, one-line fix.cancelable(src/trylle/mod.rs:2814). A landing that completes between the GET and the POST means cancelling a different landing than the user saw. Separately, thecancelableflag in the response is never read (grep -rn cancelable src/is empty), so cancelling a terminal landing surfaces as a rawHTTP 4xxstring.Coverage notes
stackLandingpath at the command level —extracts_stack_landing_from_pull_statuscovers the helper in isolation, which is why the exit-code behavior above isn't caught.landingpresent but noid), nor--pullomitted soresolve_stack_pullfalls back to the current branch.try stack land/land-status/land-cancel, but the subcommands aremerge/status/cancel. Worth reconciling before this lands so the release notes are right.I did not run the build — no Rust toolchain in this sandbox, so the
cargo testresults in the PR description are taken as reported and not independently verified.