Document next_flow in async_create_entry in RepairsFlow#2985
Document next_flow in async_create_entry in RepairsFlow#2985iluvdata wants to merge 6 commits intohome-assistant:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
docs/core/platform/repairs.md (2)
136-136: Remove trailing whitespace.Lines 136, 138, 160, and 162 have trailing whitespace after the commas. Consider removing these for cleaner formatting.
✨ Remove trailing spaces
- return self.async_create_entry( - title="", data={}, - next_flow=( - FlowType.CONFIG_SUBENTRIES_FLOW, + return self.async_create_entry( + title="", data={}, + next_flow=( + FlowType.CONFIG_SUBENTRIES_FLOW, next_flow["flow_id"] ) )-return self.async_create_entry( - title="", data={}, - next_flow=( - FlowType.OPTIONS_FLOW, +return self.async_create_entry( + title="", data={}, + next_flow=( + FlowType.OPTIONS_FLOW, next_flow["flow_id"] ) )Also applies to: 138-138, 160-160, 162-162
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/core/platform/repairs.md` at line 136, Remove the trailing whitespace after commas in the snippet shown (e.g. the "title=\"\", data={," fragment) on the affected lines (136, 138, 160, 162); edit those lines to remove the extra spaces immediately following the commas so they read without trailing spaces (e.g. "title=\"\", data={}"). Ensure no other trailing spaces remain in the surrounding lines.
103-103: Remove unused import.
ConfirmRepairFlowis imported on line 103 but not used in the code example. Consider removing it to keep the example focused.🧹 Remove unused import
-from homeassistant.components.repairs import ConfirmRepairFlow, RepairsFlow +from homeassistant.components.repairs import RepairsFlow🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/core/platform/repairs.md` at line 103, The import line currently includes an unused symbol ConfirmRepairFlow; remove ConfirmRepairFlow from the import so only the used RepairsFlow is imported (i.e., update the import that reads "from homeassistant.components.repairs import ConfirmRepairFlow, RepairsFlow" to import only RepairsFlow).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/core/platform/repairs.md`:
- Around line 153-166: The example uses the symbol ConfigFlowResult but it's not
imported; add an import for ConfigFlowResult from homeassistant.config_entries
in the module's imports so the options flow snippet (where async_init is called
and async_create_entry with next_flow is returned) will not raise a NameError.
- Around line 101-147: The example references SubentryFlowContext but does not
import it; add the missing import so the symbol is defined (e.g., import
SubentryFlowContext from the same module that provides subentry APIs) and ensure
the example's imports at the top include SubentryFlowContext so
Issue1RepairFlow.async_step_confirm can call SubentryFlowContext without a
NameError.
- Line 138: The explanatory text incorrectly references
FlowType.SUBENTRIES_FLOW; update that text to use the correct enum member
FlowType.CONFIG_SUBENTRIES_FLOW so it matches the code example (replace any
occurrence of FlowType.SUBENTRIES_FLOW in the explanatory paragraph with
FlowType.CONFIG_SUBENTRIES_FLOW).
---
Nitpick comments:
In `@docs/core/platform/repairs.md`:
- Line 136: Remove the trailing whitespace after commas in the snippet shown
(e.g. the "title=\"\", data={," fragment) on the affected lines (136, 138, 160,
162); edit those lines to remove the extra spaces immediately following the
commas so they read without trailing spaces (e.g. "title=\"\", data={}"). Ensure
no other trailing spaces remain in the surrounding lines.
- Line 103: The import line currently includes an unused symbol
ConfirmRepairFlow; remove ConfirmRepairFlow from the import so only the used
RepairsFlow is imported (i.e., update the import that reads "from
homeassistant.components.repairs import ConfirmRepairFlow, RepairsFlow" to
import only RepairsFlow).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 09eba6b2-0c59-4c94-9758-e0b7e657dcf0
📒 Files selected for processing (1)
docs/core/platform/repairs.md
Updated context source description for next_flow issue repair flows.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/core/platform/repairs.md`:
- Around line 101-147: The example uses vol.Schema({}) in
Issue1RepairFlow.async_step_confirm but never imports voluptuous; add the
missing top-level import "import voluptuous as vol" alongside the other imports
so vol.Schema is defined and the async_step_confirm return self.async_show_form
call works correctly.
- Around line 154-167: The snippet uses an undefined config_entry; change it to
read the entry id from self.data (e.g. assign config_entry_id =
self.data["entry_id"]) and pass that id into
self.hass.config_entries.options.async_init instead of config_entry.entry_id,
then use the returned next_flow in the existing self.async_create_entry call
(keeping FlowType.OPTIONS_FLOW and next_flow["flow_id"]) so the example is
consistent with the earlier snippet.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f620fa80-3d80-4ab5-af81-f0209e897336
📒 Files selected for processing (1)
docs/core/platform/repairs.md
|
Retested with dev branch of frontend and next flow is no longer working even for config flows. The dialog is created then closed. There were many recent updates to ha-dialog.ts that appears to have broken this. Investigating a frontend patch. |
|
Ok, thanks for the update. I'll draft this then. |
Updated return types RepairsFlowResult instead of data_entry_flow.FlowResult. Added notes on issue lifecycle and next_flow usage.
|
The bug with ha-dialog.ts has been addressed. There is an additional minor frontend bug fix pending as noted in home-assistant/core#165091. |
Proposed change
Type of change
Checklist
Additional information
Summary by CodeRabbit