devantler-tech / devantler-tech/ksail

refactor(ci): replace the EKS smoke test's inline Ruby YAML edit with the repo's yq idiom

Open Beginner friendly
#6,313 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
165
Forks
12
Avg merge
5h 51m
Merged PRs (30d)
347

Description

> 🤖 Generated by the Daily AI Engineer (Claude Code instance)

## Evidence

`.github/workflows/system-test-eks.yaml` edits `eks.yaml` with an inline **Ruby** script:

```yaml
ruby -ryaml -e '
path = "eks.yaml"
data = YAML.load_file(path)
...
File.write(path, data.to_yaml)
'
```

On `main` today that is the workflow's line ~228, and it is the **only** Ruby invocation anywhere
under `.github/` in this repo — every other YAML mutation uses `yq`.

The portfolio scripting stack is **bash or Go**. Ruby is outside that set, and unlike the
embedded-interpreter carve-out (a host tool that admits only its own language, e.g. Blender's `bpy`),
nothing here requires Ruby — this is a plain "read YAML, set three numeric fields, write YAML"
operation that the repo already does natively elsewhere.

## The repo already has the bash-native idiom

`.github/actions/ksail-system-test/action.yaml` on `main` does the same class of edit with `yq -i`:

```yaml
yq -i ".spec.provider.hetzner.controlPlaneServerType = \"${NEW_SERVER_TYPE}\"" ksail.yaml
yq -i ".spec.provider.hetzner.workerServerType = \"${NEW_SERVER_TYPE}\"" ksail.yaml
```

So this is not "introduce a new tool" — it is "use the tool the repo already standardised on".
`yq` is preinstalled on GitHub-hosted Ubuntu runners, same as Ruby.

## Why it matters

1. **Off-stack.** It is the single exception to a portfolio-wide constitutional decision, which makes
it the precedent every future EKS-workflow change copies. That is not hypothetical — a second
Ruby block was added on top of it in the in-flight #6267 (flagged there in review).
2. **Silent-failure surface.** The Ruby block round-trips the whole document through
`YAML.load_file` / `to_yaml`, so it rewrites formatting, key order, comments and anchors across the
entire `eks.yaml` — not just the three fields it means to change. `yq -i` on an explicit path
changes only the addressed nodes. In a smoke test whose scaffolded `eks.yaml` carries explanatory
comments, silently stripping them makes the artifact less useful for debugging a failed run.

## Expected behaviour

The nodegroup-capacity edit is expressed in the repo's existing `yq` idiom, and no Ruby invocation
remains under `.github/`.

## Acceptance criteria

- [ ] The `ruby -ryaml -e` block(s) in `.github/workflows/system-test-eks.yaml` are replaced with
`yq -i` expressions addressing `managedNodeGroups[].desiredCapacity` / `.minSize` / `.maxSize`.
- [ ] `grep -rn 'ruby' .github/` returns nothing.
- [ ] The scaffolded `eks.yaml`'s comments survive the capacity edit (spot-checked in a smoke run's
logs or a local `yq` round-trip against a freshly scaffolded file).
- [ ] Behaviour is otherwise unchanged — the smoke test still scales up and back down.

**Rough size:** small. Two call sites, mechanical, no production code involved.

Discovered while resolving the `main` → #6267 merge conflict.

Contributor guide

Open the contributing guide

Research direction

Start in .github/workflows/system-test-eks.yaml around line 228 and compare the existing yq -i idiom in .github/actions/ksail-system-test/action.yaml. Replace both Ruby YAML-edit blocks with the specified capacity-node edits, then run grep -rn 'ruby' .github/ and verify the scaffolded eks.yaml comments survive while the smoke test still scales up and down.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, ruby
Domain
ci-cd
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.