Skip to content

Conversation

@ludeeus
Copy link
Member

@ludeeus ludeeus commented Nov 2, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 2, 2025 16:58
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 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/apps and /contents/apps/example)
  • Fixed test fixture data to correct directory structure (changed appdaemons to apps)

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 Refactored validate_repository and update_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants