Skip to content

Comments

[DO NOT MERGE] feat: Add Self-Healing CI Infrastructure#432

Open
vibhutikumar07 wants to merge 14 commits intodevelopfrom
feature/self-healing-ci
Open

[DO NOT MERGE] feat: Add Self-Healing CI Infrastructure#432
vibhutikumar07 wants to merge 14 commits intodevelopfrom
feature/self-healing-ci

Conversation

@vibhutikumar07
Copy link
Collaborator

Self-Healing CI Infrastructure

This PR adds an automated self-healing system for GitHub Actions workflows that detects failures, diagnoses root causes, and takes corrective actions.


Files Added

File Description
.github/workflows/self-healing.yml Main workflow triggered on workflow failures
.github/self-healing-config.yml Configuration for failure patterns and modes
.github/scripts/analyze-failure.js Failure analysis and classification engine
.github/scripts/apply-fix.js Auto-fix engine for common issues
.github/SELF-HEALING-README.md Documentation and usage guide

Features

  • Automatic Failure Detection: Triggers on any workflow failure via workflow_run event
  • Smart Classification: Categorizes failures into types (code, workflow, infrastructure, quality)
  • Auto-Fix Capability: Fixes common issues automatically (depre --base devel p --title feat:

- Add self-healing workflow that monitors all workflow failures
- Add failure analysis script to classify and diagnose issues
- Add auto-fix script for common workflow problems
- Add test workflow for manual testing before merge
- Add configuration file to control behavior

Supports:
- Automatic retry for infrastructure failures
- Issue creation with diagnosis for code/quality failures
- PR creation for workflow fixes (in auto-fix mode)
- PR comments with failure analysis
- Remove deprecated ::set-output command from analyze-failure.js
- Use GITHUB_OUTPUT environment file only (modern approach)
- Update test simulations to avoid ##[error] annotations in output
- Tests now display cleanly without false error/warning annotations
- Creates real GitHub issues to demonstrate self-healing capability
- Tests quality_gate scenario by default on push
- Simulates log analysis and generates diagnosis
- Proves the full self-healing cycle works before merge
- Remove inline comments from choice options
- Use heredoc with body-file for multiline issue body
Two scenarios:
1. Auto-Fix: Creates broken workflow with deprecated actions,
   detects issues, applies fixes, creates PR
2. Manual Intervention: Simulates quality gate failure,
   generates diagnosis & recommendations, creates issue

This demonstrates the full self-healing cycle.
Git diff doesn't work on newly created (untracked) files.
Fixed by checking if v4 actions are present in the file after fix.
PR creation requires workflows permission which isn't available
from feature branch. Creating issue to document the fix instead.
Changed from creating issues to creating actual PRs:
- Uses config file instead of workflow file (avoids workflows permission issue)
- Creates broken config → applies fix → creates PR with changes
- Demonstrates full self-healing PR creation flow
Changed auto-fix scenario to create issues instead of PRs
to avoid repository permission restrictions
Removing E2E and unit test workflows used for validation.
Only keeping production self-healing infrastructure.
@vibhutikumar07 vibhutikumar07 changed the title feat: Add Self-Healing CI Infrastructure [DO NOT MERGE] feat: Add Self-Healing CI Infrastructure Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant