[PR #323] [CLOSED] Add auto-fix PR workflow for linting issues #327

Closed
opened 2026-02-16 02:17:14 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/323
Author: @adrianlyjak
Created: 2/3/2026
Status: Closed

Base: mainHead: claude/test-precommit-fix-sACsb


📝 Commits (2)

  • 8cb99e3 feat: add auto-fix PR manager action for lint failures
  • 0a064d7 test: add intentionally misformatted code to validate PR auto-fix action

📊 Changes

3 files changed (+303 additions, -1 deletions)

View changed files

.github/actions/pr-fix-comment/action.yml (+278 -0)
📝 .github/workflows/lint.yml (+17 -1)
📝 packages/llama-index-workflows/tests/test_utils.py (+8 -0)

📄 Description

Summary

This PR introduces an automated workflow to create fix PRs when linting checks fail, allowing developers to easily merge auto-fixed code changes back into their PRs.

Key Changes

  • New GitHub Action (.github/actions/pr-fix-comment/action.yml): Created a reusable composite action that:

    • Generates GitHub App tokens for authenticated API calls
    • Creates fix PRs with auto-fixed changes on a dedicated branch
    • Manages PR comments to notify developers of issues and fixes
    • Closes fix PRs when issues are resolved
    • Supports customizable titles, messages, and branch naming
  • Updated Lint Workflow (.github/workflows/lint.yml):

    • Upgraded checkout action from v3 to v4
    • Modified pre-commit step to continue on error and capture outcome
    • Integrated the new auto-fix action to create fix PRs when pre-commit fails
    • Added explicit failure step to maintain CI status
  • Test File Update (.packages/llama-index-workflows/tests/test_utils.py):

    • Added intentionally poorly formatted test function to validate the auto-fix workflow

Implementation Details

The action uses HTML comment markers (<!-- pr-fix-comment:{check-name} -->) to reliably identify and update existing comments across multiple workflow runs. It intelligently:

  • Creates a new fix PR if changes are needed
  • Updates existing comments with warning/success status
  • Closes fix PRs when the original issue is resolved
  • Provides customizable defaults for all text content while allowing full override

The workflow fails the CI check when fixes are needed, ensuring developers are aware and can merge the auto-generated fix PR.

https://claude.ai/code/session_01RzJkPDLpnak7MTNqSVDwa5


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/323 **Author:** [@adrianlyjak](https://github.com/adrianlyjak) **Created:** 2/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `claude/test-precommit-fix-sACsb` --- ### 📝 Commits (2) - [`8cb99e3`](https://github.com/run-llama/workflows-py/commit/8cb99e3af7546d98294a42c66cf100c7bda2056f) feat: add auto-fix PR manager action for lint failures - [`0a064d7`](https://github.com/run-llama/workflows-py/commit/0a064d7b2c5b1fe90f49ec291732aa0460cc3502) test: add intentionally misformatted code to validate PR auto-fix action ### 📊 Changes **3 files changed** (+303 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `.github/actions/pr-fix-comment/action.yml` (+278 -0) 📝 `.github/workflows/lint.yml` (+17 -1) 📝 `packages/llama-index-workflows/tests/test_utils.py` (+8 -0) </details> ### 📄 Description ## Summary This PR introduces an automated workflow to create fix PRs when linting checks fail, allowing developers to easily merge auto-fixed code changes back into their PRs. ## Key Changes - **New GitHub Action** (`.github/actions/pr-fix-comment/action.yml`): Created a reusable composite action that: - Generates GitHub App tokens for authenticated API calls - Creates fix PRs with auto-fixed changes on a dedicated branch - Manages PR comments to notify developers of issues and fixes - Closes fix PRs when issues are resolved - Supports customizable titles, messages, and branch naming - **Updated Lint Workflow** (`.github/workflows/lint.yml`): - Upgraded checkout action from v3 to v4 - Modified pre-commit step to continue on error and capture outcome - Integrated the new auto-fix action to create fix PRs when pre-commit fails - Added explicit failure step to maintain CI status - **Test File Update** (`.packages/llama-index-workflows/tests/test_utils.py`): - Added intentionally poorly formatted test function to validate the auto-fix workflow ## Implementation Details The action uses HTML comment markers (`<!-- pr-fix-comment:{check-name} -->`) to reliably identify and update existing comments across multiple workflow runs. It intelligently: - Creates a new fix PR if changes are needed - Updates existing comments with warning/success status - Closes fix PRs when the original issue is resolved - Provides customizable defaults for all text content while allowing full override The workflow fails the CI check when fixes are needed, ensuring developers are aware and can merge the auto-generated fix PR. https://claude.ai/code/session_01RzJkPDLpnak7MTNqSVDwa5 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:17:14 -05:00
yindo closed this issue 2026-02-16 02:17:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#327