Skip to content

Conversation

@mdegat01
Copy link
Contributor

@mdegat01 mdegat01 commented Sep 4, 2025

Proposed change

Document option for background install/update of an addon as added in home-assistant/supervisor#6134

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

  • New Features

    • Add asynchronous install and update for store add-ons using a background option. When enabled, requests return a job_id immediately so you can track progress without waiting. The backup option for updates remains available.
  • Documentation

    • Updated API docs to describe the background parameter for install/update endpoints, the immediate job_id response, and guidance to check job status for completion.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Docs — Supervisor API endpoints
docs/api/supervisor/endpoints.md
Documented async option for POST /store/addons/<addon>/install and /store/addons/<addon>/update by adding background: boolean. Describes immediate job_id response when background is true; update retains backup option.

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
Loading
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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch background-addon-install-update

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (2)
docs/api/supervisor/endpoints.md (2)

3232-3237: Add example + note for async behavior and job tracking

Include 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/backups

Provide an example job_id response 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 49e4dac and 1e974f0.

📒 Files selected for processing (1)
  • docs/api/supervisor/endpoints.md (2 hunks)

@silamon silamon merged commit 615f3b0 into master Sep 12, 2025
5 checks passed
@silamon silamon deleted the background-addon-install-update branch September 12, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants