Page MenuHomePhabricator

[electron-update-server] Ignore older releases
ClosedPublic

Authored by michal on Jun 14 2023, 6:59 AM.
Tags
None
Referenced Files
F3386692: D8208.id27806.diff
Fri, Nov 29, 5:45 AM
F3386594: D8208.id27745.diff
Fri, Nov 29, 5:11 AM
Unknown Object (File)
Mon, Nov 25, 4:58 PM
Unknown Object (File)
Mon, Nov 25, 4:55 PM
Unknown Object (File)
Mon, Nov 25, 2:34 PM
Unknown Object (File)
Tue, Nov 5, 12:49 AM
Unknown Object (File)
Fri, Nov 1, 8:58 AM
Unknown Object (File)
Fri, Nov 1, 8:58 AM
Subscribers

Details

Summary

Fix for https://linear.app/comm/issue/ENG-4073
hazel (the update server for electron) has these issues:

  • it depends on the ordering of releases returned by GitHub API, which isn't guaranteed
  • it only checks if the new version from GitHub is different than the currently cached version

This diffs adds sorting of the results from github and checks if the new release is (semver) greater than the currently cached.

Test Plan

Check with a test repo:

  • add a new release, check if it's cached
  • add a new release that has a lower semver, check that it's skipped

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil requested changes to this revision.Jun 15 2023, 3:11 AM
kamil added inline comments.
patches/hazel-server+5.1.1.patch
17–27 ↗(On Diff #27754)

can be simplified

31–35 ↗(On Diff #27754)

Correct me if I am wrong but looks like we can modify this condition here and avoid sorting, since at the end we care only about the latest version

This revision now requires changes to proceed.Jun 15 2023, 3:11 AM

Moved all conditions (version has to be newer, release has to have assets) to the find condition instead of skipping them after one release is chosen. This way we don't ignore the rest of release from github api

This revision is now accepted and ready to land.Jun 16 2023, 2:38 AM