From 810aa4a5eb106fde63fff987284ebea53d4e4e73 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Thu, 14 May 2026 17:23:37 +0300 Subject: [PATCH] Enable auto-bug creation and add refresh command --- ...e-tooling-microshift-ci-doctor-commands.sh | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh b/ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh index ba67b2b4d90c3..db1abfc58fb32 100644 --- a/ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh +++ b/ci-operator/step-registry/openshift/edge-tooling/microshift-ci/doctor/openshift-edge-tooling-microshift-ci-doctor-commands.sh @@ -11,6 +11,7 @@ mkdir -p "${CLAUDE_HOME}" CLAUDE_ANALYSIS_LOG="${WORKDIR}/claude-analysis.log" CLAUDE_BUG_CREATION_LOG="${WORKDIR}/claude-bug-creation.log" +CLAUDE_REPORT_REFRESH_LOG="${WORKDIR}/claude-report-refresh.log" JIRA_MCP_LOG="${WORKDIR}/jira-mcp.log" # The procedure to copy reports and session logs to artifacts, executed at exit @@ -42,7 +43,7 @@ atexit_handler() { fi # Check if the Claude sessions were completed successfully - for log_file in "${CLAUDE_ANALYSIS_LOG}" "${CLAUDE_BUG_CREATION_LOG}"; do + for log_file in "${CLAUDE_ANALYSIS_LOG}" "${CLAUDE_BUG_CREATION_LOG}" "${CLAUDE_REPORT_REFRESH_LOG}"; do # If a session was terminated due to a timeout, report lack of # subsequent session log files as a warning and continue not # to mask the actual error @@ -232,10 +233,9 @@ cd "${SRC_DIR}" # Configure the GitHub token for MicroShift repo operations { set +x; export GITHUB_TOKEN="${GITHUB_TOKEN_USHIFT}"; set -x; } -# Run analysis on all releases and open rebase PRs. -# Time-box analysis and limit turns to avoid uncontrolled billable minutes. +# Run analysis on all releases and open rebase PRs (45m and 100 turns). echo "Running Claude to analyze MicroShift CI jobs and pull requests..." -timeout 3000 claude \ +timeout 2700 claude \ --model "${CLAUDE_MODEL}" \ --max-turns 100 \ --output-format stream-json \ @@ -244,18 +244,28 @@ timeout 3000 claude \ --verbose 2>&1 | tee "${CLAUDE_ANALYSIS_LOG}" echo "Analysis for MicroShift CI jobs and pull requests completed" -# Run bug creation for failed jobs (dry-run mode). -# Time-box bug creation and limit turns to avoid uncontrolled billable minutes. +# Run bug creation for failed jobs (10m and 50 turns). echo "Running Claude to create bugs for failed jobs..." timeout 600 claude \ --model "${CLAUDE_MODEL}" \ --max-turns 50 \ --output-format stream-json \ --plugin-dir "${PLUGIN_DIR}" \ - -p "/microshift-ci:create-bugs ${RELEASE_VERSIONS}" \ + -p "/microshift-ci:create-bugs ${RELEASE_VERSIONS} --create --auto" \ --verbose 2>&1 | tee "${CLAUDE_BUG_CREATION_LOG}" echo "Bug creation for failed jobs completed" +# Run HTML report refresh to include the new bugs (5m and 30 turns). +echo "Running Claude to refresh the HTML report..." +timeout 300 claude \ + --model "${CLAUDE_MODEL}" \ + --max-turns 30 \ + --output-format stream-json \ + --plugin-dir "${PLUGIN_DIR}" \ + -p "/microshift-ci:doctor-refresh ${RELEASE_VERSIONS}" \ + --verbose 2>&1 | tee "${CLAUDE_REPORT_REFRESH_LOG}" +echo "HTML report refresh completed" + # Close duplicate rebase PRs before attempting to restart failed test jobs. echo "Running automatic closing of duplicate rebase PRs..." "${PLUGIN_DIR}/scripts/prow-jobs-for-pull-requests.sh" \