Skip to content

ci: fix lint on push/schedule and bake orchestrator test runtime image#96

Merged
renecannao merged 1 commit intomasterfrom
ci-fix-lint-and-functional-startup
Apr 16, 2026
Merged

ci: fix lint on push/schedule and bake orchestrator test runtime image#96
renecannao merged 1 commit intomasterfrom
ci-fix-lint-and-functional-startup

Conversation

@renecannao
Copy link
Copy Markdown

@renecannao renecannao commented Apr 16, 2026

Summary

  • Lint job (main.yml): gated to pull_request / workflow_dispatch. With only-new-issues: true, golangci-lint needs a PR base to diff against; on push/schedule every pre-existing issue is flagged as new and the job fails. Every scheduled run since April 9 has been red for this reason.
  • Functional tests: orchestrator containers ran apt-get update && apt-get install curl sqlite3 > /dev/null 2>&1 inside the 120s readiness window with output silenced, causing flaky "Orchestrator not ready" timeouts across the matrix (mysql 9.2/9.5/9.6, postgresql 15/17, raft). Moved the apt step into a pre-baked orchestrator-runtime:latest image built once per job; the orchestrator/orchestrator-pg/orchestrator-raft1..3 services now just run the binary.

Locally, orchestrator readiness drops from a 120s timeout to ~1s and the smoke suite passes 26/26.

Test plan

  • CI workflow green on this PR (lint compares against master base and passes)
  • Functional Tests workflow green on this PR across the full matrix (mysql 5.7/8.0/8.4/9.0/9.2/9.5/9.6, postgresql 15/16/17, raft)
  • After merge, scheduled CI runs stop failing on the lint job

Summary by CodeRabbit

  • Chores
    • Optimized test infrastructure by introducing a pre-built Docker image for functional tests, reducing build time and dependencies.
    • Updated continuous integration workflow to run linting checks conditionally on pull requests and manual triggers, improving workflow efficiency.

Two unrelated CI breakages were piling up failures:

- main.yml's lint job uses golangci-lint with `only-new-issues: true`,
  which needs a PR base to diff against. On `push` and `schedule` there
  is no base, so every pre-existing issue is reported as "new" and the
  job fails. Gate the job to `pull_request` / `workflow_dispatch`.

- Functional tests were flaking with "Orchestrator not ready" because
  each orchestrator container ran `apt-get update && apt-get install
  curl sqlite3 > /dev/null 2>&1` at startup, inside the 120s readiness
  window, with output silenced. Move the install into a pre-baked
  `orchestrator-runtime` image (ubuntu:24.04 + curl + sqlite3 + ca-certs)
  built once per job, and drop the apt step from every orchestrator
  service's command. Locally, readiness drops from a 120s timeout to
  ~1s and smoke tests pass 26/26.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

The changes introduce a custom Docker runtime image (orchestrator-runtime:latest) that pre-installs test dependencies (curl, sqlite3, ca-certificates) based on ubuntu:24.04. The functional test workflow is updated to build this image before running tests, and the docker-compose configuration is modified to use this image instead of ubuntu directly, shifting dependency installation from runtime to build-time. The lint job is conditionally gated to execute only on pull requests or manual workflow triggers.

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/functional.yml, .github/workflows/main.yml
Added Docker build step for orchestrator-runtime image in functional test jobs; added conditional execution guard to lint job to run only on pull_request or workflow_dispatch events.
Docker Image and Compose Setup
tests/functional/orchestrator-runtime.Dockerfile, tests/functional/docker-compose.yml
Created new Dockerfile installing curl, sqlite3, and ca-certificates on ubuntu:24.04; updated all orchestrator services to use orchestrator-runtime:latest image and removed inline dependency installation from container startup commands.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through Docker layers,
Pre-baking deps to skip the prayers,
No more delays when tests commence,
Just lightning-fast resilience! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes both main changes: fixing lint on push/schedule and baking a Docker runtime image for orchestrator tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-fix-lint-and-functional-startup

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a custom Docker image, orchestrator-runtime, for functional testing, moving the installation of dependencies like curl and sqlite3 from the container startup command to a dedicated Dockerfile. This change streamlines the docker-compose.yml configuration for several orchestrator services. Feedback suggests adding a build section to the orchestrator service in the Compose file to automatically build the runtime image if it is missing locally, improving the developer experience.


orchestrator:
image: ubuntu:24.04
image: orchestrator-runtime:latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To improve the local development experience, consider adding a build section to the orchestrator service. This allows docker-compose up to automatically build the orchestrator-runtime image using the provided Dockerfile if it doesn't exist locally, rather than failing with an image not found error. Since other services in this file share the same image name, defining the build context once here is sufficient for a full stack startup.

    build:
      context: .
      dockerfile: orchestrator-runtime.Dockerfile
    image: orchestrator-runtime:latest

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/functional/orchestrator-runtime.Dockerfile (1)

1-5: Harden the runtime image by dropping root privileges.

This image currently runs as root. Adding a dedicated non-root user improves baseline container security with minimal cost.

🔧 Proposed hardening diff
 FROM ubuntu:24.04
 
 RUN apt-get update \
  && apt-get install -y --no-install-recommends curl sqlite3 ca-certificates \
  && rm -rf /var/lib/apt/lists/*
+
+RUN useradd --create-home --shell /usr/sbin/nologin orchestrator
+USER orchestrator
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/functional/orchestrator-runtime.Dockerfile` around lines 1 - 5, Add a
non-root user and switch to it in the Dockerfile: create a dedicated user/group
(e.g., "orchestrator") and home directory, chown any runtime-required
directories/files (for example those created or used by the apt installs or
later runtime artifacts), and add a USER instruction before the image final
layer so the container no longer runs as root; reference the existing FROM
ubuntu:24.04 and the RUN apt-get ... lines to locate where to insert the
user/group creation, chown, and USER orchestrator statements and ensure the new
user has a non-login shell and limited privileges.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/functional/orchestrator-runtime.Dockerfile`:
- Around line 1-5: Add a non-root user and switch to it in the Dockerfile:
create a dedicated user/group (e.g., "orchestrator") and home directory, chown
any runtime-required directories/files (for example those created or used by the
apt installs or later runtime artifacts), and add a USER instruction before the
image final layer so the container no longer runs as root; reference the
existing FROM ubuntu:24.04 and the RUN apt-get ... lines to locate where to
insert the user/group creation, chown, and USER orchestrator statements and
ensure the new user has a non-login shell and limited privileges.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22c86548-cfea-4b89-95c0-6c6605aea8e6

📥 Commits

Reviewing files that changed from the base of the PR and between 42c66d3 and d7824d5.

📒 Files selected for processing (4)
  • .github/workflows/functional.yml
  • .github/workflows/main.yml
  • tests/functional/docker-compose.yml
  • tests/functional/orchestrator-runtime.Dockerfile

@renecannao renecannao merged commit a2c1dfd into master Apr 16, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant