Report the run a workflow dispatch created; hermetic subprocess tests on macOS #330
Loading…
Reference in a new issue
No description provided.
Delete branch "stephen/peter-swimm-dispatch-run-info"
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?
Two commits from Peter Swimm (Toilville LLC), applied unchanged with
git amso he stays the author.FJ_CONFIG_DIR, so they are hermetic on macOS (which ignoresXDG_CONFIG_HOME).fj workflow runsendsreturn_run_infoand, when Forgejo answers with the run's id, fetches that run (GET /actions/runs/{id}) instead of searching the run list. A 204 or a failed lookup still falls back to the search. Wiremock tests and a CHANGELOG entry are included.Touches only CHANGELOG.md, src/api/workflow_run.rs, src/cli/workflow_run.rs, src/client/integration_tests.rs, tests/support/account_override.rs and tests/workflow_dispatch_lookup.rs. No build, network or CI changes.
Checked at toolchain 1.95.0:
cargo clippy --all-targets -- -D warnings,cargo fmt --checkand the fullcargo testpass (1457 unit tests plus the integration tests).Review notes for the maintainer (not changed here, to keep Peter's commits as sent):
--watchpasses only the run number on, so on a busy repo the watch path can still lose a run that the direct lookup found. The resolved run id could be carried through.Automated Codex review (read-only) of head
f4a215a41e.Low
tests/workflow_dispatch_lookup.rs:137: Invariant: a regression test must verify the identity it claims to preserve. The dispatch response names ID 900, but the mocked GET returns a run with a different ID, and the test asserts only its run number. It therefore passes even if the command reports a different run from the one named by the server. Return a fixture with ID 900 and assert the output ID as well as the run number.Low
src/cli/workflow_run.rs:227: Invariant: preserve the dispatched run’s identity through lookup and watch. As noted in the PR body, a failed ID lookup falls back to a search that can select a concurrent dispatch, and--watchresolves the run again by number. These are deferred edge cases: retry the lookup by ID or report that the run could not be retrieved, and carry the ID into watch.BLOCKING: 0
Reviewed head
f4a215a41eat 2026-11-17T21:20:50Z by codex exec (read-only sandbox).Automated Codex review (read-only) of head
1ecb99b44a.Low: tests/workflow_dispatch_lookup.rs. Invariant: A test of run identity must verify that the run returned is the one named by the dispatch. The mock dispatch names ID 900, but the GET returns ID 41, and the test checks only the run number. It therefore passes even though the command reports a different ID. Return ID 900 with a distinct run number and assert both fields. This is the test gap already identified in the PR notes.
Low: src/cli/workflow_run.rs. Invariant: Preserve the dispatched run’s identity through lookup and watch. As noted in the PR body, a failed direct GET falls back to a search that can select a concurrent dispatch, and
--watchresolves the run again by number. These are edge cases; retrying the GET by ID and carrying that ID through watch would preserve identity.BLOCKING: 0
Reviewed head
1ecb99b44aat 2026-11-17T22:32:49Z by codex exec (read-only sandbox).