feat: Suspend DAP workloads only when the session needs input

<🤖>

What does this MR do and why?

With dap_dynamic_suspension (wip, default off), a DAP workload on the suspendable fleet suspends on failure only and gets allow_failure: exit_codes: [75]. Rails passes DUO_SUSPEND_ON_INPUT_EXIT_CODE=75. A duo-cli that honours it exits 75 when the session stops for human input, so only those legs keep their environment. With the flag off, nothing changes.

  • Only enable the flag once a duo-cli release that exits 75 is pinned. Until then, sessions exit 0 and nothing suspends.
  • Not in this MR: the duo-cli change, and the discard workload for crashed legs.
  • A leg that stops for input now shows as an allowed failure, so duo_workflow_workload_completed reports script_failure for it.

References

Screenshots or screen recordings

Not applicable, no UI change.

How to set up and validate locally

  1. In the Rails console, enable suspendable_environment_for_dap, suspendable_workload_tag_for_dap and dap_dynamic_suspension for a project with DAP set up, and register a runner with the gitlab--duo--suspendable tag.
  2. Start a flow on the project, such as Developer from an issue.
  3. Open the workload job: its YAML has allow_failure: exit_codes: [75] and the variable DUO_SUSPEND_ON_INPUT_EXIT_CODE=75. Ci::Build.last.job_runtime_environment shows suspend_on_success: false, suspend_on_failure: true.
  4. Disable dap_dynamic_suspension and start another flow: both suspend flags are true and the job has no allow_failure.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

</🤖>

Edited by Andras Herczeg

Merge request reports

Loading
Loading