Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Add conditional to download and apply RELEASES file on Windows #11153

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

aekeus
Copy link
Member

@aekeus aekeus commented Sep 26, 2017

Add conditional to download and apply RELEASES file on Windows
if the braveURL attribute is set in the metadata response. This will
download the version specified, not the latest version as is happening
before this commit.

Auditors: @bbondy, @clifton

fixes: #11152

Test plan:

  • Change version in package.json to something lower than current
  • Build browser on Windows
  • Install and check for updates
  • Ensure the following line is shown in SquirrelSetup.log
    It must contain a version number (0.19.16 in example below)

2017-09-25 18:04:13> CheckForUpdateImpl: Downloading RELEASES file from
https://brave-download.global.ssl.fastly.net/multi-channel/releases/beta/0.19.16/winx64

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

if he braveURL attribute is set in the metadata respone. This will
download the version specified, not the latest version is happening
before this commit.

Auditors: @bbondy, @clifton

Test plan:

  * Change version in package.json to something lower than current
  * Build browser on Windows
  * Install and check for updates
  * Ensure the following line is shown in SquirrelSetup.log
    It must contain a version number (0.19.16 in example below)

2017-09-25 18:04:13> CheckForUpdateImpl: Downloading RELEASES file from
https://brave-download.global.ssl.fastly.net/multi-channel/releases/beta/0.19.16/winx64
@aekeus aekeus added this to the 0.20.x (Developer Channel) milestone Sep 26, 2017
@aekeus aekeus self-assigned this Sep 26, 2017
@codecov-io
Copy link

codecov-io commented Sep 26, 2017

Codecov Report

Merging #11153 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master   #11153      +/-   ##
==========================================
- Coverage   53.39%   53.38%   -0.01%     
==========================================
  Files         253      253              
  Lines       21892    21895       +3     
  Branches     3421     3422       +1     
==========================================
  Hits        11689    11689              
- Misses      10203    10206       +3
Flag Coverage Δ
#unittest 53.38% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
app/updater.js 27.43% <0%> (-0.52%) ⬇️

@bsclifton
Copy link
Member

@aekeus I set the version in package.json to 0.15.0 and created an installer / installed. I wonder if I missed something?

When running, I get the following error (from Squirrel logs):

2017-09-28T07:18:22.694Z - platformBaseUrl = https://brave-laptop-updates.global.ssl.fastly.net/1/releases/dev/0.15.0/winx64
2017-09-28T07:18:22.694Z - updateUrl = https://brave-download.global.ssl.fastly.net/multi-channel/releases/dev/winx64
2017-09-28T07:18:37.975Z - checkForUpdates
2017-09-28T07:18:37.975Z - lastCheckWOY = 265
2017-09-28T07:18:37.976Z - https://brave-laptop-updates.global.ssl.fastly.net/1/releases/dev/0.15.0/winx64?daily=false&weekly=false&monthly=false&first=false&accept_preview=true
2017-09-28T07:18:37.975Z - lastCheckMonth = 9
2017-09-28T07:18:37.975Z - lastCheckYMD = 2017-09-28
2017-09-28T07:18:37.975Z - firstCheckMade = true
2017-09-28T07:18:38.379Z - Metadata: {"version":"0.18.36","name":"Brave 0.18.36","pub_date":"2017-09-14T22:13:07.021Z","notes":"Added MacBook trackpad pinch to zoom gesture support. Upgraded to Chromium 61. More details: https://github.com/brave/browser-laptop/releases/tag/v0.18.36dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.32\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.31\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.30\ndev\n\nFixed Netflix by adding VMP support, optimized page loads and fixed tab behaviour (detaching, moving and dead tabs). More details: https://github.com/brave/browser-laptop/releases/tag/v0.18.29dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.28\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.27\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.26\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.25\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.24\ndev\n\nFixed many issues with performance (browser and video freezing, lag on find bar), Fixed tab loss on crash, fixed spell check on Disqus comment boxes, and upgraded Chromium. More details: https://github.com/brave/browser-laptop/releases/tag/v0.18.23dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.22\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.21\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.20\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.19\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.17\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.18.15\ndev\n\nAdded a welcome screen for first time users, added an option to disable 'Top Sites' in autocomplete, fixed URL display on error pages, and numerous fixes for Sync, extensions, and performance. More details: https://github.com/brave/browser-laptop/releases/tag/v0.18.14dev\n\nNumerous performance improvements, fixed tab display when closing tabs, fixed history listings and fixed a security issue for WebTorrent. More details: https://github.com/brave/browser-laptop/releases/tag/v0.17.19dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.18\ndev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.17dev\n\nFixed sync issues, fixed a URL bar issue, and upgraded Chromium to 59.0.3071.115. More details: https://github.com/brave/browser-laptop/releases/tag/v0.17.16dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.15dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.14dev\n\nAdded the Honey extension, added a wide URL bar option, performance fixes, updated to Chromium 59.0.3071.109. More details: https://github.com/brave/browser-laptop/releases/tag/v0.17.13dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.12dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.11dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.10dev\n\nMore details: https://github.com/brave/browser-laptop/releases/tag/v0.17.9dev\n\nImprovements to sync, various fixes. More details: https://github.com/brave/browser-laptop/releases/tag/v0.17.3dev\n\nNOTE: This is a preview build. Added Honey extension, compact bravery panel, bitward password manager, and new welcome screen. Many perf, style, and build fixes. More details: https://github.com/brave/browser-laptop/releases/tag/v0.17.1dev.\n\nHotfix for crash on login or other input. Fixed ability to scroll to latest bookmark as well. More details: https://github.com/brave/browser-laptop/releases/tag/v0.16.9dev\n\nAdded various performance improvements, fixed bookmark manager drag & drop for folders and bookmarks, and upgraded to Chromium 59.0.3071.86. More details: https://github.com/brave/browser-laptop/releases/tag/v0.16.6dev\n\nHotfix for latest release which fixes password updates, popups for logins, and autocomplete search terms. More details: https://github.com/brave/browser-laptop/releases/tag/v0.15.314dev\n\nWe've made incredible performance improvements, added sharing to social media sites & email, added option to enable/disable HTML5 autoplay, added ability to zoom for UI elements, and fixed various UI issues. More details: https://github.com/brave/browser-laptop/releases/tag/v0.15.310dev\n\nUpdate to Chromium 58.0.3029.96. More details: https://github.com/brave/browser-laptop/releases/tag/v0.15.2dev\n\nHotfix to alleviate crashes due to PDF loading or visiting particular sites. More details: https://github.com/brave/browser-laptop/releases/tag/v0.15.1dev","preview":false,"braveURL":"https://brave-download.global.ssl.fastly.net/multi-channel/releases/dev/0.18.36/winx64/"}
2017-09-28T07:18:40.140Z - Error: Command failed: 4294967295
System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__38`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.FileDownloader.<DownloadUrl>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.<CheckForUpdate>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Download>d__7.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
   at Squirrel.Update.Program.Main(String[] args)
---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__38`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.FileDownloader.<DownloadUrl>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.<CheckForUpdate>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Download>d__7.MoveNext()<---

@bsclifton bsclifton modified the milestones: 0.19.x (Beta Channel), 0.20.x (Developer Channel) Sep 29, 2017
@aekeus
Copy link
Member Author

aekeus commented Sep 29, 2017

This patch should ONLY be applied after all versions of the browser contain a valid RELEASES file in the Windows S3 bucket. Otherwise browsers will attempt to upgrade to a version specific release that contains neither a RELEASES file nor the required .nupkg file.

@cezaraugusto cezaraugusto added the needs-info Another team member needs information from the PR/issue opener. label Oct 14, 2017
@bbondy
Copy link
Member

bbondy commented Oct 27, 2017

@aekeus I realize this is a month later, but how can we ensure the following?

This patch should ONLY be applied after all versions of the browser contain a valid RELEASES file in the Windows S3 bucket. Otherwise browsers will attempt to upgrade to a version specific release that contains neither a RELEASES file nor the required .nupkg file.

Would this be safe to pull into 0.20.x and merged?

@bbondy bbondy modified the milestones: 0.20.x (Beta Channel), Backlog Oct 27, 2017
@bsclifton
Copy link
Member

@aekeus is this ready to merge?

@bsclifton bsclifton modified the milestones: Triage Backlog, 0.20.x (Beta Channel) Nov 20, 2017
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

LGTM; ready to land in 0.20.x. Will require manual testing (steps are called out here)

@bsclifton bsclifton merged commit 080820a into master Nov 20, 2017
@bsclifton bsclifton deleted the windows-release branch November 20, 2017 20:20
bsclifton added a commit that referenced this pull request Nov 20, 2017
Add conditional to download and apply RELEASES file on Windows
bsclifton added a commit that referenced this pull request Nov 20, 2017
Add conditional to download and apply RELEASES file on Windows
@bsclifton
Copy link
Member

master 080820a
0.21.x c061386
0.20.x 72e92ff

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-info Another team member needs information from the PR/issue opener. OS/Windows QA/test-plan-specified release-notes/include
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix bug where users behind multiple releases could get preview releases (Windows only)
6 participants