Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 19, 2025

This PR expands the self-healing pipeline capability from dependabot-only PRs to any PR with codestyle issues, automatically detecting and fixing common formatting problems that cause pipeline failures.

Problem

When developers edit files directly in the GitHub UI (which doesn't run prettier on save or pre-commit hooks), the pipeline often fails due to codestyle violations. Previously, only dependabot PRs had self-healing capabilities, leaving manual PRs to fail and require manual intervention.

Solution

New Self-Healing Lint Workflow

Created 01-lint-self-healing.yml that replaces the basic lint workflow with intelligent auto-fixing:

  1. Detects lint failures on first attempt
  2. Attempts auto-fixes using --fix flags on supported linters:
    • xo --fix (JavaScript/TypeScript formatting via prettier)
    • stylelint --fix (CSS/SCSS formatting)
    • markdownlint --fix (Markdown formatting)
  3. Re-runs lint to verify fixes worked
  4. Auto-commits fixes for regular PRs using existing auto-commit infrastructure
  5. Fails gracefully on non-fixable structural issues

Smart Behavior Matrix

Context Lint Fails Auto-Fix Works Action
Regular PR 🚘 Auto-commit fixes
Regular PR ❌ Fail (manual fix needed)
Dependabot PR ℹ️ Skip commit (dedicated workflow handles)
Main branch ℹ️ Skip commit (manual intervention)

Integration

  • Updated default.yml to use the new self-healing lint workflow
  • Preserves existing dependabot self-healing workflow (no conflicts)
  • Maintains all existing pipeline functionality while adding auto-fix capability

Auto-Fixable vs Non-Fixable Issues

Auto-fixable (formatting issues):

  • Spacing, indentation, quotes, semicolons
  • CSS/SCSS formatting
  • Markdown formatting

Non-fixable (structural issues that correctly fail):

  • Code duplication (jscpd)
  • Unused variables, missing imports
  • Custom lint rule violations

Testing

Validated with comprehensive tests:

  • ✅ Auto-fixable formatting issues: Successfully fixed and would auto-commit
  • ✅ Non-fixable structural issues: Correctly failed after partial fixes
  • ✅ Mixed issues: Fixed what's possible, failed on the rest

This implementation solves the original problem of pipelines failing due to GitHub UI edits while maintaining code quality standards and appropriate failure modes for issues requiring human intervention.

Fixes #4562.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: node install.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Expand self-healing pipeline to any failed pipelines because of codestyles feat: expand self-healing pipeline to any failed pipelines due to codestyles Aug 19, 2025
@Copilot Copilot AI requested a review from mfranzke August 19, 2025 20:20
Copilot finished work on behalf of mfranzke August 19, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Expand self-healing pipeline to any failed pipelines because of codestyles

2 participants