chore(duo): install ruby in Duo agent sessions
What does this MR do and why?
gitlab-org/cli is joining the MR Risk Labeler pilot (gitlab-org/gitlab#638927). The flow will rate merge requests here against rules held in components/agents-and-flows/gitlab-merge-request, and for now it only labels.
A flow run in CI takes this project's .gitlab/duo/agent-config.yml: its image and its setup_script. The MR Risk Labeler's run_command steps run ruby, and debian:bookworm-slim ships no Ruby, so every run here would end at its first Ruby step and write nothing.
This MR adds ruby to the apt-get install line. Debian bookworm's package is Ruby 3.1, with the zlib, json and psych extensions the steps load, and the flow's scripts need 2.7 or later. It brings about a dozen packages; libruby3.1 alone is about 25 MB installed.
The other flows here get a Ruby they don't use. The image's locale stays as it is: the labeler's steps run as ruby -EUTF-8 (components/agents-and-flows/gitlab-merge-request!126 (merged)), so they read UTF-8 without one.
Before this merges
-
This file is read from the default branch only, so nothing on this MR, GitLab Duo's review included, has run this line. Run it in the image first:
docker run --rm debian:bookworm-slim bash -ec 'apt-get update && apt-get install -y --no-install-recommends curl git make ca-certificates ruby; ruby -rzlib -rjson -ryaml -e "p RUBY_VERSION"' -
A setup line that fails stops every Duo flow here, Code Review included. The
apt-getline already does that today; this MR adds one package to it.
Related
- The rules for this project, and its entry in the flow's consumers: components/agents-and-flows/gitlab-merge-request!124 (merged).
- gitlab-org/quality/triage-ops!4539 (merged), which starts the flow on every merge request here, waits for this to merge.
How to validate
After the catalog sync creates this project's consumer, mention @ai-mr-risk-labeler-gitlab-org on a merge request. The workload job's log should show the setup installing ruby, and the session getting past its first Ruby step, extract_iid.