Page MenuHomePhabricator

[services] Add electron update server to the services
ClosedPublic

Authored by michal on Jan 23 2023, 11:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 5:53 PM
Unknown Object (File)
Apr 5 2024, 12:00 AM
Unknown Object (File)
Apr 5 2024, 12:00 AM
Unknown Object (File)
Apr 5 2024, 12:00 AM
Unknown Object (File)
Apr 5 2024, 12:00 AM
Unknown Object (File)
Apr 5 2024, 12:00 AM
Unknown Object (File)
Apr 5 2024, 12:00 AM
Unknown Object (File)
Apr 4 2024, 11:54 PM
Subscribers

Details

Summary

Adds the electron update server to the services. It's using the hazel package.

Test Plan

Run yarn dev and yarn prod (with env vars pointing at a custom repo) and check if it correctly serves files. Example:
HAZEL_ACCOUNT=MichalGniadek HAZEL_REPOSITORY=comm-test-gh HAZEL_PORT=3005 yarn dev will use this repo: https://github.com/MichalGniadek/comm-test-gh that already has some releases with necessary files created.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat requested changes to this revision.Jan 23 2023, 12:10 PM
  1. We should update the root package.json to introduce the new workspace
  2. Once we do that, we probably will need to patch keyserver/Dockerfile to reflect the new workspace
services/electron-update-server/index.cjs
1 ↗(On Diff #21223)

Why can't this be ESM + Flow?

This revision now requires changes to proceed.Jan 23 2023, 12:10 PM

Make it a proper workspace, use flow and ESM.

Fix unnecessary dockerfile formatting

services/electron-update-server/.flowconfig
2 ↗(On Diff #21259)

For the express typings.

services/electron-update-server/flow-typed/npm/hazel-server_vx.x.x.js
6 ↗(On Diff #21259)

There are no typescript types available or existing flow-type typings. I took the options from here, and checked if the types make sense in the rest of the hazel code.

Run yarn dev and yarn prod (with env vars pointing at a custom repo) and check if it correctly serves files.

Could you expand Test Plan a bit? Specifically, what environment variables need to be set + what's a good example repo to test against.

ashoat requested changes to this revision.Jan 24 2023, 2:43 PM

Awesome!!

Just one inline comment and a question: should we be calling flow from lint-staged too? (Maybe needs to be added for desktop as well)

services/electron-update-server/.flowconfig
2 ↗(On Diff #21259)

We use express directly in electron-update-server, so I think it would be better to flow-typed install express in electron-update-server

This revision now requires changes to proceed.Jan 24 2023, 2:43 PM

Updated the test plan, added flow to lint-staged (desktop is already added, I just forgot about this file), added flow typed for express to electron-update-server instead on relying on types in keyserver.

This revision is now accepted and ready to land.Jan 25 2023, 7:27 AM