From cd35dc04a67465193989d677b6159a4ef5d807f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 22:17:48 +0000 Subject: [PATCH 1/2] fix: Remove redis-cli command from GitHub Actions workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow was failing because redis-cli is not installed on GitHub Actions runners (Ubuntu host). The manual health check was redundant since service containers already have built-in health checks configured. Problem: - Line 88 in .github/workflows/test.yml tried to run redis-cli on host - redis-cli only exists inside the Redis container, not on the runner - This caused "command not found" errors in CI/CD pipeline Solution: - Removed manual redis-cli ping check from setup step - GitHub Actions automatically waits for service health checks - Redis service has --health-cmd "redis-cli ping" configured - No behavioral change - Redis is still verified before tests Other redis-cli usage verified as correct: - docker-compose.test.yml: Health check runs inside container ✅ - Makefile: Uses docker-compose exec to run inside container ✅ Fixes CI/CD pipeline failures related to missing redis-cli command. --- .github/workflows/test.yml | 7 ++--- CHANGELOG.md | 55 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6260ba..5f3f866 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,11 +84,8 @@ jobs: sleep 2 done - # Wait for Redis to be ready - until redis-cli -h localhost -p 6379 ping; do - echo "Waiting for Redis to be ready..." - sleep 2 - done + # Redis service container has built-in health check, no need to manually wait + # The workflow will automatically wait for the health check to pass echo "Services are ready!" diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d15105..5fcc3e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,61 @@ ## [Unreleased] +### [2025-11-15 22:30] - Fix redis-cli Command Not Found in GitHub Actions +**Change**: TBD (to be added after commit) +**Status**: ✅ Success + +#### What I Did +- Fixed GitHub Actions workflow error where `redis-cli` command was not found +- Removed redundant manual Redis health check from workflow +- Relied on built-in service container health checks instead + +#### Problem Identified +**Location**: `.github/workflows/test.yml:88` + +The workflow attempted to run `redis-cli -h localhost -p 6379 ping` on the GitHub Actions runner (Ubuntu host), but `redis-cli` is not installed on the host machine. The command is only available inside the Redis container. + +**Root Cause**: The manual health check was redundant because GitHub Actions service containers already have built-in health checks configured (lines 36-42 in the workflow). The `redis` service container was configured with: +```yaml +options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 +``` + +This means GitHub Actions automatically waits for the Redis service to be healthy before proceeding with the workflow steps. + +#### Solution +- Removed the manual `redis-cli` check from the "Set up test environment" step +- Added explanatory comment noting that the service container has a built-in health check +- GitHub Actions will automatically wait for the health check to pass before running tests + +#### Other redis-cli Usage (verified as correct) +1. **docker-compose.test.yml:41** - Health check inside Redis container ✅ + - Uses `["CMD", "redis-cli", "ping"]` inside the `redis:7-alpine` container where the command exists +2. **Makefile:124** - Docker exec command ✅ + - Uses `docker-compose exec -T redis-test redis-cli ping` which executes inside the container + +#### Tests +- ✅ Workflow syntax is valid +- ✅ Service containers have proper health checks configured +- ✅ PostgreSQL health check remains functional (uses `pg_isready` on host which is available) + +#### Files Changed +- `.github/workflows/test.yml` - Removed redundant redis-cli check (lines 87-91) + +#### References +- GitHub Actions service container documentation +- Redis Docker image documentation (redis:7-alpine includes redis-cli) + +#### Impact +- Fixes CI/CD pipeline failures due to missing `redis-cli` on GitHub Actions runners +- Workflow now relies on proper service container health checks +- No behavioral change - Redis is still verified as ready before tests run + +--- + ### [2025-11-15 21:55] - Database Connection and CI/CD Implementation **Changes**: `62545a3`, `157670e`, `77da99b`, `f9aa12c`, `05a6a42` **Status**: ✅ Success From 09dfa818b06c32462a969ef1cf94d53ae7761723 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 22:18:12 +0000 Subject: [PATCH 2/2] docs: Update CHANGELOG with commit hash for redis-cli fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcc3e8..ddc5432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [Unreleased] ### [2025-11-15 22:30] - Fix redis-cli Command Not Found in GitHub Actions -**Change**: TBD (to be added after commit) +**Change**: `cd35dc0` **Status**: ✅ Success #### What I Did