Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Restrict theme asset downloads to .yaml files#4923

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

Open
saikumarvasa100-hash wants to merge6 commits intohacs:main
base:main
Choose a base branch
Loading
fromsaikumarvasa100-hash:saikumarvasa100-hash-patch-1

Conversation

@saikumarvasa100-hash
Copy link

@saikumarvasa100-hashsaikumarvasa100-hash commentedNov 13, 2025
edited by ludeeus
Loading

Closes#4863

When installing themes with release assets containing .yaml files, HACS was downloading ALL release assets instead of only the theme .yaml files.

This fix adds a filter in the gather_files_to_download() method to skip non-.yaml files when downloading theme release assets. This ensures only .yaml theme files are downloaded, preventing unwanted files like zip archives from being installed.

Fixeshacs#4863When installing themes with release assets containing .yaml files, HACS was downloading ALL release assets instead of only the theme .yaml files.Fixeshacs#4863When installing themes with release assets containing .yaml files, HACS was downloading ALL release assets instead of only the theme .yaml files.This fix adds a filter in the gather_files_to_download() method to skip non-.yaml files when downloading theme release assets. This ensures only .yaml theme files are downloaded, preventing unwanted files like zip archives from being installed.
@ludeeus
Copy link
Member

FYI: This is not a fix, this is a breaking change.

Please also add coverage that ensure this do what you change here.

@saikumarvasa100-hash
Copy link
Author

Thank you for the feedback! I understand this is a breaking change, not just a fix. I'm working on adding test coverage now to ensure the change works as intended. I'll update the PR shortly with tests that verify only .yaml files are downloaded for theme release assets.

ludeeus reacted with thumbs up emoji

…hat only .yaml files are downloaded from theme release assets, excluding non-.yaml files like images, zips, and markdown files.Add test for gathering theme files from release assets, ensuring only .yaml files are included.
@ludeeusludeeus added the Breaking ChangeAdded to pull requests that adds a breaking change labelNov 13, 2025
Copy link
Contributor

CopilotAI 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 fixes an issue where HACS was downloading all release assets when installing themes, instead of only.yaml theme files. The fix adds a filter in thegather_files_to_download() method to skip non-yaml files for theme releases.

  • Adds filtering logic to restrict theme release downloads to.yaml files only
  • Includes a test case to verify the new filtering behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

FileDescription
custom_components/hacs/repositories/base.pyAdds conditional logic to filter out non-.yaml files when downloading theme release assets
tests/helpers/download/test_gather_files_to_download.pyAdds test case to verify only.yaml files are downloaded from theme release assets

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

forreleaseinreleaseobjectsor []:
ifref==release.tag_name:
forassetinrelease.assetsor []:
# For themes, only download .yaml files from release assets

Choose a reason for hiding this comment

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

Inconsistent indentation: This line has excessive indentation (appears to have multiple leading spaces beyond what's needed). It should align with the surrounding code at the proper indentation level for code inside thefor asset in release.assets or []: loop.

Suggested change
# For themes, only download .yaml files from release assets
# For themes, only download .yaml files from release assets

Copilot uses AI. Check for mistakes.
Comment on lines +234 to +237
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"

Choose a reason for hiding this comment

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

Incorrect indentation: This test function is nested insidetest_gather_plugin_different_card_name instead of being at the module level. Thedef statement should be at the same indentation level as other test functions (no leading spaces), not indented within the previous function.

Suggested change
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"

Copilot uses AI. Check for mistakes.
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"

Choose a reason for hiding this comment

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

Incorrect indentation: This line has inconsistent indentation compared to the rest of the function body. It should be aligned with line 236 (4 spaces), not 8 spaces.

Suggested change
repository.ref="1.0.0"
repository.ref="1.0.0"

Copilot uses AI. Check for mistakes.
Comment on lines +234 to +237
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"

Choose a reason for hiding this comment

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

Variable test_gather_theme_files_from_release_only_yaml is not used.

Suggested change
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"
deftest_gather_theme_files_from_release_only_yaml(repository_theme):
"""Test that only .yaml files are downloaded from theme release assets."""
repository=repository_theme
repository.ref="1.0.0"

Copilot uses AI. Check for mistakes.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

Breaking ChangeAdded to pull requests that adds a breaking change

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Installing themes downloads every asset from the GitHub release

2 participants

@saikumarvasa100-hash@ludeeus

[8]ページ先頭

©2009-2025 Movatter.jp