Run the readiness score flow on Workhorse without a repository clone

What does this MR do and why?

The readiness score flow now runs on Workhorse without a repository clone, behind the readiness_score_on_workhorse flag. It only reads the work item and writes the score through GitLab API tools, so the CI job and the clone were pure overhead.

  • Opt in. readiness_score/v1 declares coding_environment: "none", so CreateAndStartWorkflowService starts it on Workhorse.
  • Feature flag. While readiness_score_on_workhorse (gitlab_com_derisk, off by default) is off for the session's user, the flow resolves to full and stays on CI. It's one more entry in CodingEnvironment::WORKHORSE_ROLLOUTS, with the session user as the actor like the other two flags.
  • No CI image. Workhorse needs no image, so custom Duo images without curl can't break the flow (#635674).
Why this is simpler than workplan
  • Single run: the flow config (readiness_score/1.0.0.yml) has no input gates, so there's no resume path to change.
  • Safe rollback: turning the flag off strands no sessions.
  • Tools: get_work_item, get_work_item_notes and update_work_item only.
Known limits, same as workplan on Workhorse
  • Group IP restrictions: /execute checks the Sidekiq egress IP, so IP-restricted groups can't run the flow on Workhorse until the IP passthrough fix lands.
  • Service account membership: !268477
  • Model selection: on Workhorse, the flow uses the chat model (#638605).
  • Runner precondition at creation: #629005

References

Screenshots or screen recordings

Not applicable. No UI changes.

How to set up and validate locally

Verified in GDK on gitlab-duo/test:

Check Result
Flag off readiness_score/v1 resolves to CI
Flag on, Generate readiness score Ran on Workhorse with no workload (created → running → finished) and wrote the score to the Workplan widget

To repeat it:

  1. Enable workplan_score for your user and readiness_score_on_workhorse.
  2. Generate a readiness score on a work item.
  3. In the Rails console, confirm the session has no workload: Ai::DuoWorkflows::Workflow.last.workloads.exists? is false.

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 Vanessa Otto

Merge request reports

Loading
Loading