fix(backend): detect .artifactbundle.zip files in asset selection#7657
Merged
fix(backend): detect .artifactbundle.zip files in asset selection#7657
Conversation
Commit 4f5c805 changed the artifact bundle detection from `asset.contains(".artifactbundle")` to `asset.ends_with(".artifactbundle")`. This broke detection of compressed artifact bundles like `sourcery-2.2.7.artifactbundle.zip` because they end with `.zip`, not `.artifactbundle`. As a result, tools like Sourcery that provide both `tool.zip` and `tool.artifactbundle.zip` now incorrectly selected the artifact bundle, which has different internal structure (extra nesting) that breaks path configurations like `exe=bin/sourcery`. The fix adds an additional check for `.artifactbundle.` to catch compressed variants (.artifactbundle.zip, .artifactbundle.tar.gz, etc.) while preserving the original check for plain .artifactbundle files. Also adds comprehensive tests for artifact bundle penalty scoring. Co-Authored-By: Claude <noreply@anthropic.com>
Owner
|
Bugbot run |
Contributor
|
Sorry, that was my mistake. Thanks for fixing! |
1 similar comment
Contributor
|
Sorry, that was my mistake. Thanks for fixing! |
Contributor
Author
|
@risu729 no worries, it's a weird edge case for sure! Test will cover this in future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproduction repo: https://github.com/swizzlr/mise-sourcery-repro
Commit 4f5c805 changed the artifact bundle detection from
asset.contains(".artifactbundle")toasset.ends_with(".artifactbundle").This broke detection of compressed artifact bundles like
sourcery-2.2.7.artifactbundle.zipbecause they end with.zip, not.artifactbundle. As a result, tools like Sourcery that provide bothtool.zipandtool.artifactbundle.zipnow incorrectly selected the artifact bundle, which has different internal structure (extra nesting) that breaks path configurations likeexe=bin/sourcery.The fix adds an additional check for
.artifactbundle.to catch compressed variants (.artifactbundle.zip, .artifactbundle.tar.gz, etc.) while preserving the original check for plain .artifactbundle files.Also adds comprehensive tests for artifact bundle penalty scoring.
Note
Updates asset scoring to avoid selecting artifact bundles that have incompatible structure.
AssetPicker::score_build_penalties, add check for".artifactbundle."alongsideends_with(".artifactbundle")to penalize compressed bundlestest_artifactbundle_penaltycovering.artifactbundle.zipand plain.artifactbundle, including score assertionsWritten by Cursor Bugbot for commit 5289e5c. This will update automatically on new commits. Configure here.