Fix component index sort check crash on unrelated PRs#6331
Merged
swoboda1337 merged 2 commits intoesphome:nextfrom Mar 23, 2026
Merged
Fix component index sort check crash on unrelated PRs#6331swoboda1337 merged 2 commits intoesphome:nextfrom
swoboda1337 merged 2 commits intoesphome:nextfrom
Conversation
592ae2c to
6bc1ac4
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents the check-component-index CI workflow from crashing when GitHub rejects inline review comments that can’t be anchored to the PR diff, by falling back to posting a non-inline review.
Changes:
- Refactors the review body construction into a shared
reviewBodyarray. - Wraps
pulls.createReview(with inline comments) in atry/catch. - On inline-comment failure, posts a
REQUEST_CHANGESreview without inline comments and instructs running the fix command.
6bc1ac4 to
c72cd6f
Compare
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
c72cd6f to
ee0b0b0
Compare
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ee0b0b0 to
e466103
Compare
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
e466103 to
7393819
Compare
jesserockz
approved these changes
Mar 23, 2026
Member
Author
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The
check-component-indexCI workflow crashes withHttpError: Unprocessable Entity: "Line could not be resolved"when pre-existing sorting issues exist in lines outside the PR's diff. The GitHub API rejects inline review comments that cant be anchored to the diff.This adds a try/catch around the
createReviewcall. When inline suggestions fail (because the unsorted lines arent in the diff), it falls back to posting a review without inline comments, telling the author to run the fix command.Related issue (if applicable): N/A
Pull request in esphome with YAML changes (if applicable):
Checklist:
I am merging into
nextbecause this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
currentbecause this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/components/_index.mdwhen creating new documents for new components or cookbook.