mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-22 08:01:32 +01:00
On Capy, /ship hands its pull request edits and comments to Capy's PR tool, always naming the right repository (GST-3183) (#4518)
On Capy, /ship's PR body edits, comments and new PRs no longer go out through `gh` under the machine owner's GitHub account. Each write runs its checks, saves the exact text to a private file and prints a `HOST_PUBLISH:` line that names the repository (and host, off github.com) it belongs to, so Capy's PR tool sends it to the same place `gh` would have. Nothing changes outside Capy (`GSTACK_CAPY` unset). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=specialist-batched Review-Finding: p1/specialist-batched#3 reader=specialist-batched Review-Finding: p1/red-team#6 reader=red-team Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/specialist-batched#2 reader=testing
This commit is contained in:
1 parent
ed267248d3
commit
e95cea8404
15 files changed
+479
-18
No files matched your search
@@ -3309,6 +3309,32 @@ the same digits with a `+`, spaces, dashes, dots or parentheses still report.
|
||||
using the `TOKEN:` line the refusal printed; MEDIUM findings do not block
|
||||
pushes.
|
||||
|
||||
<a id="host-publish"></a>
|
||||
### Host publish
|
||||
|
||||
**Meaning.** A `HOST_PUBLISH:` line means nothing was sent through gh. On Capy (`GSTACK_CAPY=1`) the machine's `gh` is signed in as the owner's own GitHub
|
||||
account, so gstack never writes to GitHub through it there (GST-3183). `gstack-post` (every write
|
||||
op) and `gstack-ship-receipt stub`, `stop`, `claim` and `carry` with `--pr` run all their checks as
|
||||
before, then write the exact title and body they would have sent to
|
||||
a new private directory `<state root>/publish/<op>-<target>-<random>/<part>.md` (mode 0600, so one
|
||||
hand-off never overwrites another still waiting to be published) and print one line:
|
||||
`HOST_PUBLISH: <op> <target> repo=<owner/name> [host=<host>] [to=<comment id>] [base=<branch>] [head=<branch>] [draft] body-file=<path> [title-file=<path>] (...)`,
|
||||
which names everything gh would have worked out from the checkout: `repo=` always (read with `gh repo view
|
||||
--json nameWithOwner,url`, so a fork checkout's `gh repo set-default` or `GH_REPO` is honoured as gh's write
|
||||
would have; `gstack-post` on GitLab uses the origin remote), `host=` when it is not
|
||||
github.com, a reply's comment, and a new PR's base, head (the current branch when `--head` is not passed) and draft
|
||||
state. Nothing reached GitHub yet. When the repository cannot be resolved the command refuses and prints no line,
|
||||
because a hand-off without one would land on whatever repository the host tool defaults to.
|
||||
|
||||
**Fix.** Publish the named files with the host's PR tool before the next gstack step, always passing `repo=`
|
||||
(Capy's `repo` argument) so a multi-repo or fork thread edits the right pull request; a `host=` the host tool
|
||||
cannot reach goes to whoever owns the work. Use `pr-body` and
|
||||
`pr-title` with Capy's `tools.pr.edit`, `pr-comment` and `reply` with `tools.pr.comment`, `pr-create`
|
||||
with `tools.pr.create`. Capy has no GitHub issue tool, so an `issue-create` or an `issue-comment` on an
|
||||
issue goes to whoever owns the work. Never run the `gh` write yourself. `claim` cannot read its own
|
||||
marker back before you publish, so a second run that claims the same grant is caught by the next
|
||||
`gstack-ship-receipt history` instead (`PR_REVIEW_GRANT: not applied`).
|
||||
|
||||
<a id="gstack-post-pr-body-merge"></a>
|
||||
### `gstack-post pr-body` kept sections the body file did not contain
|
||||
|
||||
|
||||
Reference in new issue
Block a user