Skip to content

Conversation

@wmoss
Copy link
Contributor

@wmoss wmoss commented Oct 27, 2025

Proposed change

Add a blog post about improved error handling for oauth2 configuration without internet

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

Summary by CodeRabbit

  • Documentation
    • Added a blog post describing improved OAuth2 configuration error handling when internet access is unavailable.
    • Clarified that configuration attempts will now surface retryable errors to allow automatic retries.
    • Included a migration example and noted that new integrations will include a scaffolded try/retry pattern for OAuth2 flows.

@wmoss
Copy link
Contributor Author

wmoss commented Oct 27, 2025

Once home-assistant/core#154579 merges and I'm able to put up the migration PRs, I can update this to add links to example migration PRs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2025

📝 Walkthrough

Walkthrough

A blog post documenting improved error handling for OAuth2 configuration entries: code should catch ImplementationUnavailableError from config_entry_oauth2_flow.async_get_config_entry_implementation and raise ConfigEntryNotReady to enable retries; includes migration example and scaffold updates for new integrations.

Changes

Cohort / File(s) Summary
Documentation
blog/2025-11-05-config-entry-oauth2-error-handling.md
Adds a blog post explaining the behavior change: catch ImplementationUnavailableError when obtaining OAuth2 config entry implementations and re-raise ConfigEntryNotReady to allow retrying; provides migration example and notes scaffolded try/except for new integrations.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant ConfigFlow as Config Flow
  participant ImplFetcher as async_get_config_entry_implementation
  participant Integration as Integration Init
  note over ImplFetcher: Attempt to fetch OAuth2 implementation
  ConfigFlow->>ImplFetcher: await async_get_config_entry_implementation(...)
  alt Implementation available
    ImplFetcher-->>ConfigFlow: Implementation
    ConfigFlow->>Integration: proceed with setup
    Integration-->>ConfigFlow: success
  else Implementation unavailable (no internet)
    ImplFetcher--xConfigFlow: throws ImplementationUnavailableError
    ConfigFlow->>ConfigFlow: catch ImplementationUnavailableError
    ConfigFlow-->>ConfigFlow: raise ConfigEntryNotReady("retryable message")
    note over ConfigFlow: Platform will schedule retry
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the accuracy of exception names and example code snippets in the blog post.
  • Confirm the migration example compiles and follows project error-handling conventions.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: adding a blog post about improved error handling for OAuth2 configuration without internet access.
Description check ✅ Passed The pull request description follows the template structure with all required sections completed, including proposed change, type of change selection, checklist verification, and relevant links to the related core PR.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 18a77dc and a5f0a4d.

📒 Files selected for processing (1)
  • blog/2025-11-05-config-entry-oauth2-error-handling.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • blog/2025-11-05-config-entry-oauth2-error-handling.md

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between fdacf2c and c045f47.

📒 Files selected for processing (1)
  • blog/2025-10-26-config-entry-aouth2-error-handling.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
*/**(html|markdown|md)

⚙️ CodeRabbit configuration file

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

  • Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • Use sentence-style capitalization also in headings.

do not comment on HTML used for icons

Avoid flagging inline HTML for embedding videos in future reviews for this repository.

Files:

  • blog/2025-10-26-config-entry-aouth2-error-handling.md
🪛 markdownlint-cli2 (0.18.1)
blog/2025-10-26-config-entry-aouth2-error-handling.md

22-22: Link text should be descriptive

(MD059, descriptive-link-text)


22-22: Link text should be descriptive

(MD059, descriptive-link-text)

⏰ 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). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant

@wmoss wmoss force-pushed the blog-2025-10-26-config-entry-aouth2-error-handling branch 2 times, most recently from 361a82f to 0f8d9ff Compare October 27, 2025 04:13
@wmoss
Copy link
Contributor Author

wmoss commented Oct 27, 2025

@coderabbitai generate docstrings

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
blog/2025-10-26-config-entry-oauth2-error-handling.md (1)

1-1: Filename appears to have been corrected.

The past review flagged a filename typo ("aouth2" → "oauth2"). The current file_start shows the corrected name. If this hasn't been committed yet, ensure the file is renamed to blog/2025-10-26-config-entry-oauth2-error-handling.md.

🧹 Nitpick comments (1)
blog/2025-10-26-config-entry-oauth2-error-handling.md (1)

11-11: Use more direct phrasing.

Per documentation guidelines, use a direct, authoritative tone. Change "Here is an example of the migration," to a more directive phrasing.

-Here is an example of the migration,
+To migrate the code, apply the following change:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c045f47 and 0f8d9ff.

📒 Files selected for processing (1)
  • blog/2025-10-26-config-entry-oauth2-error-handling.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
*/**(html|markdown|md)

⚙️ CodeRabbit configuration file

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

  • Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • Use sentence-style capitalization also in headings.

do not comment on HTML used for icons

Avoid flagging inline HTML for embedding videos in future reviews for this repository.

Files:

  • blog/2025-10-26-config-entry-oauth2-error-handling.md

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2025

Caution

Docstrings generation - FAILED

No docstrings were generated.

@wmoss wmoss force-pushed the blog-2025-10-26-config-entry-aouth2-error-handling branch from 0f8d9ff to 7986458 Compare October 27, 2025 04:17
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Thanks!

@MartinHjelmare MartinHjelmare merged commit 002b31a into home-assistant:master Nov 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants