Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fallback when current version is unavailable #31

Closed
BalusC opened this issue Oct 6, 2023 · 7 comments
Closed

Use fallback when current version is unavailable #31

BalusC opened this issue Oct 6, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@BalusC
Copy link

BalusC commented Oct 6, 2023

It's otherwise blocking builds, see also sass/dart-sass#2110

The plugin should fallback to previous version when current version fails to download. If that also fails then fallback further to last successfully used locally cached version.

@cleydyr
Copy link
Owner

cleydyr commented Oct 6, 2023

Good catch, @BalusC. I'll address this. Thank you.

@cleydyr cleydyr self-assigned this Oct 6, 2023
@cleydyr cleydyr added the enhancement New feature or request label Oct 6, 2023
@melloware
Copy link
Contributor

you rock @cleydyr !

@cleydyr
Copy link
Owner

cleydyr commented Oct 7, 2023

The proposed implementation to make this plugin more resilient is to iterate through each release and each release artifact and check if an artifact name matches what's expected (dart-sass-[VERSION]-[OS]-[ARCH].[EXTENSION]). If there's a matching artifact, we'll use its release as the autodetected version.

Note: the results returned by the GitHub API seem to be sorted by the date of the tag/commit [1], though it's not documented on the API doc itself.

The plugin should not fall back to the locally cached version, as the Dart Sass autodetection is intended to be used in environments with an Internet connection [2], which means it's also able to download at least one version with a matching artifact for all supported os-arch combinations (1.68.0 is one such version). Also, if there was a locally cached release to begin with, it would already be used, and the release download wouldn't be attempted.

cleydyr added a commit that referenced this issue Oct 7, 2023
double-check if asset for os-arch is included on release before returning
@cleydyr
Copy link
Owner

cleydyr commented Oct 7, 2023

Issue fixed on version 1.2.0, already deployed and soon to be published on Maven Central.

@melloware
Copy link
Contributor

Confirmed its in Maven Central.

@cleydyr
Copy link
Owner

cleydyr commented Oct 7, 2023

Closing this now.

@cleydyr cleydyr closed this as completed Oct 7, 2023
@BalusC
Copy link
Author

BalusC commented Oct 8, 2023

fab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants