Skip to content
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

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

Projects
None yet
2 participants
@daviwil
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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 daviwil force-pushed the dw-update-server-script branch from de4fda8 to 7883383 May 15, 2019

@daviwil

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2019

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

@daviwil daviwil requested review from nathansobo and jasonrudolph May 15, 2019

@jasonrudolph

This comment has been minimized.

Copy link
Member

commented May 16, 2019

This PR is ready to be reviewed!

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

@jasonrudolph jasonrudolph self-assigned this May 16, 2019

@jasonrudolph
Copy link
Member

left a comment

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.

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

**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)

This comment has been minimized.

Copy link
@jasonrudolph

jasonrudolph May 17, 2019

Member

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?

This comment has been minimized.

Copy link
@daviwil

daviwil May 17, 2019

Author Contributor

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

@daviwil
Copy link
Contributor Author

left a comment

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
Show resolved Hide resolved script/build Outdated
Show resolved Hide resolved script/update-server/README.md Outdated

**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)

This comment has been minimized.

Copy link
@daviwil

daviwil May 17, 2019

Author Contributor

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 added some commits May 21, 2019

@jasonrudolph jasonrudolph merged commit 677a46d into master May 21, 2019

2 checks passed

Atom Pull Requests #20190521.5 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@jasonrudolph jasonrudolph deleted the dw-update-server-script branch May 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.