Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
Remove deprecated repository_object.get_contents usage from appdaemon#4900
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 ourterms of service andprivacy 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?
Uh oh!
There was an error while loading.Please reload this page.
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 refactors the AppDaemon repository handling to use the git tree API directly instead of making separate API calls to list directory contents. This optimization reduces the number of GitHub API calls required during repository validation and updates.
Key changes:
- Replaced separate GitHub API calls with tree-based directory lookup using
get_first_directory_in_directory - Updated test snapshots to reflect the reduced API call count (removed calls to
/contents/appsand/contents/apps/example) - Fixed test fixture data to correct directory structure (changed
appdaemonstoapps)
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| custom_components/hacs/repositories/appdaemon.py | Refactoredvalidate_repository andupdate_repository methods to use tree-based lookup instead of GitHub API calls |
| tests/snapshots/api-usage/tests/scripts/data/test_generate_category_datatest-generate-category-data-single-repository-hacs-test-org-appdaemon-basic.json | Updated snapshot to reflect removed API calls |
| tests/snapshots/api-usage/tests/scripts/data/test_generate_category_datatest-generate-category-data-hacs-test-org-appdaemon-basic.json | Updated snapshot to reflect removed API calls |
| tests/snapshots/api-usage/tests/repositories/test_update_repositorytest-update-repository-websocket-hacs-test-org-appdaemon-basic.json | Updated snapshot to reflect removed API calls |
| tests/snapshots/api-usage/tests/repositories/test_update_repositorytest-update-repository-entity-hacs-test-org-appdaemon-basic.json | Updated snapshot to reflect removed API calls |
| tests/snapshots/api-usage/tests/repositories/test_remove_repositorytest-remove-repository-hacs-test-org-appdaemon-basic.json | Updated snapshot to reflect removed API calls |
| tests/snapshots/api-usage/tests/repositories/test_download_repositorytest-download-repository-hacs-test-org-appdaemon-basic.json | Updated snapshot to reflect removed API calls |
| tests/fixtures/proxy/api.github.com/repos/hacs-test-org/appdaemon-basic/git/trees/main.json | Fixed typo in directory path and added proper tree structure entries |
| tests/fixtures/proxy/api.github.com/repos/hacs-test-org/appdaemon-basic/git/trees/2.0.0.json | Fixed typo in directory path and added proper tree structure entries |
| tests/fixtures/proxy/api.github.com/repos/hacs-test-org/appdaemon-basic/git/trees/1.0.0.json | Fixed typo in directory path and added proper tree structure entries |
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
tests/fixtures/proxy/api.github.com/repos/hacs-test-org/appdaemon-basic/git/trees/main.json OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
tests/fixtures/proxy/api.github.com/repos/hacs-test-org/appdaemon-basic/git/trees/2.0.0.json OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
tests/fixtures/proxy/api.github.com/repos/hacs-test-org/appdaemon-basic/git/trees/1.0.0.json OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
No description provided.