Find a dispatched run when Forgejo reports an empty event (#321) #322

Merged
stephen merged 1 commit from fj-workflow-run-lookup into main 2026-11-12 05:56:25 +00:00
Owner

Closes #321.

fj workflow run dispatched fine, then polled for the new run for 30 seconds and failed with "could not find the triggered run". The lookup only accepted runs whose event is workflow_dispatch, but this Forgejo reports an empty event for dispatched runs. Push and pull request runs report their names, so only dispatches were affected, on any branch (the cl/* branch dispatches and the main ones alike). Workflows that take their own ref input (device-test-apks.yml with -f ref=...) ran on the default branch, which was the right branch to look on; they hit the same event mismatch.

The lookup now accepts an empty event or workflow_dispatch, still requires the workflow file and branch to match and the run to be new since before the dispatch, and still rejects runs that report another event (push, pull_request, schedule).

Tests: unit tests for the matcher, plus tests/workflow_dispatch_lookup.rs driving the real command against a mock server (empty event on a feature branch is found; workflow_dispatch is still found; a push run is not adopted). The first one fails on the old code with the exact error. The negative test waits out the 30 second lookup window.

Closes #321. `fj workflow run` dispatched fine, then polled for the new run for 30 seconds and failed with "could not find the triggered run". The lookup only accepted runs whose `event` is `workflow_dispatch`, but this Forgejo reports an empty `event` for dispatched runs. Push and pull request runs report their names, so only dispatches were affected, on any branch (the `cl/*` branch dispatches and the `main` ones alike). Workflows that take their own `ref` input (device-test-apks.yml with `-f ref=...`) ran on the default branch, which was the right branch to look on; they hit the same event mismatch. The lookup now accepts an empty event or `workflow_dispatch`, still requires the workflow file and branch to match and the run to be new since before the dispatch, and still rejects runs that report another event (push, pull_request, schedule). Tests: unit tests for the matcher, plus `tests/workflow_dispatch_lookup.rs` driving the real command against a mock server (empty event on a feature branch is found; `workflow_dispatch` is still found; a push run is not adopted). The first one fails on the old code with the exact error. The negative test waits out the 30 second lookup window.
Find a dispatched run when Forgejo reports an empty event (#321)
All checks were successful
ci / check (pull_request) Successful in 15m22s
ci / live-e2e (pull_request) Successful in 4m47s
ci / coverage (pull_request) Successful in 5m20s
6263da81ee
gerri approved these changes 2026-11-12 05:35:30 +00:00
gerri left a comment

Automated Codex review (read-only) of head 6263da81ee.

No concrete correctness, security, or test defects found against the supplied standards. Tests were inspected but not run in the read-only sandbox.

BLOCKING: 0

Reviewed head 6263da81ee at 2026-11-12T05:35:29Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head 6263da81ee8f6042873fadd3e5ade00940919d7a. No concrete correctness, security, or test defects found against the supplied standards. Tests were inspected but not run in the read-only sandbox. BLOCKING: 0 --- Reviewed head 6263da81ee8f6042873fadd3e5ade00940919d7a at 2026-11-12T05:35:29Z by codex exec (read-only sandbox).
Sign in to join this conversation.
No description provided.