add BUILD_METADATA fallback when parsing - #2503
Merged
Merged
Conversation
ruslandoga
commented
Dec 5, 2022
| {:error, error} -> | ||
| error = Exception.format(:error, error) | ||
| Logger.warn("failed to parse $BUILD_METADATA, reason: " <> error) | ||
| _fallback = %{} |
Contributor
Author
There was a problem hiding this comment.
Should empty %{} fallback be mentioned in the warning?
Contributor
Author
There was a problem hiding this comment.
Should $BUILD_METADATA contents be added to the warning?
Contributor
Author
Contributor
Author
There was a problem hiding this comment.
In case the image doesn't load, here's the text version:
21:44:31.793 [warning] failed to parse $BUILD_METADATA: ** (Jason.DecodeError) unexpected byte at position 38: 0x70 ("p")
$BUILD_METADATA is set to {"tags":["plausible/analytics:v1.5.0",plausible/analytics:v1.5,plausible/analytics:v1,"plausible/analytics:latest"],"labels":{"org.opencontainers.image.title":"analytics","org.opencontainers.image.description":"Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.","org.opencontainers.image.url":"https://github.com/plausible/analytics","org.opencontainers.image.source":"https://github.com/plausible/analytics","org.opencontainers.image.version":"v1.5.0","org.opencontainers.image.created":"2022-12-02T15:45:09.831Z","org.opencontainers.image.revision":"f9ab2650b3192021d5808cc8f20064aa8af543f4","org.opencontainers.image.licenses":"AGPL-3.0"}}
21:44:31.796 [warning] falling back to empty build metadata, as if $BUILD_METADATA was set to {}
BundleMonUnchanged files (7)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
ruslandoga
force-pushed
the
fallback-build-info
branch
2 times, most recently
from
December 5, 2022 14:43
6c24f99 to
68b15cf
Compare
ruslandoga
force-pushed
the
fallback-build-info
branch
from
December 5, 2022 14:45
68b15cf to
8af9cf4
Compare
ukutaht
approved these changes
Dec 5, 2022
This was referenced Dec 7, 2022
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.

Changes
This PR adds a fallback to empty build metadata when BUILD_METADATA contains invalid JSON.
Example
warninglog forBUILD_METADATA={...}:Fixes #2491
Tests
Changelog
Documentation
Dark mode