-
Notifications
You must be signed in to change notification settings - Fork 722
Allow to force rebuild of add-ons #6002
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
📝 WalkthroughWalkthroughThe changes introduce a new optional Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant APIAddons
participant AddonManager
Client->>APIAddons: POST /addons/{slug}/rebuild (with optional force)
APIAddons->>APIAddons: Validate request (SCHEMA_REBUILD)
APIAddons->>AddonManager: rebuild(slug, force=...)
AddonManager->>AddonManager: Check need_build or force
AddonManager-->>APIAddons: Return rebuild task or error
APIAddons-->>Client: Respond with status (success or error)
Warning Review ran into problems🔥 ProblemsCheck-run timed out after 90 seconds. Some checks/pipelines were still in progress when the timeout was reached. Consider increasing the reviews.tools.github-checks.timeout_ms value in your CodeRabbit configuration to allow more time for checks to complete. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (10)`supervisor/**/*.py`: Use Python 3.13+ and modern Python features: type hints wi...
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md) List of files the instruction was applied to:
`*/**(html|markdown|md)`: - For instructional content in documentation, use a di...
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
`*/**(html|markdown|md)`: - Use bold to mark UI strings. - If "" are used to mark UI strings, replace them by bold.
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
`*/**(html|markdown|md)`: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
`*/**(html|markdown|md)`: - Use sentence-style capitalization also in headings.
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
`*/**(html|markdown|md)`: do not comment on HTML used for icons
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
`*/**(html|markdown|md)`: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
`supervisor/addons/**/*.py`: AppArmor profiles are mandatory for add-ons, with minimal capabilities
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md) List of files the instruction was applied to:
`supervisor/api/**/*.py`: All REST API endpoints must be under `/api/`, use bear...
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md) List of files the instruction was applied to:
`tests/**/*.py`: Use pytest with asyncio support for testing Place all tests in ...
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md) List of files the instruction was applied to:
🧬 Code Graph Analysis (1)tests/api/test_addons.py (4)
🪛 Flake8 (7.2.0)tests/api/test_addons.py[error] 285-285: (F824) ⏰ 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). (4)
🔇 Additional comments (7)
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Demo: ➜ ~ curl --fail-with-body -sSL -H "Authorization: Bearer ${SUPERVISOR_TOKEN}" -X POST http://supervisor/addons/local_example/rebuild
curl: (22) The requested URL returned error: 400
{"result":"error","message":"Can't rebuild a image based add-on"}#
➜ ~ curl --fail-with-body -sSL -H "Authorization: Bearer ${SUPERVISOR_TOKEN}" -X POST http://supervisor/addons/local_example/rebuild -d '{"force": true}'
{"result":"ok","data":{}}# |
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.
Nice, LGTM, thanks! 👍
Proposed change
Allows passing
{"force": true}
tohttp://supervisor/addons/<addon>/rebuild
to force a rebuild of the add-on, even if the add-on hasimage
set in itsconfig.yml
.This is useful for testing changes to the add-on, avoiding the need for commenting out the
image
line in theconfig.yml
file.Type of change
Additional information
Disclaimer: tests generated by Claude Sonnet 4.
Checklist
ruff format supervisor tests
)If API endpoints or add-on configuration are added/changed:
Summary by CodeRabbit
New Features
Bug Fixes
Tests