-
Notifications
You must be signed in to change notification settings - Fork 425
feat(updater): inject bundle_type into endpoint url #2960
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this produce URLs with the placeholder still in it when the installer is None?
Say there's an endpoint like:
Wouldn't that end up as:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. any suggestions? Should we replace that with
unknown
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using unknown is fine - though this should only happen in dev mode right? or if you run the target/release/app binary directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and i raised this concern before, but we should avoid using unknowns ever - maybe use a default value in that case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if the dev uses the tauri cli to package the app this should never be unknown. If they're using their own packaging system it'll show unknown (or the last created installer)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure i get what you mean. any kind of default value we set (assuming default means one of the existing types?) has a high chance to be incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having pulled the last of my hair out over Helm charts. The reasons this gets tricky is string templating.
To handle nullable values it pushes you down the route of conditional rendering or default values, and it's not fun 😬
So my first suggestion would be, think about alternatives that support nulls easily.
Like a header with these values in JSON.
As for
{{bundle_type}}
. I do thinkunknown
would make it slightly more useful than say empty string because then you can use it in paths as well as query strings.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option could be we we don't support this as a
{{bundle_type}}
placeholder and instead only support this through the query string. Because we then can assume how query strings work, we can omit it when None.So it's either:
https://foo.example/update/my-app/linux-x86_64/1.2.3
https://foo.example/update/my-app/linux-x86_64/1.2.3?bundle_type=appimage