From 3786d18504b295795909f59562a659be8a6404d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 23:34:21 +0000 Subject: [PATCH 1/2] fix: Docker test failures in CI Fix config test suite failures in Docker environment by: 1. Updated .dockerignore to keep .gitignore file - Tests check for .gitignore existence and content - Previously excluded, causing test failures 2. Made git-based test Docker-aware in test-configs.sh - Git test now checks if .git directory exists - Gracefully skips test in Docker (no .git directory) - Prevents "not a git repository" errors This ensures all tests pass in both local and Docker CI environments. Fixes GitHub Actions CI Docker test failures. --- .dockerignore | 3 +-- tests/test-configs.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.dockerignore b/.dockerignore index 343ec13..a7d6c6d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ -# Git +# Git (keep .gitignore for tests) .git/ -.gitignore .github/ # Documentation (not needed for tests) diff --git a/tests/test-configs.sh b/tests/test-configs.sh index 3ee6883..1d302bb 100755 --- a/tests/test-configs.sh +++ b/tests/test-configs.sh @@ -131,11 +131,16 @@ fi # Test: No backup files in repo (should be gitignored) test_start "no backup files tracked in git" -backup_files=$(git -C "$REPO_ROOT" ls-files | grep -E '\.(bak|backup|old|swp|tmp)$' || true) -if [[ -z "$backup_files" ]]; then - test_pass +if [[ -d "$REPO_ROOT/.git" ]]; then + backup_files=$(git -C "$REPO_ROOT" ls-files | grep -E '\.(bak|backup|old|swp|tmp)$' || true) + if [[ -z "$backup_files" ]]; then + test_pass + else + test_fail "Found backup files in git: $backup_files" + fi else - test_fail "Found backup files in git: $backup_files" + # Skip test if not a git repository (e.g., in Docker) + skip_test "Not a git repository" fi # Test: .gitignore exists and has content From 212b97aef3d0aa87bf39f5ea684505e8655d0269 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 00:33:02 +0000 Subject: [PATCH 2/2] fix: Exclude JSONC devcontainer files from validation DevContainer configuration files use JSONC (JSON with Comments) format, which is valid for VS Code but not compatible with strict JSON parsers like jq. Changes: 1. Updated .dockerignore to exclude .devcontainer/ directory - DevContainer files not needed in Docker test builds - Prevents JSONC validation errors 2. Updated GitHub Actions workflow to skip devcontainer files - Excludes .devcontainer/* from JSON validation - Also excludes tmux/plugins/* (third-party code) This allows: - DevContainer files to use comments (JSONC standard) - CI/CD validation to pass - Docker tests to run without JSONC conflicts The .devcontainer/devcontainer.json file legitimately uses: - // comments (JSONC feature) - Trailing commas (JSONC feature) These are intentional and valid for VS Code DevContainers. --- .dockerignore | 3 +++ .github/workflows/test.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index a7d6c6d..6b9a21e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,6 +2,9 @@ .git/ .github/ +# DevContainer (not needed for tests, uses JSONC format) +.devcontainer/ + # Documentation (not needed for tests) *.md !README.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2ae5af..36bf60b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,7 @@ jobs: - name: Validate JSON files run: | echo "Validating JSON files..." - find . -name "*.json" ! -path "./.git/*" ! -path "./node_modules/*" | while read -r file; do + find . -name "*.json" ! -path "./.git/*" ! -path "./node_modules/*" ! -path "*/.devcontainer/*" ! -path "*/tmux/plugins/*" | while read -r file; do echo "Checking $file" jq empty "$file" || exit 1 done