Repository navigation
Record what the refactoring breaks for code importing probe - #489
Conversation
The refactoring series moves the packages only probe imported under internal/, reshapes the root package, actionrpc's runner side and the built-in actions' packages, and gives external actions actionrpc's DecodeParams and friends in place of mapping. The changelog tells a library user what to use instead of each, and lists the behaviour changes a workflow may notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6CYBxNCxQyo1rbdg9hQ42
linyows
left a comment
There was a problem hiding this comment.
Adversarial accuracy pass over the Unreleased section, against v1.29.0 vs origin/docs/changelog-refactor (834b1f9).
What I verified
- Ran
apidiff -mfrom v1.29.0 to this head. Every incompatible change it reports is covered: the 10 removed packages, all root-package removals and signature changes (NewExecutor,NewPrinter,JobResult.Status, theJobContextfields,ActionRunner.Run),actionrpc(RunStep/RunExecutableStep/Runremoved,RunExecutable/Client.RunStepchanged,Server.Run/Cleanupnow takinginternal/pbtypes), everyServe/Keeps/Paramsof the action packages,embedded.ServeWithActions, the 16 imapReqmethods, and all the smtp removals and changes. I found no incompatible change that is missing. - I checked
go docon old and new for:actions.Configure(it sets exactlyActionsandNeedsNoCheck),actions.CheckOptions(it fills every field exceptManifest),DecodeParams/EncodeResult/ParamNames/ParseTimeout,RunBuiltin/RunExecutable,TermGrace/ExitWait,ReadJobFile,WithActionRunner/WithNeedsNoCheck,Executor.Run,RunOptions.Context,Workflow.Env(v1.29.0StartmergedConfig.Envintow.env),smtp.Dial/Deliver/Bulk.DeliverWithResult, imapRequest/NewReq/Req.Do, andResult.SetReporter,StepResult.Failure,Config.BaselineandProbe.ExitStatusas the replacements named. The oldactionrpc.Run/RunStep/Client.Runsignatures match the Before column. - I read the code behind these behaviour claims and found each accurate: the
JobResult.Statusstrings in v1.29.0 (Running/Completed/Failed/skipped). The code-built job ID that fell back to its name (old workflow.go:230).PROBE_TTYmoving fromprobe.Newtocmd/probe.Intervalgoing throughduration.Parsewith the errorinvalid duration %v: %w.duration.Parserounding to the nearest ns, where the oldmapping.ParseTimeouttruncated. Thetime.Durationfield that now refuses numbers (the old code converted 30 to 30ns). Ints that are refused rather than truncated, and bools that take 0 and 1. Themap[string]stringpath throughStringMap. The shell, ssh, grpc, db and dns timeouts: ssh and grpc used baretime.ParseDuration, db and dns took integers only, and shell accepted 0. The http timeout, where 0 still means no limit and the too-long, sub-nanosecond and wrap cases are refused. The smtp bounds (maxSession=1000,maxLength=100<<20,maxTimeout=24h,defaultTimeout=1m). OldRes.FilePathalways empty, becauseProcessHttpBodygottext/plain. Oldwaitinteger-only parsing. The PR attributions for #475 and #485.
Findings (inline): one must-fix, that the hello paragraph is framed against an intermediate state rather than v1.29.0. Two should-fix: Behaviour Changes leaves out several user-visible changes merged to main after v1.29.0, and the "workflow files are not affected" scope sentence. Two nits on completeness.
Style nit, not inline: earlier ### Behaviour Changes sections (v1.18.0, v1.19.x) are prose paragraphs without PR numbers. This one is a bullet list with (#NNN). That is arguably better for a list this long, but it differs from the existing entries.
|
|
||
| #### The steps that pass without a test | ||
|
|
||
| The engine no longer knows the `hello` action by name. Which actions' steps |
There was a problem hiding this comment.
must-fix. This is framed against an intermediate state, not v1.29.0. v1.29.0's engine never knew hello by name: there is no "hello" in any non-test root file at the tag. The special case came in after v1.29.0, with d54472f ("Do not warn of a hello step that has no test") and 803cb78 ("Pass a hello step that has no test when it runs"), via #448. It was then moved out to NeedsNoCheck in this series. So against v1.29.0, the engine does not "no longer" know hello. What changed for library users is that Config.NeedsNoCheck/CheckOptions.NeedsNoCheck/WithNeedsNoCheck are new, and leaving them unset keeps v1.29.0's behaviour, which the last sentence already says correctly. Suggest dropping the first sentence, or rewording it to "The engine does not know the hello action by name: which actions' steps pass without a test is told to it ...".
The change is also user-visible and missing from Behaviour Changes: with the probe command, probe check no longer warns of a hello step without a test, and a run passes such a step instead of marking it untested (the triangle, and untested in the reports).
| `mask.MinLength` and `Masker.TooShort`; and `report.ReadBaseline`, | ||
| `Report.Selection` and `Report.Partial`. | ||
|
|
||
| ### Behaviour Changes |
There was a problem hiding this comment.
should-fix. This list covers the refactoring PRs and the main fixes #452–#472. It leaves out several user-visible changes that were also merged to main after v1.29.0 (2026-10-16) and so ship in this release. I checked that each PR's merge commit is not an ancestor of v1.29.0:
- Start a job as soon as the jobs it needs are done #412: a job starts as soon as the jobs it
needsare done, rather than in waves that wait for unrelated slower jobs. This changes timing and output order. Line 245 mentions only itsjobs ... cannot runerror. - Make Probe easier to use when things go wrong #433 (Merge the workflow files given as separate arguments #432):
probe a.yml b.ymlmerges the files, where it used to dropb.ymlsilently. A non-YAML file named directly is an error. Also new:--job. - Make Probe easier to use when things go wrong #433 (Report names an expression reads that are not there #437), Mask the secrets a URL holds, check the fields a step reads, and keep the docs checked #448 (Check the fields of res and req a step reads, and the keys its action needs #447) and Report type errors in expressions before a workflow runs #450:
probe checknow reports, as errors, names an expression reads that are not there,res/reqfields the action never returns, missing required keys, and expression type errors. A workflow that passedcheckin v1.29.0 can fail it now, which matters for CI. - Mask the secrets a URL holds, check the fields a step reads, and keep the docs checked #448 (Mask a short secret only where it is a whole value #443/Redact the credentials of a URL in any output, whatever their length #444): a secret shorter than 4 characters is masked only where it is a whole value, with a warning; before, it was masked everywhere. URL credentials are redacted whatever their length. This is security-relevant output behaviour.
- Start each run of a workflow afresh: no job failed, no outputs, every job and its own env #459: starting the same
*Workflowtwice gives a fresh run (failed flag, outputs,Config.Jobsselection). Line 133 covers only the env part.
Either add them, or say in one line that this list covers only part of the release and point to the release notes for the rest.
| This release breaks the Go API in a minor version, for code that imports | ||
| probe as a library: the packages only probe itself imported, the root | ||
| package, `actionrpc` on the side that runs an action, and the packages of | ||
| the built-in actions. Workflow files are not affected, except as told under |
There was a problem hiding this comment.
should-fix. "Workflow files are not affected, except as told under Behaviour Changes below" leaves out something that is told elsewhere: lines 143–145 say Load (and Start for a code-built workflow) now refuses a workflow whose expressions, templates, step IDs or written wait cannot run, before any job runs. That comes from #421, after v1.29.0. A workflow whose bad expression sits in a step that never ran, for example one skipped by skipif, ran in v1.29.0 and is now refused. That is a workflow-file change, so it belongs in Behaviour Changes as a bullet, or this sentence should point to it. The same goes for the stricter probe check (see the comment on line 230).
| `NeedsNoCheck`, `Contracts`, `WithFields`, `AllRequired`, `AllReqFields`, | ||
| `AllResFields`, `AllReqTypes` and `AllResTypes`; `embedded.WithNeedsNoCheck`; | ||
| `mask.MinLength` and `Masker.TooShort`; and `report.ReadBaseline`, | ||
| `Report.Selection` and `Report.Partial`. |
There was a problem hiding this comment.
nit. apidiff lists further exported additions this paragraph does not name: actionrpc.Contract, actionrpc.ContractMatch, actionrpc.Violation and the type actionrpc.Processes (only Call.Processes and Process are listed). Also report.Selection (the type; Report.Selection is listed), (*shell.Action).RunStep, and cmd/probe Cmd.Jobs/Cmd.Trace. They are harmless additions, but the paragraph reads as exhaustive.
| |---|---| | ||
| | `Serve()` of `db`, `dns`, `grpc`, `hello`, `http`, `imap`, `shell`, `smtp`, `ssh` | `actions.Lookup(name)` | | ||
| | `embedded.Serve()` | `embedded.ServeWithActions(names, opts...)`, as `actions.Lookup("embedded")` serves it | | ||
| | `Keeps()` and `Params()` of each package | `actions.Keeps()[name]`, `actions.AllParams()[name]`, or the fields of `<package>.Spec()` | |
There was a problem hiding this comment.
nit. "Keeps() and Params() of each package" overstates it. Per apidiff, Keeps existed only in db, dns, embedded, grpc, hello and http, and Params in every package except hello. Suggest "Keeps() and Params(), where a package had them".
…the hello note The hello note compared with an engine v1.29.0 never had: a hello step without a test came to pass after v1.29.0, and only with the probe command. Behaviour Changes now also tells the changes merged to main since v1.29.0 that a workflow may notice, the intro points at the refusals of Load, and the lists of what had Keeps and Params and of new symbols are exact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6CYBxNCxQyo1rbdg9hQ42
Takes the fix of TestProbe_load after main's #472. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6CYBxNCxQyo1rbdg9hQ42 * origin/refactor/structure: Expect the empty steps as problems of a load past a wrong name
Adds an `## Unreleased` section to CHANGELOG.md for the refactoring series, above v1.27.0, in the file's own style: what breaks for code that imports probe as a library, with a table of what to use instead for each, and a list of behaviour changes a workflow may notice, each with its PR.
The entries were checked against `apidiff` from v1.29.0 to this branch, so they describe the net change since the last release, including the main PRs since v1.29.0 that changed the Go API (#410–#422 and on), and leave out what was added and then renamed within the series. Two external actions outside this repository, probe-agent and probe-browser, import `mapping`; the section `If your action imports mapping` tells them the `actionrpc` functions to use instead.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X6CYBxNCxQyo1rbdg9hQ42