Skip to content

Conversation

@mdegat01
Copy link
Contributor

@mdegat01 mdegat01 commented Dec 18, 2025

Proposed change

Add a POST /store/repositories/{repository}/repair API 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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@mdegat01 mdegat01 requested review from agners and sairon December 18, 2025 23:16
@mdegat01 mdegat01 added missing-documentation Added to pull requests that needs a docs, but none is linked new-feature A new feature needs-cli Pull requests needs CLI changes but none is linked needs-client-library Pull requests needs client library changes but none is linked labels Dec 18, 2025
@mdegat01 mdegat01 removed the missing-documentation Added to pull requests that needs a docs, but none is linked label Dec 19, 2025
@mdegat01 mdegat01 removed the needs-client-library Pull requests needs client library changes but none is linked label Dec 19, 2025
@mdegat01 mdegat01 removed the needs-cli Pull requests needs CLI changes but none is linked label Dec 19, 2025
@sairon sairon requested a review from Copilot December 19, 2025 10:08
Copy link
Contributor

Copilot AI left a 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

Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mdegat01 mdegat01 force-pushed the add-repository-repair-api branch from 81e0f9d to 4bc19ae Compare December 20, 2025 14:01
@mdegat01 mdegat01 mentioned this pull request Dec 20, 2025
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No official addon repository after fresh installation + restore from backup: Remote 'origin' has no refspec set

3 participants