-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Add a simple server for testing Atom updates, enable Atom to use it via environment variable #18116
Conversation
Still need to add some more docs about test signing on macOS, but it's working well for updates there so far! |
de4fda8
to
7883383
Compare
Mac Development certificate steps have been added. This PR is ready to be reviewed! |
Thanks, @daviwil. ⚡ I'll review this PR today. |
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 putting this together, @daviwil. ✨
I verified that I can run the server locally, and I hit a few of the endpoints to verify that they're working locally for me (e.g., /api/updates
).
I also reviewed the diff and noted a few minor questions/suggestions inline below.
Based on the following excerpt from the PR body, I don't think it's possible yet to fully test Atom's ability to interact with the local update server:
One drawback in the short term is that current Atom releases do not look for the ATOM_UPDATE_URL_PREFIX environment variable to override the update URL so one will either need to test with Nightly builds (after this merges) or make a build of Atom stable or beta that includes this change.
With that in mind, it sounds like we'll have a wait until after this PR is merged before we can verify that Atom is able to successfully interact with the local update server. If that's not the case, please let me know.
|
||
**NOTE:** You can customize the port by setting the `PORT` environment variable. | ||
|
||
4. Start Atom from the command line with the `ATOM_UPDATE_URL_PREFIX` environment variable set to `http://localhost:3456` (change this to reflect any `PORT` override you might have used) |
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.
Should this work if your local version of Atom is an "Atom Dev" build (e.g., atom-dev-7883383
), or does your local version need to be a Nightly, Beta, or Stable version of Atom?
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.
The local version will need to be built with a version that identifies it in one of our release channels. Builds with -dev
versions have update checking turned off
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.
There is a way to test that Atom interacts with the test update server correctly before this PR is merged, it's just a bit of extra work:
- Follow the README instructions to run a local, test-signed build of Atom from this branch with
ATOM_RELEASE_VERSION="1.38.0-beta0
- Copy the resulting
Atom Beta.app
intoApplications
- Run the local test-signed build again with
ATOM_RELEASE_VERSION="1.38.0-beta1
- Start the test update server using the README instructions
- Launch the
Atom Beta.app
that you moved toApplications
with theATOM_UPDATE_URL_PREFIX="http://localhost:3456"
environment variable applied - Verify that the Atom Beta build finds and installs the update
|
||
**NOTE:** You can customize the port by setting the `PORT` environment variable. | ||
|
||
4. Start Atom from the command line with the `ATOM_UPDATE_URL_PREFIX` environment variable set to `http://localhost:3456` (change this to reflect any `PORT` override you might have used) |
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.
The local version will need to be built with a version that identifies it in one of our release channels. Builds with -dev
versions have update checking turned off
Description of the Change
This change adds a simple script that replicates Atom's update API on atom.io for local testing of Atom's update process on Windows and macOS. It looks for a full Atom build in the
./out
and then serves that to Atom when Atom is launched with a specialATOM_UPDATE_URL_PREFIX
environment variable that causes update checks to be sent to the local server.Alternate Designs
One can already test upgrades using a local build of atom.io, but that's a pretty heavy requirement if one only needs to test Atom's update checks.
Possible Drawbacks
One drawback in the short term is that current Atom releases do not look for the
ATOM_UPDATE_URL_PREFIX
environment variable to override the update URL so one will either need to test with Nightly builds (after this merges) or make a build of Atom stable or beta that includes this change.Verification Process