fj run cancel: fallback web URL uses the internal run id, so the link 404s #200

Open
opened 2026-06-30 19:11:18 +00:00 by stephen · 0 comments
Owner

What happens

fj run cancel correctly reports that Forgejo can't cancel a run via an API token and falls back to giving a web URL to do it in the browser. But that fallback URL is built from the internal Actions run id, not the per-repo run number the web UI uses, so the link 404s.

$ fj run cancel 14191 --repo rasterstate/fjord-ios
error: this Forgejo won't cancel run #14191 via an API token: Forgejo has no
rerun/cancel API, and its web action needs a browser session. Do it here:
  https://rasterhub.com/rasterstate/fjord-ios/actions/runs/14191

.../actions/runs/14191 returns 404. The working URL for the same run is:

https://rasterhub.com/rasterstate/fjord-ios/actions/runs/1351

Root cause (hypothesis)

A run has two identifiers:

  • the internal run id (14191 here), which fj api repos/{owner}/{repo}/actions/tasks returns in the id field, and
  • the per-repo run number / index (1351 here), which the web UI and the /actions/runs/<n> route use.

The cancel fallback echoes the id it was handed straight into the web URL, but the web route expects the per-repo run number. So the one actionable thing the error offers (a click-through to cancel in the browser) is a dead link, and the user has to go hunt for the real run number.

Suggestions

  1. When building the "Do it here" URL, resolve the run to its per-repo index/number rather than using the internal id.
  2. More broadly, the identifier is inconsistent across the CLI: fj api ... /actions/tasks surfaces the internal id, while fj run / the web route key off the per-repo number. Accepting and displaying the per-repo run number everywhere in fj run (what the web UI shows) would keep ids copied between commands and URLs from silently breaking.

Environment

  • fj 0.2.0
  • host: rasterhub.com
## What happens `fj run cancel` correctly reports that Forgejo can't cancel a run via an API token and falls back to giving a web URL to do it in the browser. But that fallback URL is built from the internal Actions run **id**, not the per-repo run **number** the web UI uses, so the link 404s. ``` $ fj run cancel 14191 --repo rasterstate/fjord-ios error: this Forgejo won't cancel run #14191 via an API token: Forgejo has no rerun/cancel API, and its web action needs a browser session. Do it here: https://rasterhub.com/rasterstate/fjord-ios/actions/runs/14191 ``` `.../actions/runs/14191` returns 404. The working URL for the same run is: ``` https://rasterhub.com/rasterstate/fjord-ios/actions/runs/1351 ``` ## Root cause (hypothesis) A run has two identifiers: - the internal run **id** (`14191` here), which `fj api repos/{owner}/{repo}/actions/tasks` returns in the `id` field, and - the per-repo run **number** / index (`1351` here), which the web UI and the `/actions/runs/<n>` route use. The cancel fallback echoes the id it was handed straight into the web URL, but the web route expects the per-repo run number. So the one actionable thing the error offers (a click-through to cancel in the browser) is a dead link, and the user has to go hunt for the real run number. ## Suggestions 1. When building the "Do it here" URL, resolve the run to its per-repo `index`/number rather than using the internal id. 2. More broadly, the identifier is inconsistent across the CLI: `fj api ... /actions/tasks` surfaces the internal `id`, while `fj run` / the web route key off the per-repo number. Accepting and displaying the per-repo run number everywhere in `fj run` (what the web UI shows) would keep ids copied between commands and URLs from silently breaking. ## Environment - fj 0.2.0 - host: rasterhub.com
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rasterstate/fj#200
No description provided.