-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Document background addon install/update option #2775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds an optional background boolean to the install and update add-on endpoints in Supervisor API docs. When true, the endpoints return a job_id immediately and run asynchronously. The update endpoint retains the backup option. Documentation reflects payload changes and response behavior. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Supervisor API as Supervisor API
participant Job Queue as Job Queue
participant Add-on System as Add-on System
rect rgba(230,240,255,0.6)
Note over Client,Supervisor API: Install Add-on
Client->>Supervisor API: POST /store/addons/<addon>/install { background: true|false }
alt background == true
Supervisor API->>Job Queue: Enqueue install(<addon>)
Supervisor API-->>Client: 202 Accepted { job_id }
Job Queue->>Add-on System: Perform install
Add-on System-->>Job Queue: Status updates
Client->>Supervisor API: GET /jobs/<job_id> (poll)
Supervisor API-->>Client: Job status/result
else background == false
Supervisor API->>Add-on System: Install <addon>
Add-on System-->>Supervisor API: Result
Supervisor API-->>Client: 200 OK (install result)
end
end
sequenceDiagram
autonumber
actor Client
participant Supervisor API as Supervisor API
participant Job Queue as Job Queue
participant Add-on System as Add-on System
rect rgba(230,255,230,0.6)
Note over Client,Supervisor API: Update Add-on
Client->>Supervisor API: POST /store/addons/<addon>/update { background: true|false, backup: bool }
alt background == true
Supervisor API->>Job Queue: Enqueue update(<addon>, backup)
Supervisor API-->>Client: 202 Accepted { job_id }
Job Queue->>Add-on System: Perform update (backup if true)
Add-on System-->>Job Queue: Status updates
Client->>Supervisor API: GET /jobs/<job_id> (poll)
Supervisor API-->>Client: Job status/result
else background == false
Supervisor API->>Add-on System: Update <addon> (backup if true)
Add-on System-->>Supervisor API: Result
Supervisor API-->>Client: 200 OK (update result)
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/api/supervisor/endpoints.md (2)
3232-3237: Add example + note for async behavior and job trackingInclude an example response and a short note pointing to Jobs so clients know how to track the async install. Mirrors the backups sections’ pattern.
**Payload:** | key | type | description | | ---------- | ------- | --------------------------------------------------------------------------------------------------- | | background | boolean | Return `job_id` immediately, do not wait for install to complete. Clients must check job for status | +**Example response:** + +```json +{ + "job_id": "abc123" +} +``` + +:::note +When `background` is `true`, the call returns immediately with a `job_id`. Use the Jobs API (see “Jobs” below) or Supervisor logs to monitor progress and final result. +:::
3246-3250: Add example + note for async update parity with install/backupsProvide an example
job_idresponse and the same guidance note for tracking, for consistency with install and backup endpoints.**Payload:** | key | type | description | | ---------- | ------- | -------------------------------------------------------------------------------------------------- | | backup | boolean | Create a partial backup of the add-on, default is false | | background | boolean | Return `job_id` immediately, do not wait for update to complete. Clients must check job for status | +**Example response:** + +```json +{ + "job_id": "abc123" +} +``` + +:::note +When `background` is `true`, the call returns immediately with a `job_id`. Use the Jobs API (see “Jobs” below) or Supervisor logs to monitor progress and final result. +:::
📜 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
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/api/supervisor/endpoints.md(2 hunks)
Proposed change
Document option for background install/update of an addon as added in home-assistant/supervisor#6134
Type of change
Checklist
Additional information
Summary by CodeRabbit
New Features
Documentation