From 818a02edbd9f3ba503c5fee3b848e39e6d5e9baa Mon Sep 17 00:00:00 2001 From: Artur Petrov Date: Mon, 29 Sep 2014 03:27:03 +0400 Subject: [PATCH 1/4] Fix revision in channels' JSON Revision key in channels' JSON has been changed recently. Also, harden the respective url by using HTTPS. --- Classes/MGMController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/MGMController.m b/Classes/MGMController.m index 672a00f..f4167b9 100644 --- a/Classes/MGMController.m +++ b/Classes/MGMController.m @@ -41,13 +41,13 @@ NSString * const MGMCPChromium = @"Chromium.app"; NSString * const MGMChromiumZip = @"chrome-mac.zip"; NSString * const MGMTMPPath = @"/tmp"; -NSString * const MGMChannelsURL = @"http://omahaproxy.appspot.com/all.json?os=mac"; +NSString * const MGMChannelsURL = @"https://omahaproxy.appspot.com/all.json?os=mac"; static NSString *MGMSnapshotURL = @"https://commondatastorage.googleapis.com/chromium-browser-snapshots/"; NSString * const MGMSnapshotPrefix = @"Mac/"; NSString * const MGMSVNLogsURL = @"http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk/src&range=%@:%@&mode=html&os=mac"; NSString * const MGMCChannel = @"channel"; -NSString * const MGMCRevision = @"base_trunk_revision"; +NSString * const MGMCRevision = @"branch_base_position"; NSString * const MGMCStable = @"stable"; NSString * const MGMCBeta = @"beta"; NSString * const MGMCDev = @"dev"; From 2c27526ab566b4a8041062f2095f7e71a203104a Mon Sep 17 00:00:00 2001 From: Artur Petrov Date: Mon, 29 Sep 2014 03:45:37 +0400 Subject: [PATCH 2/4] Improve string casting of revision info values Some revision payloads contain git hashes in place of revision number for built-in components (webkit, v8). We should use universal -description instead of NSNumber's -stringValue. See revision #278870 for example. --- Classes/MGMController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/MGMController.m b/Classes/MGMController.m index f4167b9..ef9876c 100644 --- a/Classes/MGMController.m +++ b/Classes/MGMController.m @@ -382,12 +382,12 @@ NSString * const MGMUBCancel = @"Cancel"; } - (void)revisionDidFinish:(MGMURLBasicHandler *)theHandler { NSDictionary *revisionInfo = [[theHandler data] parseJSON]; - NSString *webkit = [[revisionInfo objectForKey:@"webkit_revision"] stringValue]; + NSString *webkit = [NSString stringWithFormat:@"%@", [revisionInfo objectForKey:@"webkit_revision"]]; if (webkit!=nil) [webKitBuildField setStringValue:webkit]; else [webKitBuildField setStringValue:@"0"]; - NSString *v8 = [[revisionInfo objectForKey:@"v8_revision"] stringValue]; + NSString *v8 = [NSString stringWithFormat:@"%@", [revisionInfo objectForKey:@"v8_revision"]]; if (v8!=nil) [v8BuildField setStringValue:v8]; else From dee1f483b3ce5401d5fcc4db5fb6b96c1eb54340 Mon Sep 17 00:00:00 2001 From: Artur Petrov Date: Mon, 29 Sep 2014 04:52:27 +0400 Subject: [PATCH 3/4] Enhance UX of revision downloading progress Revisions are already spread across almost 30 XML files 1000 builds each. Although it may take a considerable amount of time to download the list, the progress bar doesn't reflect this process. Because the downloading isn't deterministic, we try to update the progress after each received file. 0.02 rate should be OK for user and enough for around 2 years of Chromium builds before hitting bar's 90% limit. --- Classes/MGMController.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Classes/MGMController.m b/Classes/MGMController.m index ef9876c..b108f23 100644 --- a/Classes/MGMController.m +++ b/Classes/MGMController.m @@ -157,7 +157,7 @@ NSString * const MGMUBCancel = @"Cancel"; handler = [MGMURLBasicHandler handlerWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]] delegate:self]; [handler setFailWithError:@selector(revisions:didFailWithError:)]; [handler setFinish:@selector(revisionsFinished:)]; - [statusField setStringValue:@"Loading Revisions"]; + [statusField setStringValue:@"Loading revisions..."]; [connectionManager addHandler:handler]; } @@ -209,7 +209,7 @@ NSString * const MGMUBCancel = @"Cancel"; [progress setIndeterminate:NO]; [progress startAnimation:self]; - [progress setDoubleValue:0.25]; + [progress setDoubleValue:0.1]; } - (void)revisions:(MGMURLBasicHandler *)theHandler didFailWithError:(NSError *)theError { NSLog(@"%@", theError); @@ -235,8 +235,9 @@ NSString * const MGMUBCancel = @"Cancel"; - (void)revisionsFinished:(MGMURLBasicHandler *)theHandler { NSError *error = nil; NSXMLDocument *xml = [[NSXMLDocument alloc] initWithData:[theHandler data] options:NSXMLDocumentTidyXML error:&error]; - [progress setDoubleValue:0.50]; - + if ([progress doubleValue] < 0.9) { + [progress incrementBy:0.02]; + } if (error!=nil) { NSLog(@"%@", error); NSAlert *alert = [[NSAlert new] autorelease]; @@ -331,7 +332,7 @@ NSString * const MGMUBCancel = @"Cancel"; } [buildPopUp selectItemAtIndex:itemIndex]; if (startingUp) - [progress setDoubleValue:0.75]; + [progress setDoubleValue:0.9]; [self buildSelect:self]; } - (IBAction)buildSelect:(id)sender { @@ -561,7 +562,7 @@ NSString * const MGMUBCancel = @"Cancel"; [updateButton setEnabled:NO]; [progress setIndeterminate:YES]; [progress startAnimation:self]; - [statusField setStringValue:@"Uncompressing and installing update."]; + [statusField setStringValue:@"Uncompressing and installing update..."]; unzipTask = [NSTask new]; [unzipTask setLaunchPath:@"/usr/bin/ditto"]; From 1fafdd1018c07cc62771388296f409915f546795 Mon Sep 17 00:00:00 2001 From: Artur Petrov Date: Mon, 29 Sep 2014 05:28:31 +0400 Subject: [PATCH 4/4] Bump version --- Resources/Info.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Info.plist b/Resources/Info.plist index 47b75e9..9c06805 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.2.3 + 0.2.4 CFBundleSignature ???? CFBundleVersion - 0.2.3 + 0.2.4 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} MGMGRBugsEmail