fj workflow run returns no handle on the triggered run: no run id, --json, or --watch #129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
fj workflow run(workflow_dispatch) fires the trigger and prints a one-lineconfirmation, but gives the caller no handle on the run it just started: no
run number, no
--json, and no--watchto block until it finishes. Afterdispatching, a script has no reliable way to find "the run my dispatch created"
to then
fj run watch/fj run viewit.Evidence
dispatchreturns only a success string (src/cli/workflow.rs:83):The underlying API call discards the response entirely; Forgejo answers the
dispatch with a
204and no body (src/api/workflow_run.rs:85-119), so thereis genuinely no run id handed back.
DispatchArgshas no--watch/--json(
src/cli/workflow.rs:44-56). The result: the most important automation verb(trigger a workflow) is a dead end for scripting.
Why it matters for CI/automation buyers
The point of
workflow_dispatchfrom a CLI is "trigger from outside and wait forthe result" (deploy gates, cross-repo orchestration, release pipelines):
Today that is impossible. Even the manual two-step fails, because there is no
returned id and (until run-list filtering lands, rasterstate/fj#128) no way to
narrow
fj run listto the run you just kicked. Sofj workflow runcan startwork but never confirm or gate on it, the exact thing CI needs.
Proposed shape
Since Forgejo's dispatch returns no id, resolve the run by recency (this is what
ghdoes for the analogous case):actions/runsfiltered to the sameworkflow+refand pick the newest run whose
created_atis at/after the dispatch time.--json: print that resolved run (number, status, url) so scripts get ahandle.
--watch [--exit-status]: hand the resolved run straight to the existingrun watchpath so "trigger + stream + gate" is one command.Naturally composes with run-list filtering (rasterstate/fj#128) and
run watch --exit-status(rasterstate/fj#125).Scope
Builds on endpoints fj already calls (
actions/runsfor resolution, the watchpath for streaming). The recency match is best-effort and should be documented
as such; a
--no-followdefault preserves today's fire-and-forget behavior.Converted to backlog item rasterstate/fj#139 (p2, size M).