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

fix: add fallback to tag when branch could not be fetched via git #390

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

Badmuts
Copy link
Contributor

@Badmuts Badmuts commented Apr 6, 2023

Description

In the docker image we don't include any git history and this breaks the logic to dynamically parse a version for the used CDN endpoints. With this fix we introduce a new CDN_DIST_TAG environment variable which can be used to fetch dist-tagged versions from npm (eg. alpha, beta, latest) and will resolve it to a release version (eg. latest -> 1.0.3, alpha -> 1.0.0-alpha.3). This is helpful to circumvent caching issues by browsers.

Type of change

Bug fix / improvement

Tests

Use a docker image with the CDN_DIST_TAG environment variable. Your console should log that it can't use git to determine the branch and it will fallback to the given tag.

Could not get branch via git; fallback to alpha
Using cdn https://cdn.jsdelivr.net/npm/openstad-components@1.0.0-alpha.3/dist

Tested on openstad-ams-staging cluster

Branch

Based of master/main, not development

@Badmuts Badmuts requested a review from nlsvgtr April 6, 2023 13:48
Copy link
Contributor

@nlsvgtr nlsvgtr left a comment

Choose a reason for hiding this comment

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

Great, tnx :)

Could you add this to the management-panel as well.

@nlsvgtr
Copy link
Contributor

nlsvgtr commented Apr 11, 2023

I did notice an issue with readFileSync while using fs.promises, and fixed that. Please review those changes befor merging.

@Badmuts
Copy link
Contributor Author

Badmuts commented Apr 18, 2023

I can't approve my own PR but looks good to me!

@Badmuts Badmuts merged commit fc9fb62 into master Apr 18, 2023
@Badmuts Badmuts deleted the fix/cdn-dist-tags branch April 18, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants