Skip to content

Fix component index sort check crash on unrelated PRs#6331

Merged
swoboda1337 merged 2 commits intoesphome:nextfrom
swoboda1337:fix-ci-sort-fallback
Mar 23, 2026
Merged

Fix component index sort check crash on unrelated PRs#6331
swoboda1337 merged 2 commits intoesphome:nextfrom
swoboda1337:fix-ci-sort-fallback

Conversation

@swoboda1337
Copy link
Copy Markdown
Member

Description:

The check-component-index CI workflow crashes with HttpError: 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 createReview call. 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):

  • N/A

Checklist:

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because 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.md when creating new documents for new components or cookbook.

Copilot AI review requested due to automatic review settings March 23, 2026 20:36
@esphome esphome Bot added the next label Mar 23, 2026
@swoboda1337 swoboda1337 force-pushed the fix-ci-sort-fallback branch from 592ae2c to 6bc1ac4 Compare March 23, 2026 20:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 reviewBody array.
  • Wraps pulls.createReview (with inline comments) in a try/catch.
  • On inline-comment failure, posts a REQUEST_CHANGES review without inline comments and instructs running the fix command.
Comment thread .github/workflows/check-component-index.yml Outdated
Comment thread .github/workflows/check-component-index.yml Outdated
Comment thread .github/workflows/check-component-index.yml Outdated
@swoboda1337 swoboda1337 force-pushed the fix-ci-sort-fallback branch from 6bc1ac4 to c72cd6f Compare March 23, 2026 20:39
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 23, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 592ae2c
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/69c1a4612a7e5d00085eb3e4
😎 Deploy Preview https://deploy-preview-6331--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@swoboda1337 swoboda1337 force-pushed the fix-ci-sort-fallback branch from c72cd6f to ee0b0b0 Compare March 23, 2026 20:40
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 23, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit c72cd6f
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/69c1a51e6480eb00084491bb
😎 Deploy Preview https://deploy-preview-6331--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@swoboda1337 swoboda1337 force-pushed the fix-ci-sort-fallback branch from ee0b0b0 to e466103 Compare March 23, 2026 20:45
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 23, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit ee0b0b0
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/69c1a5587eb98e0007b893f7
😎 Deploy Preview https://deploy-preview-6331--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 23, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit f43f934
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/69c1a752ac829900081029f9
😎 Deploy Preview https://deploy-preview-6331--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@swoboda1337 swoboda1337 force-pushed the fix-ci-sort-fallback branch from e466103 to 7393819 Compare March 23, 2026 20:49
@swoboda1337 swoboda1337 merged commit db328a4 into esphome:next Mar 23, 2026
5 checks passed
@swoboda1337
Copy link
Copy Markdown
Member Author

Thanks

@swoboda1337 swoboda1337 added this to the 2026.3.2 milestone Mar 23, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

3 participants