Skip to content

mutation-cargo: relocating workflow-src breaks setup-rust's post-cleanup hook #365

Description

@leynos

Summary

The #343 fix (relocating workflow-src out of the caller's workspace before running mutation tests) introduced a regression: the local setup-rust composite action is invoked via a workspace-relative path (uses: ./workflow-src/.github/actions/setup-rust), and its automatic post-cleanup hook (provided by actions-rust-lang/setup-rust-toolchain, used for cache saving) re-resolves action.yml at that same path when it runs at job end. By then Relocate workflow source has already moved workflow-src away, so the post step fails to find the action definition and the job is marked as failed — even though mutation testing itself completed successfully.

Observed

leynos/repovec-appliance run 29686241020 (2026-07-19), job mutation / mutants:

  • Run mutation testing completed successfully and found a genuine survivor (crates/repovec-core/src/appliance/daemon_startup.rs:42:9, see companion issue in repovec-appliance).
  • Upload mutation report succeeded.
  • Post Setup Rust then failed with:
##[error]Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/repovec-appliance/repovec-appliance/workflow-src/.github/actions/setup-rust'. Did you forget to run actions/checkout before running your local action?

This turns the whole job (and workflow run) red, obscuring genuine mutation results behind a spurious infrastructure failure.

Root cause

.github/workflows/mutation-cargo.yml invokes Setup Rust with a workspace-relative uses: ./workflow-src/.github/actions/setup-rust path (line ~205-207), then runs Relocate workflow source afterwards (line ~250) to move workflow-src out of the workspace for the reasons described in #343. The Actions runtime re-resolves the composite action's location from that same relative path when running its post step at job cleanup time, so any local composite action with a post hook breaks once its source directory has moved.

Suggested fix

Either:

  • Pin/checkout setup-rust (and any other local composite actions with post hooks) into a location that is not relocated before the job ends, or
  • Defer Relocate workflow source until after all post-hook-bearing local actions have had their post steps run (not straightforward, since post steps run at job teardown), or
  • Stop using a workspace-relative uses: path for setup-rust in mutation workflows — check out shared-actions to a stable path outside the caller's tree from the start, so no relocation is needed for this particular composite action.

Impact

Any mutation-cargo run that exercises the Setup Rust composite step will report a false failure at job teardown, regardless of whether the mutation testing itself succeeded. This affects every caller repo using mutation-cargo.yml, not just repovec-appliance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghighHigh criticality issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions