chore: enhance GitHub Actions comments for component index updates#10291
Conversation
Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks.
Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks.
Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughUpdates the GitHub Actions workflow to deduplicate and refresh bot PR comments using a marker-based approach. Adjusts pre-commit and Ruff configurations to exclude src/lfx/src/lfx/_assets/component_index.json from checks. No API or public entity changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer PR
participant GH as GitHub Actions (workflow)
participant API as GitHub API
Note over GH: Triggered on PR or component updates
GH->>GH: Construct commentBody with marker
GH->>API: List PR comments by github-actions[bot]
API-->>GH: Existing comments
alt Existing comments with marker
GH->>API: Delete matching prior comments
API-->>GH: Deleted
else No prior marker comment
Note over GH: No deletion
end
GH->>API: Post new comment with marker
API-->>GH: Comment created
Note over Dev: Sees only the latest bot notice
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (3 passed)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (40.13%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #10291 +/- ##
==========================================
+ Coverage 29.58% 29.65% +0.07%
==========================================
Files 1330 1315 -15
Lines 59444 59303 -141
Branches 8876 8847 -29
==========================================
+ Hits 17584 17586 +2
+ Misses 41042 40900 -142
+ Partials 818 817 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/update-component-index.yml (2)
137-166: Handle comment pagination so duplicates are actually removed
issues.listCommentsreturns only the first page (30 comments). On busy PRs the earlier bot comment with the marker can slip past that window, so we never delete it and the workflow keeps piling up duplicates—the very thing we’re trying to prevent. Please switch togithub.paginate()(or loop over pages / requestper_page: 100) before filtering so every prior bot comment with the marker is purged.- const { data: comments } = await github.rest.issues.listComments({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - }); + const comments = await github.paginate( + github.rest.issues.listComments, + { + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + per_page: 100, + }, + );
285-314: Same pagination gap hereThe auto-update comment path has the identical pagination blind spot—older comments beyond the first page survive. Please apply the same fix here so deduplication actually works on high-churn PRs.
- const { data: comments } = await github.rest.issues.listComments({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - }); + const comments = await github.paginate( + github.rest.issues.listComments, + { + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + per_page: 100, + }, + );
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/update-component-index.yml(2 hunks).pre-commit-config.yaml(1 hunks)pyproject.toml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T17:49:56.544Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-10-15T17:49:56.544Z
Learning: Applies to **/{test_*.py,*.test.ts} : Check that test files follow naming conventions: backend test_*.py, frontend *.test.ts
Applied to files:
.pre-commit-config.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Test Starter Templates
| script: | | ||
| github.rest.issues.createComment({ | ||
| const marker = '<!-- component-index-update-needed -->'; | ||
| const commentBody = `${marker}\n⚠️ **Component index needs to be updated**\n\nPlease run the following command locally and commit the changes:\n\n\`\`\`bash\nmake build_component_index\n\`\`\`\n\nOr alternatively:\n\n\`\`\`bash\nLFX_DEV=1 uv run python scripts/build_component_index.py\n\`\`\`\n\nThen commit and push the updated \`src/lfx/src/lfx/_assets/component_index.json\` file.`; |
There was a problem hiding this comment.
This seems correct but I guess we might need to merge and test the CI
|
@coderabbitai Please check what are the different trigger points of this CI change to build component index. Please do validate that the comment just made by the bot is not deleted by itself in next run or follow up run by mistake. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 14174 @edwinjosechittilappilly, I've analyzed the workflow file. Here's what I found: Trigger PointsThe CI workflow is triggered in two scenarios:
Comment Posting ScenariosThe workflow posts comments in two different scenarios: Scenario 1: Community Fork PRs
Scenario 2: Same Repository PRs
Validation of Comment Deletion Logic ✅The comment deletion logic is safe and will NOT delete the comment it just posted. Here's why:
The implementation is solid and follows best practices for deduplication! 🎯 |
|
…angflow-ai#10291) * chore: update pre-commit configuration to refine exclude patterns Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks. * chore: update ruff exclude patterns to include component_index.json Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks. * chore: enhance GitHub Actions comments for component index updates Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary. --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
…angflow-ai#10291) * chore: update pre-commit configuration to refine exclude patterns Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks. * chore: update ruff exclude patterns to include component_index.json Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks. * chore: enhance GitHub Actions comments for component index updates Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary. --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
…angflow-ai#10291) * chore: update pre-commit configuration to refine exclude patterns Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks. * chore: update ruff exclude patterns to include component_index.json Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks. * chore: enhance GitHub Actions comments for component index updates Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary. --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
…angflow-ai#10291) * chore: update pre-commit configuration to refine exclude patterns Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks. * chore: update ruff exclude patterns to include component_index.json Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks. * chore: enhance GitHub Actions comments for component index updates Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary. --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
…angflow-ai#10291) * chore: update pre-commit configuration to refine exclude patterns Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks. * chore: update ruff exclude patterns to include component_index.json Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks. * chore: enhance GitHub Actions comments for component index updates Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary. --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
…angflow-ai#10291) * chore: update pre-commit configuration to refine exclude patterns Modified the exclude pattern for the detect-secrets hook to prevent false positives by excluding the specific component_index.json file in addition to the docs directory. This change enhances the accuracy of secret detection during pre-commit checks. * chore: update ruff exclude patterns to include component_index.json Added the component_index.json file to the exclude patterns in the ruff configuration to prevent false positives during linting. This change enhances the accuracy of code quality checks. * chore: enhance GitHub Actions comments for component index updates Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary. --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>



Updated the GitHub Actions workflow to improve the commenting mechanism for component index updates. Added logic to delete previous comments from the GitHub Actions bot to prevent duplicates and included a marker in the comment body for better tracking. This change ensures that users receive clear instructions on updating the component index when necessary.
Summary by CodeRabbit
Bug Fixes
Chores