Skip to content

cli: delegate 'pulp pr' to 'shipyard pr' by default; --native preserves fallback (#352) - #376

Merged
danielraffel merged 2 commits into
mainfrom
feature/pulp-pr-shipyard-shim
Apr 17, 2026
Merged

cli: delegate 'pulp pr' to 'shipyard pr' by default; --native preserves fallback (#352)#376
danielraffel merged 2 commits into
mainfrom
feature/pulp-pr-shipyard-shim

Conversation

@danielraffel

Copy link
Copy Markdown
Collaborator

Closes the consolidation half of #352. Per the user's preferred option-B plan in the issue thread:

  • `pulp pr` now locates shipyard on PATH and `exec`s `shipyard pr ` when available. Shipyard becomes the single source of truth for the push-a-PR orchestrator; the parallel in-CLI implementation stays 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 (`PATH=/tmp`) → 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.

Related

…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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tools/cli/cmd_pr.cpp
Comment on lines +310 to +312
for (const auto& a : args) {
cmd << " '" << a << '\'';
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.
@danielraffel
danielraffel merged commit 81023b1 into main Apr 17, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant