Skip to content

ci: split test matrix into privileged and non-privileged groups#272

Merged
skevetter merged 2 commits into
mainfrom
devsy-106-split-test-matrix
May 13, 2026
Merged

ci: split test matrix into privileged and non-privileged groups#272
skevetter merged 2 commits into
mainfrom
devsy-106-split-test-matrix

Conversation

@skevetter

@skevetter skevetter commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Splits the CI integration-tests matrix into two jobs: integration-tests-unprivileged (no sudo) and integration-tests (keeps sudo for Docker-dependent tests)
  • Non-privileged tests (context, ide, readconfiguration, extends, outdated, machine, machineprovider) now run as the runner user without root, reducing the sudo surface by ~25% of Linux test entries
  • Job name pattern (Test <label> on <runner>) is preserved for branch protection compatibility
  • Based on DEVSY-105 investigation that found ~60% of test labels have zero Docker dependency

Summary by CodeRabbit

  • Chores
    • Optimized internal test infrastructure configuration to streamline end-to-end test execution across different test categories.

Note: This release contains no user-facing changes or feature updates.

Review Change Stack

Move tests with zero Docker dependency (context, ide, readconfiguration,
extends, outdated, machine, machineprovider) into a new
integration-tests-unprivileged job that runs without sudo. This reduces
the sudo surface to only tests that actually require root for Docker
operations. The job name pattern is preserved so branch protection
status checks remain compatible.
@netlify

netlify Bot commented May 13, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 1660ec6
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a04c79d10c45400081f28ee

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

GitHub Actions CI workflow is reorganized to split integration test execution: a new integration-tests-unprivileged job handles tests for context, readconfiguration, extends, outdated, and machine labels, while those same labels are removed from the existing integration-tests job's matrix.

Changes

Integration Test Job Split

Layer / File(s) Summary
New unprivileged integration tests job
.github/workflows/pr-ci.yml
integration-tests-unprivileged job is added with a focused label matrix, artifact download from build-cli, executable staging in ./e2e/bin, and label-filtered test execution via go test.
Refactored integration tests matrix
.github/workflows/pr-ci.yml
The integration-tests job's matrix.include list removes readconfiguration, extends, and outdated label entries, consolidating those tests into the new unprivileged job.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

size/s

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: splitting CI integration tests into privileged and non-privileged groups across two separate jobs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

These tests require root access despite having no Docker dependency.
Both failed when running without sudo in CI. Move them back to the
privileged integration-tests job.
@coderabbitai coderabbitai Bot added the size/s label May 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/pr-ci.yml (2)

153-158: 💤 Low value

Consider adding macOS to darwin conversion for future extensibility.

The OS detection doesn't convert "macos" to "darwin" like the privileged job does (lines 399-401). While all current unprivileged runners use ubuntu-latest, adding this conversion would maintain consistency and prevent issues if macOS runners are added to this job's matrix in the future.

♻️ Proposed alignment with privileged job
       - name: get operating system lowercase
         id: os
         shell: bash
         run: |
           OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
+          if [ "$OS" == "macos" ]; then
+            OS="darwin"
+          fi
           echo "runner_os=$OS" >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-ci.yml around lines 153 - 158, The OS detection step
"get operating system lowercase" only lowercases runner.os into the OS variable
and writes runner_os, but it doesn't map "macos" to "darwin" like the privileged
job does; update the shell logic in that step to check if the lowercased value
equals "macos" and if so set OS="darwin" (otherwise keep the lowercased value)
before echoing "runner_os=$OS" to $GITHUB_OUTPUT so macOS runners are normalized
to darwin.

167-176: 💤 Low value

Consider adding Windows path handling for future extensibility.

The executable setup step doesn't handle Windows path conversions (forward slash conversion) like the privileged job does (lines 427-429). While all current unprivileged runners use ubuntu-latest, adding this handling would maintain consistency and prevent issues if Windows runners are added to this job's matrix in the future.

♻️ Proposed alignment with privileged job
       - name: setup executable
         shell: bash
         working-directory: ./e2e
         run: |
           TEMP_DIR="${{ runner.temp }}"
+          if [ "${{ runner.os }}" == "Windows" ]; then
+            TEMP_DIR="${TEMP_DIR//\\//}"
+          fi
+
           ls -R "$TEMP_DIR/devsy-bin/"
           mkdir -p ./bin/
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-ci.yml around lines 167 - 176, The step "setup
executable" currently uses TEMP_DIR and Unix find/cp commands without handling
Windows path formats; update this step to mirror the privileged job's Windows
handling by detecting runner.os == 'Windows' and converting TEMP_DIR to a
Windows-friendly path before using it (e.g., set a TEMP_DIR_WIN or
converted_temp_dir variable via cygpath or equivalent) and then use that
converted variable in the subsequent ls, find and cp commands so the find
"$TEMP_DIR/..." calls work on Windows runners as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-ci.yml:
- Around line 122-187: Add an explicit confirmation that the five unprivileged
test labels (context, readconfiguration, extends, outdated, machine) were run
and passed without sudo by updating the PR description or adding a follow-up PR
comment referencing the integration-tests-unprivileged job; state that you
executed the matrix job locally or on CI, list each label as "passed (no sudo)",
and if you used DEVSY-105 as the source of truth include a direct reference/link
to DEVSY-105 and briefly note the verification method (CI run ID or local
reproduction) so reviewers can trace the claim.

---

Nitpick comments:
In @.github/workflows/pr-ci.yml:
- Around line 153-158: The OS detection step "get operating system lowercase"
only lowercases runner.os into the OS variable and writes runner_os, but it
doesn't map "macos" to "darwin" like the privileged job does; update the shell
logic in that step to check if the lowercased value equals "macos" and if so set
OS="darwin" (otherwise keep the lowercased value) before echoing "runner_os=$OS"
to $GITHUB_OUTPUT so macOS runners are normalized to darwin.
- Around line 167-176: The step "setup executable" currently uses TEMP_DIR and
Unix find/cp commands without handling Windows path formats; update this step to
mirror the privileged job's Windows handling by detecting runner.os == 'Windows'
and converting TEMP_DIR to a Windows-friendly path before using it (e.g., set a
TEMP_DIR_WIN or converted_temp_dir variable via cygpath or equivalent) and then
use that converted variable in the subsequent ls, find and cp commands so the
find "$TEMP_DIR/..." calls work on Windows runners as well.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 394d029b-e2e5-4d5b-aa2d-c7da1c7706a5

📥 Commits

Reviewing files that changed from the base of the PR and between 01ef390 and 1660ec6.

📒 Files selected for processing (1)
  • .github/workflows/pr-ci.yml

Comment on lines +122 to +187
integration-tests-unprivileged:
name: Test ${{ matrix.label }} on ${{ matrix.runner }}
needs: [can-read-secret, build-cli]
needs: [build-cli]
strategy:
fail-fast: false
matrix:
include:
- label: context
runner: ubuntu-latest
free-disk-space: false
install-kind: false
requires-secret: false

- label: ide
- label: readconfiguration
runner: ubuntu-latest
free-disk-space: false
install-kind: false
requires-secret: false

- label: integration
- label: extends
runner: ubuntu-latest

- label: outdated
runner: ubuntu-latest

- label: machine
runner: ubuntu-latest

runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6

- name: setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: get operating system lowercase
id: os
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "runner_os=$OS" >> "$GITHUB_OUTPUT"

- name: download CLI artifacts
uses: actions/download-artifact@v8
with:
pattern: devsy-${{ steps.os.outputs.runner_os }}
path: ${{ runner.temp }}/devsy-bin/
merge-multiple: true

- name: setup executable
shell: bash
working-directory: ./e2e
run: |
TEMP_DIR="${{ runner.temp }}"
ls -R "$TEMP_DIR/devsy-bin/"
mkdir -p ./bin/
find "$TEMP_DIR/devsy-bin/" -type f -name "devsy-*" -exec cp {} ./bin \;
find ./bin -name "devsy-*" -exec chmod +x {} \;
ls -R ./bin/

- name: run test
shell: bash
working-directory: ./e2e
env:
GH_USERNAME: ${{ github.repository_owner }}
GH_ACCESS_TOKEN: ${{ github.token }}
GH_CREDENTIAL_USERNAME: x-access-token
run: |
go test -v -ginkgo.v -timeout 1500s --ginkgo.label-filter="${{ matrix.label }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check git log for evidence of test execution and results for moved labels

echo "=== Checking commit messages for test execution evidence ==="
git log --oneline --grep="test\|fail\|pass" -i --since="2 weeks ago" | head -20

echo -e "\n=== Checking for test result artifacts or CI logs mentioning these labels ==="
for label in context readconfiguration extends outdated machine; do
  echo "Searching for: $label"
  rg -i "test.*$label|$label.*test" --type=yaml --type=md -C 2 || echo "  No matches found"
done

echo -e "\n=== Checking PR description or comments for verification notes ==="
gh pr view 272 --json body,comments --jq '.body, .comments[].body' | rg -i "verify|test.*without.*sudo|unprivileged" -C 2 || echo "  No verification notes found"

Repository: devsy-org/devsy

Length of output: 1565


Request explicit confirmation that the five unprivileged tests pass without sudo.

The PR summary indicates these tests are based on DEVSY-105 investigation, which found ~60% of test labels have zero Docker dependency. The selective movement of ide and machineprovider back to the privileged job confirms that tests are being executed and failures are detected. However, there is no explicit documentation confirming that context, readconfiguration, extends, outdated, and machine have been verified to pass without sudo.

Please confirm in a comment that these five tests execute successfully in the unprivileged job, or link to DEVSY-105 for reference.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-ci.yml around lines 122 - 187, Add an explicit
confirmation that the five unprivileged test labels (context, readconfiguration,
extends, outdated, machine) were run and passed without sudo by updating the PR
description or adding a follow-up PR comment referencing the
integration-tests-unprivileged job; state that you executed the matrix job
locally or on CI, list each label as "passed (no sudo)", and if you used
DEVSY-105 as the source of truth include a direct reference/link to DEVSY-105
and briefly note the verification method (CI run ID or local reproduction) so
reviewers can trace the claim.

@skevetter
skevetter merged commit 16a4d5e into main May 13, 2026
56 checks passed
@skevetter
skevetter deleted the devsy-106-split-test-matrix branch May 13, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant