From c2eb85b2644c5d330818c9efd89e85c20be7d55a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:48:40 +0000 Subject: [PATCH 1/2] Initial plan From 194d1e2565bf51c1153a891979feb619243859d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:00:28 +0000 Subject: [PATCH 2/2] fix: Configure hourly CI cleaner with proper build steps - Remove docs/troubleshooting/ci-cleaner-architecture.md as requested - Fix hourly-ci-cleaner.md workflow by aligning with ci.yml build job pattern: - Remove manual 'make install' step (make is already available) - Pin GitHub Actions to specific SHAs per security best practices - Replace 'make deps-dev' with 'make build' to build the binary - Reorder Node.js setup before Go setup to match ci.yml pattern - Workflow now properly sets up the build environment before agent execution Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/hourly-ci-cleaner.lock.yml | 10 ++-- .github/workflows/hourly-ci-cleaner.md | 20 ++++---- .../ci-cleaner-architecture.md | 46 ------------------- 3 files changed, 11 insertions(+), 65 deletions(-) delete mode 100644 docs/troubleshooting/ci-cleaner-architecture.md diff --git a/.github/workflows/hourly-ci-cleaner.lock.yml b/.github/workflows/hourly-ci-cleaner.lock.yml index d8a68f4f63..da6e4bf609 100644 --- a/.github/workflows/hourly-ci-cleaner.lock.yml +++ b/.github/workflows/hourly-ci-cleaner.lock.yml @@ -175,11 +175,7 @@ jobs: id: ci_check name: Check last CI workflow run status on main branch run: "# Get the last CI workflow run on main branch, excluding pending and cancelled runs\nLAST_RUN=$(gh run list --workflow=ci.yml --branch=main --limit 50 --json conclusion,status,databaseId \\\n | jq -r '[.[] | select(.status == \"completed\" and (.conclusion == \"success\" or .conclusion == \"failure\"))] | .[0]')\n\nCONCLUSION=$(echo \"$LAST_RUN\" | jq -r '.conclusion')\nRUN_ID=$(echo \"$LAST_RUN\" | jq -r '.databaseId')\n\necho \"Last CI run conclusion: ${CONCLUSION}\"\necho \"Run ID: ${RUN_ID}\"\n\n# Write to environment and step summary\necho \"CI_STATUS=${CONCLUSION}\" >> \"$GITHUB_ENV\"\necho \"CI_RUN_ID=${RUN_ID}\" >> \"$GITHUB_ENV\"\n\nif [ \"$CONCLUSION\" = \"success\" ]; then\n echo \"✅ CI is passing on main branch - no action needed\" >> \"$GITHUB_STEP_SUMMARY\"\n echo \"CI_NEEDS_FIX=false\" >> \"$GITHUB_ENV\"\n exit 1\nelse\n echo \"❌ CI is failing on main branch - agent will attempt to fix\" >> \"$GITHUB_STEP_SUMMARY\"\n echo \"Run ID: ${RUN_ID}\" >> \"$GITHUB_STEP_SUMMARY\"\n echo \"CI_NEEDS_FIX=true\" >> \"$GITHUB_ENV\"\nfi\n" - - name: Install Make - run: | - sudo apt-get update - sudo apt-get install -y make - - name: Setup Go + - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c with: cache: true @@ -187,8 +183,8 @@ jobs: - name: Install npm dependencies run: npm ci working-directory: ./pkg/workflow/js - - name: Install dev dependencies - run: make deps-dev + - name: Build code + run: make build - name: Configure Git credentials env: diff --git a/.github/workflows/hourly-ci-cleaner.md b/.github/workflows/hourly-ci-cleaner.md index 474536549a..0ffa4bd3b7 100644 --- a/.github/workflows/hourly-ci-cleaner.md +++ b/.github/workflows/hourly-ci-cleaner.md @@ -43,26 +43,22 @@ steps: echo "Run ID: ${RUN_ID}" >> "$GITHUB_STEP_SUMMARY" echo "CI_NEEDS_FIX=true" >> "$GITHUB_ENV" fi - - name: Install Make - run: | - sudo apt-get update - sudo apt-get install -y make - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - cache: true - name: Set up Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6 with: node-version: "24" cache: npm cache-dependency-path: pkg/workflow/js/package-lock.json + - name: Set up Go + uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6 + with: + go-version-file: go.mod + cache: true - name: Install npm dependencies run: npm ci working-directory: ./pkg/workflow/js - - name: Install dev dependencies - run: make deps-dev + - name: Build code + run: make build safe-outputs: create-pull-request: title-prefix: "[ca] " diff --git a/docs/troubleshooting/ci-cleaner-architecture.md b/docs/troubleshooting/ci-cleaner-architecture.md deleted file mode 100644 index 6188f086d4..0000000000 --- a/docs/troubleshooting/ci-cleaner-architecture.md +++ /dev/null @@ -1,46 +0,0 @@ -# CI Cleaner Architecture Issue - -## Problem - -The hourly CI cleaner workflow cannot execute because the agentic execution environment lacks required build tools (make, go, node). - -## Root Cause - -The `hourly-ci-cleaner.md` workflow has a hybrid architecture where: - -1. Standard GitHub Actions steps install build tools -2. Agentic workflow assumes tools are pre-installed -3. Agent runs in separate container without access to installed tools - -## Environment Analysis - -**Available in agentic environment:** -- ✅ `gh` CLI (v2.83.2) -- ✅ `git` -- ✅ `curl` -- ❌ `make` - Not found -- ❌ `go` - Not found -- ❌ `node` - Not found -- ❌ `npm` - Not found - -## Recommended Solutions - -### Option 1: Inline Build Commands -Replace `make` commands with direct tool invocations in bash scripts. - -### Option 2: Pre-build Binary -Build `gh-aw` binary in setup steps and make it available to agent. - -### Option 3: Custom Container -Use a container image with pre-installed build tools for the agentic step. - -### Option 4: Redesign Workflow -Split into separate workflows - one for detection, one for fixing (running on standard runner). - -## Impact - -The hourly CI cleanup workflow is currently non-functional in its current design. - -## Date Identified - -2025-12-22