Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Add a simple server for testing Atom updates, enable Atom to use it via environment variable #18116

Merged
merged 8 commits into from
May 21, 2019

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Sep 26, 2018

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 special ATOM_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

  • Built an update on Windows, used the update server to successfully upgrade Atom
  • Built an update on macOS, used the update server to successfully upgrade Atom

@daviwil
Copy link
Contributor Author

daviwil commented Sep 26, 2018

Still need to add some more docs about test signing on macOS, but it's working well for updates there so far!

@daviwil
Copy link
Contributor Author

daviwil commented May 15, 2019

Mac Development certificate steps have been added. This PR is ready to be reviewed!

@jasonrudolph
Copy link
Contributor

This PR is ready to be reviewed!

Thanks, @daviwil. ⚡ I'll review this PR today.

@jasonrudolph jasonrudolph self-assigned this May 16, 2019
Copy link
Contributor

@jasonrudolph jasonrudolph left a 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.

script/update-server/README.md Outdated Show resolved Hide resolved
script/build Outdated Show resolved Hide resolved

**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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

@daviwil daviwil left a 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:

  1. Follow the README instructions to run a local, test-signed build of Atom from this branch with ATOM_RELEASE_VERSION="1.38.0-beta0
  2. Copy the resulting Atom Beta.app into Applications
  3. Run the local test-signed build again with ATOM_RELEASE_VERSION="1.38.0-beta1
  4. Start the test update server using the README instructions
  5. Launch the Atom Beta.app that you moved to Applications with the ATOM_UPDATE_URL_PREFIX="http://localhost:3456" environment variable applied
  6. Verify that the Atom Beta build finds and installs the update

script/build Outdated Show resolved Hide resolved
script/update-server/README.md Outdated Show resolved Hide resolved

**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)
Copy link
Contributor Author

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

@jasonrudolph jasonrudolph merged commit 677a46d into master May 21, 2019
@jasonrudolph jasonrudolph deleted the dw-update-server-script branch May 21, 2019 16:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants