Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# xcode-github Change Log

## v1.1.1 - February 6, 2019
* Fixed a bug where the PR branch was not checked out: Instead the template bot branch was used.
## v1.1.1 - ???
* Adding another server in the preferences wasn't always persisted.
* If an Xcode server had no bots defined then no items appeared in the status window. Now items are always shown.
* The wrong git branch was used when a new PR bot was created from the template bot.

## v1.1.0 - January 29, 2019
* Fixed Xcode server login.
Expand Down
2 changes: 2 additions & 0 deletions xcode-github-app.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
/* Begin PBXFileReference section */
2BB6F4D221F9E3FF001E8693 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Base; path = Base.lproj/Credits.rtf; sourceTree = "<group>"; };
2BC31A1222041978003B0EE4 /* xcode-github-cli.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = "xcode-github-cli.md"; path = "Documentation/xcode-github-cli.md"; sourceTree = "<group>"; };
2BFD78962216A06E00E63692 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
4D0DD54420597FE6001721C1 /* xcode-github-app.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = "xcode-github-app.md"; path = "Documentation/xcode-github-app.md"; sourceTree = "<group>"; };
4D12BA0A20A252CE00E5B1DB /* XGALogViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XGALogViewController.h; sourceTree = "<group>"; };
4D12BA0B20A252CE00E5B1DB /* XGALogViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XGALogViewController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -114,6 +115,7 @@
4D76615F2057565200216B72 = {
isa = PBXGroup;
children = (
2BFD78962216A06E00E63692 /* CHANGELOG.md */,
4D0DD54420597FE6001721C1 /* xcode-github-app.md */,
2BC31A1222041978003B0EE4 /* xcode-github-cli.md */,
4DC9E5C4216DCD6700F1F4EE /* XcodeGitHub.xcodeproj */,
Expand Down
6 changes: 5 additions & 1 deletion xcode-github-app/XGAPreferencesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ - (IBAction)addServerAction:(id)sender {
- (IBAction)serverDoubleAction:(id)sender {
NSInteger idx = self.tableView.selectedRow;
if (idx >= 0 && idx < [self.serverDictionaryController.arrangedObjects count]) {
XGAServer*server = [self.serverDictionaryController.arrangedObjects objectAtIndex:idx];
NSDictionaryControllerKeyValuePair*pair =
[self.serverDictionaryController.arrangedObjects objectAtIndex:idx];
XGAServer*server = pair.value;
[self showServer:server];
}
}
Expand All @@ -79,6 +81,8 @@ - (void) showServer:(XGAServer*)server {
if (returnCode == NSModalResponseOK &&
result.server.length &&
self.settings.servers[result.server] == nil) {
self.settings.servers[result.server] = result;
[self.settings save];
NSDictionaryControllerKeyValuePair*pair = [self.serverDictionaryController newObject];
pair.key = result.server;
pair.value = result;
Expand Down
39 changes: 19 additions & 20 deletions xcode-github-app/XGAStatusViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -386,26 +386,30 @@ - (void) updateStatus {

BNCLogDebug(@"Start updateStatus.");
BNCPerformBlockOnMainThreadAsync(^{ self.statusTextField.stringValue = @""; });
/*
NSMutableDictionary<NSString*, XGServer*>*statusServers = [NSMutableDictionary new];
for (XGAServer*server in XGASettings.shared.servers.objectEnumerator) {
if (server.server.length > 0)
statusServers[server.server] = server;
}
*/

// Create new bots as needed:
NSArray<XGAGitHubSyncTask*>* syncTasks = XGASettings.shared.gitHubSyncTasks;
NSDictionary<NSString*, XGServer*>*statusServers = XGASettings.shared.servers;
for (XGAGitHubSyncTask*task in syncTasks) {
if (task.xcodeServer.length != 0 && statusServers[task.xcodeServer] != nil)
[self updateSyncBots:task];
}

// Update the status:
NSMutableArray *statusArray = [NSMutableArray new];
for (XGAServer*server in statusServers.objectEnumerator) {
[self updateXcodeServerStatus:server];
NSArray*a = [self updateXcodeServerStatus:server];
if (a) [statusArray addObjectsFromArray:a];
}
if (syncTasks.count == 0 && statusServers.count == 0) {
// Update with 'nil' to add content for an empty display:
[self updateXcodeServerStatus:nil];
if (statusArray.count == 0) {
XGAStatusViewItem *status = [XGAStatusViewItem new];
status.statusImage = [NSImage imageNamed:@"RoundBlue"];
status.statusSummary = [APFormattedString boldText:@"< No Xcode servers added yet >"];
[statusArray addObject:status];
}
BNCPerformBlockOnMainThreadAsync(^{
self.arrayController.content = statusArray;
});
BNCLogDebug(@"End updateStatus.");

self.lastUpdateDate = [NSDate date];
Expand Down Expand Up @@ -446,7 +450,7 @@ - (void) updateSyncBots:(XGAGitHubSyncTask*)syncTask {
}
}

- (void) updateXcodeServerStatus:(XGServer*)server {
- (NSArray*) updateXcodeServerStatus:(XGServer*)server {
NSError*error = nil;
NSMutableArray *statusArray = [NSMutableArray new];
if (server.server.length > 0) {
Expand All @@ -468,17 +472,12 @@ - (void) updateXcodeServerStatus:(XGServer*)server {
}
if (statusArray.count == 0) {
XGAStatusViewItem *status = [XGAStatusViewItem new];
status.server = server.server;
status.statusImage = [NSImage imageNamed:@"RoundBlue"];
if (server.server.length > 0) {
status.statusSummary = [APFormattedString boldText:@"< No Xcode bots found >"];
} else {
status.statusSummary = [APFormattedString boldText:@"< No Xcode servers added yet >"];
}
status.statusSummary = [APFormattedString boldText:@"< No Xcode bots found >"];
[statusArray addObject:status];
}
BNCPerformBlockOnMainThreadAsync(^{
self.arrayController.content = statusArray;
});
return statusArray;
}

@end