chore(duo): install ruby in Duo agent sessions

What does this MR do and why?

release-platform-canary is joining the MR Risk Labeler pilot for its Renovate merge requests (gitlab-org/gitlab#638927). The flow will rate those bumps against rules held in components/agents-and-flows/gitlab-merge-request. For now it only labels, and nothing it says approves or merges anything.

A flow run in CI takes this project's .gitlab/duo/agent-config.yml: its image, its setup_script and its network policy. Every run_command step of the MR Risk Labeler runs ruby, and duo-workflow-sandbox ships git, node, mise and python but no Ruby. Without it, every run here would end at its first Ruby step and write nothing. This MR:

  • pins Ruby in .tool-versions (ruby 3.4.12, with the copier template's ruby-version annotation), so Renovate keeps it current like the project's other tools. .gitlab-ci-asdf-versions.yml is regenerated from it. mise install now installs Ruby in local development and in validate_mise_tool_versions too. Nothing sets MISE_RUBY_COMPILE there, so mise picks the build: with mise 2026.10 on an Apple Silicon Mac that is the precompiled one, in seconds, and where mise has no precompiled build it compiles Ruby from source.
  • installs mise's precompiled build of it in the setup script (MISE_RUBY_COMPILE=false), on a line of its own that only warns when it fails. The main mise install skips Ruby (MISE_DISABLE_TOOLS=ruby), so a Renovate bump to a version that jdx/ruby has not built yet costs only the MR Risk Labeler, and the project's other flows are unaffected. The build's source (jdx/ruby) and its attestation check are set as variables, which outrank the checkout's .mise.toml, so the merge request under review can't change where that Ruby comes from. It can change the version, as it can for the other pinned tools.
  • puts it on PATH on a line of its own, so a Ruby restored from the cache is still found when the install can't run. If both fail, the setup script warns and the session goes on.

The image's base already sets LANG and LC_ALL to C.UTF-8, so this sets no locale.

For the template and image owners

This file comes from the gl-infra copier template. The template's current version replaces this setup_script with eval "$(/usr/local/bin/duo-workflow-setup)", so the next template update will conflict with the lines this MR adds and with the MISE_DISABLE_TOOLS=ruby it puts on the template's install line. Their comment says to keep them.

Ruby in the duo-workflow-sandbox image would serve every project built from the template, and would let these lines go. This project needs it there before a verdict of the flow can approve anything here: the setup script runs outside the sandbox, with the session's tokens, on the project's checkout, and installs whatever that checkout's pins name, and the Ruby it installs lands in a cached directory a session can write to.

How to validate

  • Run locally on macOS under set -eo pipefail, the setup script's lines install Ruby 3.4.12 from jdx/ruby in seconds while the main install skips it, and that Ruby loads zlib and openssl, which the flow's steps need. With no network they still export a cached Ruby, and they only warn when .tool-versions names a version that has no precompiled build.
  • After the catalog sync creates this project's consumer, mention @ai-mr-risk-labeler-gitlab-org on a Renovate merge request. The workload job's log should show ruby@3.4.12 installed by the setup script, and the session should get past its first Ruby step, extract_iid.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading