feat: remember last-used artefact and default to it on upgrade#293
Open
mbevc1 wants to merge 2 commits into
Open
feat: remember last-used artefact and default to it on upgrade#293mbevc1 wants to merge 2 commits into
mbevc1 wants to merge 2 commits into
Conversation
When a release exposes several assets, bin scores them by OS/arch and prompts when more than one ties. That choice was not remembered, so every `bin update` re-ran scoring/prompting from scratch and a user who picked a specific variant (e.g. musl/static) had to re-pick it each upgrade. Persist the selected top-level release asset (`Binary.SelectedAsset`) and, on upgrade, re-select it automatically when it can be uniquely re-identified in the new release. Because asset names embed the version, matching is version-insensitive via the existing SanitizeName helper. When a prompt is still required, the previously used artefact is offered as the default (Enter keeps it) through a new options.SelectWithDefault. The change is additive and backward compatible: configs without `selected_asset` decode to "" and fall through to the existing scoring/prompt path unchanged. Closes marcosnils#289
Owner
|
thx for taking this one. It's long overdue in the backlog but haven't come back to it due to lack of time |
Contributor
Author
|
No worries, was bugging me for a while with many apps shipping glib/musl and had to select it every time again 😄 |
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.
When a release exposes several assets, bin scores them by OS/arch and prompts when more than one ties. That choice was not remembered, so every
bin updatere-ran scoring/prompting from scratch and a user who picked a specific variant (e.g. musl/static) had to re-pick it each upgrade.Persist the selected top-level release asset (
Binary.SelectedAsset) and, on upgrade, re-select it automatically when it can be uniquely re-identified in the new release. Because asset names embed the version, matching is version-insensitive via the existing SanitizeName helper. When a prompt is still required, the previously used artefact is offered as the default (Enter keeps it) through a new options.SelectWithDefault.The change is additive and backward compatible: configs without
selected_assetdecode to "" and fall through to the existing scoring/prompt path unchanged.Closes #289