Skip to content

chore: move update component index job to autofix workflow#10342

Merged
ogabrielluiz merged 3 commits into
mainfrom
fix-update-workflow-index
Oct 20, 2025
Merged

chore: move update component index job to autofix workflow#10342
ogabrielluiz merged 3 commits into
mainfrom
fix-update-workflow-index

Conversation

@ogabrielluiz
Copy link
Copy Markdown
Contributor

@ogabrielluiz ogabrielluiz commented Oct 20, 2025

The workflow was (is) causing CI to stop because of the bot commit. Autofix commits with a PAT which can trigger workflows and allows the PR to continue the process normally.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 20, 2025

Walkthrough

The changes consolidate component index automation by removing a dedicated GitHub Actions workflow and integrating its build functionality into the py_autofix workflow. The changes filter configuration is updated to track the component index file across multiple categories.

Changes

Cohort / File(s) Summary
Workflow consolidation
.github/workflows/py_autofix.yml
Added new "Update Component Index" job that checks out repo, sets up Python via astral-sh/setup-uv, installs dependencies, and runs make build_component_index with LFX_DEV=1 environment variable. Also added file path filters (src/lfx/src/lfx/components/**, scripts/build_component_index.py) to PR trigger conditions.
Workflow removal
.github/workflows/update-component-index.yml
Entire dedicated workflow removed. Previously handled component index detection, build, validation, commit/push with retry logic, and automated PR commenting with detailed change summaries comparing versions, components, categories, and SHA256 values.
Configuration updates
.github/changes-filter.yaml
Added path src/lfx/src/lfx/_assets/component_index.json to multiple change-filter categories (python, components-changes, frontend, docker, and component/workspace test-related groups) for tracking across diff categories.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes involve straightforward configuration updates and workflow consolidation, but verification is needed to ensure all functionality from the removed workflow—particularly the automated PR commenting logic and error handling—is properly migrated or intentionally deprioritized.

Possibly related PRs

Suggested labels

size:L, lgtm

Suggested reviewers

  • edwinjosechittilappilly
  • jordanrfrazier

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Excessive Mock Usage Warning ❓ Inconclusive The pull request (PR #10342) focuses on updating GitHub Actions CI/CD workflows and configuration files. Specifically, it adds the Update Component Index job to the py_autofix.yml workflow, removes the standalone update-component-index.yml workflow, and updates the .github/changes-filter.yaml to include component index paths in relevant change-filter categories. The provided summary indicates that these are infrastructure and automation changes, and no test files or test code modifications are included in this PR. The check for excessive mock usage in test files cannot be applied because there are no test files modified in this pull request.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Test Coverage For New Implementations ✅ Passed This PR is exclusively an infrastructure and GitHub Actions workflow reorganization that does not introduce any new source code, components, or functionality. The changes only affect workflow configuration files (.github/workflows/py_autofix.yml and .github/changes-filter.yaml), with no modifications to src/, scripts/, or any actual implementation code. The underlying functionality being orchestrated—the build_component_index script—already has comprehensive test coverage in existing test files (src/backend/tests/unit/test_build_component_index.py and src/lfx/tests/unit/test_component_index.py). Since no new implementations, features, or bug fixes are being added in this PR, the requirement to include corresponding tests for new code changes does not apply.
Test Quality And Coverage ✅ Passed This PR makes purely CI/CD workflow configuration changes with no new Python implementations. The diff shows 4 lines added to .github/changes-filter.yaml, 26 lines added to .github/workflows/py_autofix.yml (consolidating the component index update job), and 314 lines removed by deleting .github/workflows/update-component-index.yml. The underlying scripts/build_component_index.py script and its test suite (both from commit fd74f19) are unchanged. The existing tests comprehensively validate structure creation, JSON minification, SHA256 integrity, and error handling using proper pytest patterns with mocking.
Test File Naming And Structure ✅ Passed This PR modifies GitHub Actions workflow and configuration files (.github/changes-filter.yaml, .github/workflows/py_autofix.yml, and .github/workflows/update-component-index.yml) to reorganize component index build automation. The PR contains zero test files—no Python test files (test_.py), no TypeScript test files (.test.ts or *.test.tsx), and no test code of any kind. Since the custom check is specifically designed to verify test file naming patterns, structure, descriptive names, and coverage for both positive and negative scenarios, and there are no test files present in this PR, the check criteria cannot be violated.
Title Check ✅ Passed The PR title "chore: move update component index job to autofix workflow" accurately captures the primary structural change in this changeset. The title correctly reflects that the update component index job functionality, previously contained in a dedicated update-component-index.yml workflow (which is being removed), is now being integrated into the py_autofix.yml workflow. The title is concise, specific, and clearly communicates the main intent to someone reviewing the git history. The supporting changes to the changes-filter.yaml and trigger paths are secondary configuration adjustments that support this consolidation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-update-workflow-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ogabrielluiz ogabrielluiz changed the title chore: add update component index job to autofix workflow chore: move update component index job to autofix workflow Oct 20, 2025
@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

@coderabbitai I belive there was an earlier PR to remove multiple instance of the run github action especially when the component index was updated every commit to the PR. Similarly canwe have autofix messages that summarises the changes and also mentione dthat compenent index was updated. This to delets the previous message inorder to make the PR structred. What is your suggestion?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 20, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Read the new autofix workflow to see the Update Component Index job
echo "=== New py_autofix.yml workflow ==="
cat .github/workflows/py_autofix.yml

echo -e "\n\n=== Checking if old update-component-index.yml exists (should be deleted) ==="
if [ -f .github/workflows/update-component-index.yml ]; then
  echo "File still exists, showing content:"
  cat .github/workflows/update-component-index.yml
else
  echo "File has been deleted in this PR"
fi

echo -e "\n\n=== Check git diff to see what was removed ==="
git diff main HEAD -- .github/workflows/update-component-index.yml | head -200

Length of output: 11049


🏁 Script executed:

#!/bin/bash

# Get more of the diff to see the full commenting logic
echo "=== Getting full diff of removed update-component-index.yml ==="
git diff main HEAD -- .github/workflows/update-component-index.yml | tail -200

echo -e "\n\n=== Looking for autofix-ci/action documentation or examples in the repo ==="
rg -n "autofix-ci/action" -A 5 -B 5

echo -e "\n\n=== Check if there are any related issues or PRs about multiple workflow runs ==="
gh pr list --search "component index OR autofix" --limit 10 --json number,title,url,state

Length of output: 11095


🌐 Web query:

autofix-ci action GitHub documentation features

💡 Result:

Brief summary of the autofix.ci GitHub Action (features + key docs):

  • Purpose: automatically apply fixes produced by your existing linters/formatters in GitHub Actions and update the PR with those fixes. [1]
  • How it works: run your fixers in a workflow, call the autofix-ci/action step — the action creates an autofix.json artifact with the repo diff and notifies the autofix.ci server which pushes a commit to the PR branch using the autofix.ci GitHub App. [1][2]
  • Key features:
    • Works with any code-fixing tools (linters, formatters, compilers, etc.). [1]
    • No extra config required — just call the action in your workflow. [1][2]
    • Supports updating pull requests from forks and branches (uses a GitHub App to permit secure self-updates). [1]
    • Compatible with branch protection (supports PR updates even when branch protection is enabled). [1]
    • Safety rules to avoid loops (e.g., won’t apply patches if the last N commits are authored by bots). [1]
    • Minimal permissions model; recommends pinning the action to a commit hash for supply-chain safety. [2]
    • You can customize commit message via action inputs (examples shown in docs/third-party guides). [3]
  • Platform scope: GitHub Actions only. [1]
  • Setup: install the autofix.ci GitHub App, add a workflow named e.g. "autofix.ci" that runs your fixers and then uses autofix-ci/action. Example manifests and language-specific examples are provided. [2][1]

Sources:
[1] autofix.ci — homepage / features & FAQ.
[2] autofix.ci — setup docs / example workflows.
[3] Prettier docs — example using autofix.ci in GitHub Actions.


@edwinjosechittilappilly Thanks for the great question! You're absolutely right about the goal to avoid multiple workflow runs. Let me analyze the current approach and provide suggestions:

Current State Analysis

Old workflow (update-component-index.yml):

  • ✅ Deleted previous bot comments to avoid clutter
  • ✅ Posted detailed summaries (version changes, component/category counts, added/removed items, SHA256 hashes)
  • ⚠️ Used pull_request_target which could trigger multiple runs per PR commit
  • ⚠️ Complex logic with retry mechanisms and fork handling

New workflow (autofix approach):

  • Built-in loop prevention - autofix.ci won't apply patches if last N commits are by bots
  • ✅ Simpler implementation - no manual git push/rebase logic
  • ✅ Works with branch protection and forks via GitHub App
  • ❌ No custom PR comments with change summaries
  • ❌ Only creates commits, not PR comments

Recommendations

Option 1: Keep It Simple (Recommended for now)

Stick with the current autofix.ci approach:

  • Pros: No duplicate runs, clean implementation, autofix.ci handles all edge cases
  • Cons: Lose the detailed change summaries in comments
  • Commit message approach: The component index changes are documented in the commit message, reviewers can see details in the git diff

Option 2: Add Custom Comment Step

Add a commenting step after the autofix action runs:

- name: Build component index
  env:
    LFX_DEV: "1"
  run: make build_component_index

- name: Check and summarize changes
  id: check_changes
  run: |
    INDEX_FILE="src/lfx/src/lfx/_assets/component_index.json"
    if git diff --quiet --exit-code -- "$INDEX_FILE"; then
      echo "changed=false" >> $GITHUB_OUTPUT
    else
      echo "changed=true" >> $GITHUB_OUTPUT
      # Generate summary and store in output
      # (simplified - full logic from old workflow)
    fi

- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

- name: Comment on PR with changes
  if: steps.check_changes.outputs.changed == 'true'
  uses: actions/github-script@v7
  with:
    script: |
      const marker = '<!-- component-index-updated -->';
      // Delete previous comments
      const { data: comments } = await github.rest.issues.listComments({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
      });
      
      for (const comment of comments.filter(c => c.body?.includes(marker))) {
        await github.rest.issues.deleteComment({
          owner: context.repo.owner,
          repo: context.repo.repo,
          comment_id: comment.id,
        });
      }
      
      // Post new comment with summary
      await github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        body: `${marker}\n✅ Component index updated by autofix.ci\n\n**Changes:** [summary here]`
      });

Pros: Detailed summaries like before, single structured message per PR
Cons: Adds complexity, requires pull-requests: write permission

Option 3: Hybrid - Summary in Commit Message

Enhance the build script to output a summary, then use autofix.ci's custom commit message feature:

- name: Build component index and get summary
  env:
    LFX_DEV: "1"
  run: |
    make build_component_index
    # Script outputs summary to file
    echo "SUMMARY<<EOF" >> $GITHUB_ENV
    cat component_index_summary.txt >> $GITHUB_ENV
    echo "EOF" >> $GITHUB_ENV

- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
  with:
    commit-message: "chore: update component index\n\n${{ env.SUMMARY }}"

Pros: Details in commit, no extra commenting logic, keeps autofix.ci simple
Cons: Summary is in commits, not as a top-level PR comment

My Suggestion

I'd recommend Option 1 for now (keep it simple), because:

  1. The autofix.ci approach already solves the duplicate runs problem
  2. Change details are visible in the git diff and commit
  3. Less maintenance burden
  4. Can always add Option 2 later if detailed summaries are critical

If you want the detailed summaries, Option 2 gives you the closest behavior to the old workflow. Would you like me to provide a complete implementation for Option 2 with the full change detection logic?

@ogabrielluiz ogabrielluiz added this pull request to the merge queue Oct 20, 2025
Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Oct 20, 2025
Merged via the queue into main with commit ac6e2d2 Oct 20, 2025
26 of 27 checks passed
@ogabrielluiz ogabrielluiz deleted the fix-update-workflow-index branch October 20, 2025 21:24
mokeyish pushed a commit to mokeyish/langflow that referenced this pull request Oct 21, 2025
…ai#10342)

* chore: Update changes-filter.yaml to include component_index.json in various sections

* chore: remove update-component-index workflow file

* chore: add update component index job to autofix workflow
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
…ai#10342)

* chore: Update changes-filter.yaml to include component_index.json in various sections

* chore: remove update-component-index workflow file

* chore: add update component index job to autofix workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants