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.
feat: update macOS asset matching #169
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
feat: update macOS asset matching #169
Changes from 7 commits
0476c06
ff43355
ef38952
f22e472
2bdcea8
f2fd8d8
c924e0d
7ab3f84
08d4032
f08728a
8224ad2
1216fb1
b2c09c9
e313059
cb7cc68
cd8e924
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This change in behavior seems unrelated? Can you explain this change and why it's needed in this PR
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.
Thanks for the review @MarshallOfSound - apologies for not calling out this change.
This change was important to ensure that assets from previous releases weren't being matched.
For example, without this change
http://localhost:62178/gitify-app/gitify/darwin-x64/5.14.0
andhttp://localhost:62178/gitify-app/gitify/darwin-arm64/5.14.0
were both finding the "latest" assets from a really old release https://github.com/gitify-app/gitify/releases/tag/v4.2.1 (the last time we published non-universal artifacts).This then causes the following empty response and inaccurate log message
update.electronjs.org/src/updates.js
Lines 110 to 113 in 3638132
Adding in the above check ensures that only newer versions are considered eligible for the
latest
assets objectThere 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.
This isn't an issue with your other changes in this PR right, i.e. you don't need this now that you've added
universal
fallback?The regex changes seem safe at a glance, but changing this
lte
from it's original defense location would require more thinking. If you remove thislt
change reviewing this PR will be much easier and will be more likely it lands.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.
Actually, this change is required as part of this PR for it to work.
Without it,
latest
is not null, therefore it never falls back to checking if the universal release is newer.eg:
latest ===
{name: "v4.2.1", ...}
latestUniversal ===
{name: "v5.15.0", ...}
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.
This logic can either be where I've placed it, or in the universal release block (ie: semver.gt(universal.version, latest.version)...
I went with the former since that is where the other asset tags are skipped over (prerelease, draft, invalid semver)
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.
Hm, can we modify the fallback logic from: "get x64/arm64, if not exists get universal" or just consider
unviersal
buildsarm64/x64
builds by default if no arm64/x64 specific build is present. i.e. it's a fallback within get asset, rather than a separate call?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.
i.e. in here
update.electronjs.org/src/updates.js
Line 175 in 3638132
Just do effective
if (!latest[platform] && platform === A_DARWIN_PLATFORM && latest[universal]) return latest[universal]
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.
Removed the
lt
check and changes where the latestUniversal replacement occurs