chore: move update component index job to autofix workflow#10342
Conversation
WalkthroughThe 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
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
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
@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? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 11049 🏁 Script executed: Length of output: 11095 🌐 Web query: 💡 Result: Brief summary of the autofix.ci GitHub Action (features + key docs):
Sources: @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 AnalysisOld workflow (
New workflow (autofix approach):
RecommendationsOption 1: Keep It Simple (Recommended for now)Stick with the current autofix.ci approach:
Option 2: Add Custom Comment StepAdd 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 Option 3: Hybrid - Summary in Commit MessageEnhance 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 My SuggestionI'd recommend Option 1 for now (keep it simple), because:
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? |
…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
…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
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.