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 preference to set a custom update url #865

Merged
merged 1 commit into from
Feb 28, 2022
Merged

Conversation

AlbyIanna
Copy link
Contributor

Motivation

We want to have a way to test the automatic update feature when downloading a build from a PR.

Change description

Add the possibility to change the URL the updater uses to know if there are updates and to download them. This way, anyone could start a local server that serves the files needed for the automatic update and fool the updater to make them think there is a new update to download.

Other information

This is necessary because a PR build of the Arduino IDE will generally be a newer version than the current latest version, so it's difficult to test before merging.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@per1234 per1234 added topic: code Related to content of the project itself type: enhancement Proposed improvement labels Feb 25, 2022
@AlbyIanna
Copy link
Contributor Author

Here's some instructions to test this PR:

  1. download the channel file. This differs based on the OS and the channel you're getting updates from, but now only the nightly channel is available:
  2. download the latest nightly from https://downloads.arduino.cc/arduino-ide/nightly/[NAME_OF_LATEST_BUILD] and replace NAME_OF_LATEST_BUILD with the value of the property path inside of your channel file (e.g.: https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-20220225_Windows_64bit.exe)
  3. create a folder called test-updater
  4. inside test-updater, create another folder called nightly
  5. move the channel file and the build file you've just downloaded inside the nightly folder
  6. serve content of test updater with whater local server you want. For example
cd test-updater    
python3 -m http.server
  1. Download and open the PR build of the Arduino IDE you want to test
  2. Open the User Preferences from the command palette (CTRL/CMD + SHIFT + P)
  3. Search for the "Update Channel" preference and set it to "nightly"
  4. Search for the "Update Base URL" preference and set it to the ip address your local server is running on (e.g.: http://0.0.0.0:8000)
  5. Close the Arduino IDE and reopen it. You should now see the update dialog

(Hint: after making your tests, make sure to reset the update URL to the default or your Arduino IDE will keep looking for updates from your custom URL)

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using this new feature a lot on Windows and Linux. It works perfectly and really improves the ability to test the update capability.

Thanks Alberto!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants