Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/savage.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Rebert <code@rebertia.com>2014-11-20 05:03:12 +0300
committerChris Rebert <code@rebertia.com>2014-11-20 05:03:12 +0300
commit31798f236577ed866945bbfe2e67decdecaf38e0 (patch)
treee47edd3e028277fadb249ba9c63725f406893f8e /src
parentd3630f3d0b7b45637e3061d4fdd51c1a994b3a15 (diff)
more logging when paths are rejected as unsafe
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/com/getbootstrap/savage/server/PullRequestEventHandler.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/scala/com/getbootstrap/savage/server/PullRequestEventHandler.scala b/src/main/scala/com/getbootstrap/savage/server/PullRequestEventHandler.scala
index 41f74ce..e3f1f7b 100644
--- a/src/main/scala/com/getbootstrap/savage/server/PullRequestEventHandler.scala
+++ b/src/main/scala/com/getbootstrap/savage/server/PullRequestEventHandler.scala
@@ -29,7 +29,14 @@ class PullRequestEventHandler(protected val pusher: ActorRef) extends GitHubActo
}
private def areSafe(paths: Set[Path]): Boolean = {
implicit val logger = log
- paths.forall{ path => isNormal(path) && settings.Whitelist.isAllowed(path) }
+ val unsafeOption = paths.find{ path => !isNormal(path) || !settings.Whitelist.isAllowed(path) }
+ unsafeOption match {
+ case None => true
+ case Some(unsafePath) => {
+ log.info(s"Unsafe path: ${unsafePath}")
+ false
+ }
+ }
}
private def areInteresting(paths: Set[Path]): Boolean = {
implicit val logger = log
@@ -63,6 +70,7 @@ class PullRequestEventHandler(protected val pusher: ActorRef) extends GitHubActo
log.error(exc, s"Could not get affected files for commits ${baseSha}...${headSha} for ${foreignRepo}")
}
case Success(affectedFiles) => {
+ log.debug("Filed affected by {}: {}", prNum, affectedFiles)
if (areSafe(affectedFiles)) {
if (areInteresting(affectedFiles)) {
logPrInfo(s"Requesting build for safe & interesting PR")