Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,13 @@ load_secrets
configure_claude

# Use the edge-tooling source pre-installed in the image
SRC_DIR="${EDGE_TOOLING_DIR}"
# SRC_DIR="${EDGE_TOOLING_DIR}"
# PLUGIN_DIR="${SRC_DIR}/plugins/microshift-ci"
# cd "${SRC_DIR}"

SRC_DIR=/tmp/edge-tooling
PLUGIN_DIR="${SRC_DIR}/plugins/microshift-ci"
git clone https://github.com/ggiguash/edge-tooling.git -b ci-doctor-analyse-workflow "${SRC_DIR}"
Comment on lines +250 to +252

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify if openshift/edge-tooling repository exists and check typical branch names

# Check if official repo exists
echo "Checking if openshift/edge-tooling exists:"
gh api repos/openshift/edge-tooling --jq '.full_name' 2>/dev/null || echo "Repository not found or not accessible"

# Check if the personal fork exists and list branches
echo -e "\nChecking ggiguash/edge-tooling branches:"
gh api repos/ggiguash/edge-tooling/branches --jq '.[].name' 2>/dev/null | head -10 || echo "Repository not found or not accessible"

# Search for other step-registry scripts that reference edge-tooling
echo -e "\nOther scripts referencing EDGE_TOOLING_DIR or edge-tooling repos:"
rg -n --type=sh 'EDGE_TOOLING_DIR|edge-tooling\.git' ci-operator/step-registry/ | head -20

Repository: openshift/release

Length of output: 1330


🏁 Script executed:

# Read the full context of the script around lines 246-252
sed -n '240,260p' ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh

Repository: openshift/release

Length of output: 786


🏁 Script executed:

# Check how EDGE_TOOLING_DIR is defined in related scripts
grep -n "EDGE_TOOLING_DIR" ci-operator/step-registry/openshift/edge-tooling/*/openshift-edge-tooling-*-commands.sh

Repository: openshift/release

Length of output: 400


🏁 Script executed:

# Check the script header to understand the error handling setup
head -20 ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh

Repository: openshift/release

Length of output: 711


🏁 Script executed:

# Verify if EDGE_TOOLING_DIR is passed as an environment variable from step metadata
cat ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-ref.yaml

Repository: openshift/release

Length of output: 1743


Add cleanup before git clone to prevent failure if /tmp/edge-tooling exists from a prior run.

The script clones into /tmp/edge-tooling without checking if the directory already exists. If it does (from a previous execution or concurrent step runs), git clone will fail with "destination path already exists and is not an empty directory," causing the script to exit due to set -euo pipefail.

🔧 Proposed fix
 SRC_DIR=/tmp/edge-tooling
 PLUGIN_DIR="${SRC_DIR}/plugins/microshift-ci"
+rm -rf "${SRC_DIR}"
 git clone https://github.com/ggiguash/edge-tooling.git -b ci-doctor-analyse-workflow "${SRC_DIR}"
🤖 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
`@ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh`
around lines 250 - 252, The git clone command will fail if the SRC_DIR directory
already exists from a prior run. Add a cleanup command to remove the SRC_DIR
directory before attempting the git clone. Place a `rm -rf "${SRC_DIR}"`
statement immediately before the `git clone` line to ensure the destination path
does not exist when the clone operation begins, preventing the "destination path
already exists" error.

cd "${SRC_DIR}"

# Configure the GitHub token for MicroShift repo operations
Expand All @@ -263,7 +268,7 @@ echo "Automatic closing of duplicate rebase PRs completed"
# Run analysis on all releases and open rebase PRs (45m and 100 turns).
echo "Running Claude to analyze MicroShift CI jobs and pull requests..."
CLAUDE_RC=0
timeout 2700 claude \
timeout 2700 claude-latest \
--model "${CLAUDE_MODEL}" \
--max-turns 100 \
--output-format stream-json \
Expand Down