Repository navigation
Commit d852819
Add
* Add `socket-patch report` to tell Socket that a patch broke something
There was no way to say that a patch broke a project: rollbacks were
counted, but nothing said why, and a patch that broke a build without
being rolled back was never heard of.
`socket-patch report <patch>... [--reason build|tests|runtime|other]
[--message <text>]` sends one `patch_reported` event on the route the
run's telemetry takes. It names each patch by UUID with its ecosystem
and patch mode, the reason, and the message the user typed (on one
line, URL credentials and the home directory redacted, cut to 1000
characters). No package name, path or file content is sent.
A PURL or a package name selects the patches the project holds for
that package; a UUID names any patch, so one that was already rolled
back can still be reported. A name the project holds no patch for, or
one that reaches several packages, is an error and sends nothing.
A report is something the user asked to send, so the telemetry
opt-outs do not stop it; `--offline` does. Unlike a telemetry event the
run waits for the answer, and a report the endpoint did not take is a
failed run (`report_not_sent`, exit 1). `--dry-run` shows what would be
sent. The project is never changed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Name the report command after a rollback of named patches
A patch is usually rolled back because it broke something, and once it
is off the project no longer holds it: only its UUID still names it.
A `rollback` that named its targets, took off one to three patches and
runs at a terminal with a person at it now ends with one line giving
the command that reports them:
Did this patch break something? Tell Socket: socket-patch report
<uuid> --message "what happened"
Never on a dry run, under `--json` or `--silent`, in a pipe, in an AI
coding agent's terminal, or after a bare `rollback`.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Address review: report every patch named, under the mode the build uses
Findings from the review of the `report` command, fixed:
- A report of more than 50 patches said all were reported while the
event carried 50. One report now names at most 50 and never leaves one
out: more is `too_many_patches`, and a long message beside a full
list is cut further instead of the list.
- A patch that is both in the manifest and vendored was reported as an
agent patch, a manifest record the vendored artifact had replaced was
reported in its place, and a vendor ledger entry with no embedded
record could not be named at all. The report now reads the vendor
ledger's own entries and names the patch the build consumes: the
vendored artifact, else the hosted pin, else the manifest's record.
- The hint after a rollback printed the recorded patch id inside a
command to run. A manifest's `uuid` is a string a project file
supplies, so only an id that is a UUID is printed; a run that took
off a patch with any other id prints no hint.
- A saved login the org endpoint refuses (401 / 403) failed the report.
It is sent again without the token, on the public route.
- A report that got no answer now says why (the cause chain of the
request error), not only that the request failed.
- A manifest or vendor ledger that cannot be read is named as the
problem when a PURL or a name then matches nothing, instead of
`patch_not_found`. A report by UUID still goes out.
- A human run prints the whole report: each patch with its mode, and
the message as it was sent, so `--dry-run` shows the redaction.
- Comments no longer describe a `rollback --report` flag.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Refuse a name report while a patch store can't be read
A name or purl was resolved against the stores that could still be read,
so with an unreadable vendor ledger a report went out under the
manifest's or a hosted pin's UUID and mode, not the vendored copy the
build consumes. Refuse any non-UUID target with the store's error and
the UUID hint instead; a UUID report still goes out.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>socket-patch report to tell Socket that a patch broke something (#2193)1 parent 067f1ad commit d852819
14 files changed
Lines changed: 1987 additions & 25 deletions
File tree
- crates
- socket-patch-cli
- src
- commands
- tests
- rollback
- socket-patch-core/src
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments