-
Notifications
You must be signed in to change notification settings - Fork 757
Add API to force repository repair #6439
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds a new API endpoint POST /store/repositories/{repository}/repair that allows users to force a reset on addon repositories that appear broken in the UI. The endpoint triggers a git reset on the repository and automatically dismisses any related resolution system issues and suggestions.
Key Changes
- New REST API endpoint for repository repair functionality
- Enhanced error handling with two new exception types for better user feedback
- Integration with the resolution system to automatically clean up related issues/suggestions after repair
- Comprehensive test coverage for success, error, and edge cases
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| supervisor/api/init.py | Registers the new POST endpoint at /store/repositories/{repository}/repair |
| supervisor/api/store.py | Implements the repair endpoint handler with resolution system integration |
| supervisor/store/repository.py | Enhances reset() method with proper error handling and exception raising |
| supervisor/exceptions.py | Adds two new exception classes: StoreRepositoryLocalCannotReset and StoreRepositoryUnknownError for improved error reporting |
| tests/api/test_store.py | Adds comprehensive tests covering success cases, local repository rejection, git errors, and resolution system integration |
sairon
left a comment
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.
Looks good!
81e0f9d to
4bc19ae
Compare
Proposed change
Add a
POST /store/repositories/{repository}/repairAPI that users can use to force a reset on a particular addon repository that they see is broken in the UI. Like in #6405 (and many other similar issues).Type of change
Additional information
Checklist
ruff format supervisor tests)If API endpoints or add-on configuration are added/changed: