cli: delegate 'pulp pr' to 'shipyard pr' by default; --native preserves fallback (#352) - #376
Conversation
…es fallback (#352) Issue #352 tracked two related problems in the CLI release path: the duplicate 'pulp pr' / 'shipyard pr' orchestrators risking drift, and 'pulp upgrade' looking up release assets with the wrong filename template. This PR closes the consolidation half. Per the user's preferred option-B plan in #352's comment thread: - 'pulp pr' now locates shipyard on PATH and execs 'shipyard pr <forwarded args>' when available. Shipyard becomes the single source of truth for the push-a-PR orchestrator; the parallel in-CLI implementation stays around as an explicit fallback. - When shipyard is not on PATH, 'pulp pr' prints a concise install guide pointing at tools/install-shipyard.sh + the ~/.pulp/bin PATH hint, and exits 2. - 'pulp pr --native' forces the in-CLI implementation. This keeps the 384-line native flow available as a diagnostic fallback when shipyard itself is broken or under debug — same behavior as before this change, just no longer the default. The natural-language triggers ("push a PR" / "ship this") stay routed through 'pulp pr' per CLAUDE.md and the ci skill — no doc churn required. The native flow's --dry-run / --no-ship / --no-push options still work via --native. ### Verification Smoke-tested on the built binary: - 'pulp pr --help' with shipyard on PATH → shipyard's help prints. - 'pulp pr' with shipyard NOT on PATH → install hint + exit 2. - 'pulp pr --native --help' → native pulp-cli help prints. ### Not done in this PR The 'pulp upgrade' 404 fix (wrong asset filename template) is still open in #352 as a separate sub-task. Will follow in its own PR since the fix is in cmd_upgrade.cpp and the flows don't overlap.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c238cec10
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const auto& a : args) { | ||
| cmd << " '" << a << '\''; | ||
| } |
There was a problem hiding this comment.
Escape forwarded args before invoking shell command
exec_shipyard_pr wraps each forwarded argument in single quotes but never escapes embedded ', then runs the string via std::system. Any pulp pr argument containing an apostrophe will break parsing (and can inject extra shell tokens), so delegated runs can fail before shipyard starts. This is especially risky because this path is now the default for all non---native invocations.
Useful? React with 👍 / 👎.
Unblocks the skill-sync gate on PR #376 — modifying `cmd_pr.cpp` maps to the cli-maintenance skill, so the shim/hint/`--native` contract belongs here. Updates: - Describe the shim-over-shipyard default. - Spell out the `--native` forensic fallback (not the primary path). - Re-scope the install-hint guidance so future edits to `tools/install-shipyard.sh` have a clear callsite reminder.
Closes the consolidation half of #352. Per the user's preferred option-B plan in the issue thread:
The natural-language triggers ("push a PR" / "ship this") stay routed through `pulp pr` per CLAUDE.md and the ci skill — no doc churn required. The native flow's `--dry-run` / `--no-ship` / `--no-push` options still work via `--native`.
Verification
Smoke-tested on the built binary:
Not done in this PR
The `pulp upgrade` 404 fix (wrong asset filename template) is still open in #352 as a separate sub-task. Will follow in its own PR since the fix is in `cmd_upgrade.cpp` and the flows don't overlap.
Related