Skip to content

Commit

Permalink
added Builda prefix to github status description
Browse files Browse the repository at this point in the history
  • Loading branch information
Honza Dvorsky committed Apr 12, 2015
1 parent ee8dda9 commit ff67237
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Buildasaur/HDGitHubXCBotSyncer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public class HDGitHubXCBotSyncer : Syncer {
//not enabled, make sure the PR reflects that and the instructions are clear
Log.verbose("Bot \(bot.name) is not yet enabled, ignoring...")

let status = Status(state: .Pending, description: "Waiting for \"lttm\" to start testing", targetUrl: nil, context: nil)
let status = self.createStatusFromState(.Pending, description: "Waiting for \"lttm\" to start testing")
let notYetEnabled = GitHubStatusAndComment(status: status, comment: nil)
self.updatePRStatusIfNecessary(notYetEnabled, prNumber: pr.number, completion: completion)
}
Expand Down Expand Up @@ -681,7 +681,14 @@ public class HDGitHubXCBotSyncer : Syncer {
private func createStatusFromState(state: Status.State, description: String?) -> Status {

//TODO: add useful targetUrl and potentially have multiple contexts to show multiple stats on the PR
return Status(state: state, description: description, targetUrl: nil, context: nil)
let context = "Buildasaur"
let newDescription: String?
if let description = description {
newDescription = "\(context): \(description)"
} else {
newDescription = nil
}
return Status(state: state, description: newDescription, targetUrl: nil, context: context)
}

//probably make these a bit more generic, something like an async reduce which calls completion when all finish
Expand Down

0 comments on commit ff67237

Please sign in to comment.