diff --git a/bot/src/dotty/tools/bot/Main.scala b/bot/src/dotty/tools/bot/Main.scala deleted file mode 100644 index f209d4547aef..000000000000 --- a/bot/src/dotty/tools/bot/Main.scala +++ /dev/null @@ -1,26 +0,0 @@ -package dotty.tools.bot - -import org.http4s.server.{ Server, ServerApp } -import org.http4s.server.blaze._ - -import scalaz.concurrent.Task - -object Main extends ServerApp with PullRequestService { - - val githubUser = sys.env("GITHUB_USER") - val githubToken = sys.env("GITHUB_TOKEN") - val githubClientId = sys.env("GITHUB_CLIENT_ID") - val githubClientSecret = sys.env("GITHUB_CLIENT_SECRET") - val droneToken = sys.env("DRONE_TOKEN") - val port = sys.env("PORT").toInt - - /** Services mounted to the server */ - final val services = prService - - override def server(args: List[String]): Task[Server] = { - BlazeBuilder - .bindHttp(port, "0.0.0.0") - .mountService(services, "/api") - .start - } -} diff --git a/bot/src/dotty/tools/bot/PullRequestService.scala b/bot/src/dotty/tools/bot/PullRequestService.scala deleted file mode 100644 index 7c4a45f9e7cb..000000000000 --- a/bot/src/dotty/tools/bot/PullRequestService.scala +++ /dev/null @@ -1,501 +0,0 @@ -package dotty.tools -package bot - -import org.http4s.{ Status => _, _ } -import org.http4s.client.blaze._ -import org.http4s.client.Client -import org.http4s.headers.{ Accept, Authorization } - -import cats.syntax.applicative._ -import scalaz.concurrent.Task -import scala.util.control.NonFatal -import scala.Function.tupled - -import io.circe._ -import io.circe.generic.auto._ -import io.circe.syntax._ -import org.http4s.circe._ -import org.http4s.dsl._ -import org.http4s.util._ - -import model.Github._ -import model.Drone -import bot.util.TaskIsApplicative._ -import bot.util.HttpClientAux._ - -trait PullRequestService { - - /** Username for authorized admin */ - def githubUser: String - - /** OAuth token needed for user to create statuses */ - def githubToken: String - - /** OAuth token for drone, needed to cancel builds */ - def droneToken: String - - /** OAuthed application's "client_id" */ - def githubClientId: String - - /** OAuthed application's "client_secret" */ - def githubClientSecret: String - - /** Pull Request HTTP service */ - val prService = HttpService { - case GET -> Root / "rate" => { - val client = PooledHttp1Client() - for { - rates <- client.expect(get(rateLimit))(EntityDecoder.text) - resp <- Ok(rates) - _ <- client.shutdown - } yield resp - } - - case request @ POST -> Root => - val githubEvent = - request.headers - .get(CaseInsensitiveString("X-GitHub-Event")) - .map(_.value).getOrElse("") - - githubEvent match { - case "pull_request" => - request.as(jsonOf[Issue]).flatMap(checkPullRequest) - - case "issue_comment" => - request.as(jsonOf[IssueComment]).flatMap(respondToComment) - - case "" => - BadRequest("Missing header: X-Github-Event") - - case event => - BadRequest(s"Unsupported event: $event") - - } - } - - private[this] val droneContext = "continuous-integration/drone/pr" - - private final case class CLASignature( - user: String, - signed: Boolean, - version: String, - currentVersion: String - ) - - private[this] val githubUrl = "https://api.github.com" - private[this] def withGithubSecret(url: String, extras: String*): String = - s"$url?client_id=$githubClientId&client_secret=$githubClientSecret" + extras.mkString("&", "&", "") - - def rateLimit: String = withGithubSecret("https://api.github.com/rate_limit") - - def claUrl(userName: String): String = - s"https://www.lightbend.com/contribute/cla/scala/check/$userName" - - def commitsUrl(prNumber: Int): String = - withGithubSecret(s"$githubUrl/repos/lampepfl/dotty/pulls/$prNumber/commits", "per_page=100") - - def statusUrl(sha: String): String = - withGithubSecret(s"$githubUrl/repos/lampepfl/dotty/statuses/$sha") - - def issueCommentsUrl(issueNbr: Int): String = - withGithubSecret(s"$githubUrl/repos/lampepfl/dotty/issues/$issueNbr/comments") - - def reviewUrl(issueNbr: Int): String = - withGithubSecret(s"$githubUrl/repos/lampepfl/dotty/pulls/$issueNbr/reviews") - - def contributorsUrl: String = - withGithubSecret("https://api.github.com/repos/lampepfl/dotty/contributors") - - sealed trait CommitStatus { - def commit: Commit - def isValid: Boolean - } - final case class Valid(user: Option[String], commit: Commit) extends CommitStatus { def isValid = true } - final case class Invalid(user: String, commit: Commit) extends CommitStatus { def isValid = false } - final case class CLAServiceDown(user: String, commit: Commit) extends CommitStatus { def isValid = false } - final case class MissingUser(commit: Commit) extends CommitStatus { def isValid = false } - final case class InvalidPrevious(users: List[String], commit: Commit) extends CommitStatus { def isValid = false } - - /** Partitions invalid and valid commits */ - def checkCLA(xs: List[Commit])(implicit client: Client): Task[List[CommitStatus]] = { - def checkUser(user: String): Task[Commit => CommitStatus] = { - val claStatus = for { - claRes <- client.expect(get(claUrl(user)))(jsonOf[CLASignature]) - } yield { (commit: Commit) => - if (claRes.signed) Valid(Some(user), commit) - else Invalid(user, commit) - } - - claStatus.handleWith { - case NonFatal(e) => - println(e) - Task.now((commit: Commit) => CLAServiceDown(user, commit)) - } - } - - def checkCommit(author: Author, commit: List[Commit]): Task[List[CommitStatus]] = - author.login.map(checkUser) - .getOrElse(Task.now(MissingUser)) - .map(f => commit.map(f)) - - Task.gatherUnordered { - val groupedByAuthor: Map[Author, List[Commit]] = xs.groupBy(_.author) - groupedByAuthor.map(tupled(checkCommit)).toList - }.map(_.flatten) - } - - def setStatus(cm: CommitStatus, httpClient: Client): Task[StatusResponse] = { - val desc = - if (cm.isValid) "User signed CLA" - else "User needs to sign cla: https://www.lightbend.com/contribute/cla/scala" - - val stat = cm match { - case Valid(Some(user), commit) => - Status("success", claUrl(user), desc) - case Valid(None, commit) => - Status("success", "", "All contributors signed CLA") - case Invalid(user, commit) => - Status("failure", claUrl(user), desc) - case MissingUser(commit) => - Status("failure", "", "Missing valid github user for this PR") - case CLAServiceDown(user, commit) => - Status("pending", claUrl(user), "CLA Service is down") - case InvalidPrevious(users, latestCommit) => - Status("failure", "", users.map("@" + _).mkString(", ") + " have not signed the CLA") - } - - for { - req <- post(statusUrl(cm.commit.sha)).withAuth(githubUser, githubToken) - res <- httpClient.expect(req.withBody(stat.asJson))(jsonOf[StatusResponse]) - } yield res - } - - def sendStatuses(xs: List[CommitStatus], httpClient: Client): Task[List[StatusResponse]] = - Task.gatherUnordered(xs.map(setStatus(_, httpClient))) - - private[this] val ExtractLink = """<([^>]+)>; rel="([^"]+)"""".r - def findNext(header: Option[Header]): Option[String] = header.flatMap { header => - val value = header.value - - value - .split(',') - .collect { - case ExtractLink(url, kind) if kind == "next" => - url - } - .headOption - } - - /** Get all contributors from GitHub */ - def getContributors(implicit client: Client): Task[Set[String]] = - for { - authors <- client.expect(get(contributorsUrl))(jsonOf[List[Author]]) - logins = authors.map(_.login).flatten - } yield logins.toSet - - /** Ordered from earliest to latest */ - def getCommits(issueNbr: Int)(implicit httpClient: Client): Task[List[Commit]] = { - def makeRequest(url: String): Task[List[Commit]] = - for { - res <- httpClient.fetch(get(url)) { res => - val link = CaseInsensitiveString("Link") - val next = findNext(res.headers.get(link)).map(makeRequest).getOrElse(Task.now(Nil)) - - res.as[List[Commit]](jsonOf[List[Commit]]).flatMap(commits => next.map(commits ++ _)) - } - } yield res - - makeRequest(commitsUrl(issueNbr)) - } - - def getComments(issueNbr: Int, httpClient: Client): Task[List[Comment]] = - httpClient.expect(get(issueCommentsUrl(issueNbr)))(jsonOf[List[Comment]]) - - private def usersFromInvalid(xs: List[CommitStatus]) = - xs.collect { case Invalid(user, _) => user } - - def hasBadCommitMessages(commits: List[Commit]): Boolean = - commits.exists { cm => - val firstLine = cm.commit.message.takeWhile(_ != '\n').trim.toLowerCase - val firstWord = firstLine.takeWhile(x => x != ':' && x != ' ') - val containsColon = firstLine.contains(':') - - val wrongTense = firstWord match { - case "added" | "fixed" | "removed" | "moved" | "changed" | - "finalized" | "re-added" - => true - - case "adds" | "fixes" | "removes" | "moves" | "changes" | - "finalizes" | "re-adds" - => true - - case _ - => false - } - - wrongTense || firstLine.last == '.' || firstLine.length > 80 - } - - /** Returns the body of a `ReviewResponse` */ - def sendInitialComment(issueNbr: Int, - invalidUsers: List[String], - commits: List[Commit], - newContributors: Boolean)(implicit client: Client): Task[String] = { - val cla = if (invalidUsers.nonEmpty) { - s"""|## CLA ## - |In order for us to be able to accept your contribution, all users - |must sign the Scala CLA. - | - |Users: - |${ invalidUsers.map("@" + _).mkString("- ", "\n- ", "") } - | - |Could you folks please sign the CLA? :pray: - | - |Please do this here: https://www.lightbend.com/contribute/cla/scala - |""".stripMargin - } else "All contributors have signed the CLA, thank you! :heart:" - - val commitRules = if (hasBadCommitMessages(commits)) { - """|## Commit Messages ## - |We want to keep history, but for that to actually be useful we have - |some rules on how to format our commit messages ([relevant xkcd](https://xkcd.com/1296/)). - | - |Please stick to these guidelines for commit messages: - | - |> 1. Separate subject from body with a blank line - |> 1. When fixing an issue, start your commit message with `Fix #: ` - |> 1. Limit the subject line to 72 characters - |> 1. Capitalize the subject line - |> 1. Do not end the subject line with a period - |> 1. Use the imperative mood in the subject line ("Add" instead of "Added") - |> 1. Wrap the body at 80 characters - |> 1. Use the body to explain what and why vs. how - |> - |> adapted from https://chris.beams.io/posts/git-commit""".stripMargin - } else "" - - val body = - s"""|Hello, and thank you for opening this PR! :tada: - | - |$cla - | - |$commitRules - | - |Have an awesome day! :sunny:""".stripMargin - - val review = Review.comment(body) - - val shouldPost = newContributors || commitRules.nonEmpty || invalidUsers.nonEmpty - - for { - req <- post(reviewUrl(issueNbr)).withAuth(githubUser, githubToken) - res <- { - if (shouldPost) - client.expect(req.withBody(review.asJson))(jsonOf[ReviewResponse]).map(_.body) - else - Task.now("") - } - } yield res - } - - def checkFreshPR(issue: Issue): Task[Response] = { - implicit val httpClient = PooledHttp1Client() - - for { - commits <- getCommits(issue.number) - statuses <- checkCLA(commits) - - (validStatuses, invalidStatuses) = statuses.partition(_.isValid) - invalidUsers = usersFromInvalid(invalidStatuses) - - // Mark the invalid commits: - _ <- sendStatuses(invalidStatuses, httpClient) - - // Set status of last to indicate previous failures or all good: - _ <- { - if (invalidStatuses.nonEmpty) - setStatus(InvalidPrevious(invalidUsers, commits.last), httpClient) - else - setStatus(statuses.last, httpClient) - } - - authors = commits.map(_.author.login).flatten.toSet - contribs <- getContributors - newContr = !authors.forall(contribs.contains) - _ <- sendInitialComment(issue.number, invalidUsers, commits, newContr) - _ <- httpClient.shutdown - resp <- Ok("Fresh PR checked") - } yield resp - - } - - def getStatus(commit: Commit, client: Client): Task[List[StatusResponse]] = - client.expect(get(statusUrl(commit.sha)))(jsonOf[List[StatusResponse]]) - - private def extractCommitSha(status: StatusResponse): Task[String] = - Task.delay(status.sha) - - def startBuild(commit: Commit)(implicit client: Client): Task[Drone.Build] = { - def pendingStatus(targetUrl: String): Status = - Status("pending", targetUrl, "build restarted by bot", droneContext) - - def filterStatuses(xs: List[StatusResponse]): Task[Int] = - xs.filter { status => - (status.state == "failure" || status.state == "success") && - status.context == droneContext - } - .map(status => Task.now(status.target_url.split('/').last.toInt)) - .headOption - .getOrElse(Task.fail(new NoSuchElementException("Couldn't find drone build for PR"))) - - for { - statuses <- getStatus(commit, client) - failed <- filterStatuses(statuses) - build <- Drone.startBuild(failed, droneToken) - setStatusReq <- post(statusUrl(commit.sha)).withAuth(githubUser, githubToken) - newStatus = pendingStatus(s"http://dotty-ci.epfl.ch/lampepfl/dotty/$failed").asJson - _ <- client.expect(setStatusReq.withBody(newStatus))(jsonOf[StatusResponse]) - } yield build - } - - def cancelBuilds(commits: List[Commit])(implicit client: Client): Task[Boolean] = - Task.gatherUnordered { - commits.map { commit => - for { - statuses <- getStatus(commit, client) - cancellable = statuses.filter(status => status.state == "pending" && status.context == droneContext) - runningJobs = cancellable.map(_.target_url.split('/').last.toInt) - cancelled <- Task.gatherUnordered(runningJobs.map(Drone.stopBuild(_, droneToken))) - } yield cancelled.forall(identity) - } - } - .map(_.forall(identity)) - - def checkSynchronize(issue: Issue): Task[Response] = { - implicit val client = PooledHttp1Client() - - def extractFailures(c: List[CommitStatus]): List[String] = c.collect { - case Invalid(user, _) => - s"@$user hasn't signed the CLA" - case MissingUser(commit) => - s"missing user for commit: ${commit.sha} - correct email associated with GitHub account?" - case CLAServiceDown(user, _) => - s"couldn't fetch status for: $user" - } - - for { - commits <- getCommits(issue.number) - statuses <- checkCLA(commits) - invalid = statuses.filterNot(_.isValid) - _ <- sendStatuses(invalid, client) - _ <- cancelBuilds(commits.dropRight(1)) - - // Set final commit status based on `invalid`: - _ <- { - if (invalid.nonEmpty) - setStatus(InvalidPrevious(usersFromInvalid(invalid), commits.last), client) - else - setStatus(statuses.last, client) - } - - // Send comment regarding recheck: - comment = - if (invalid.isEmpty) "All users have signed the CLA as far as I can tell! :tada:" - else s"There are still some issues:\n\n- ${extractFailures(invalid).mkString("\n- ")}" - - req <- post(issueCommentsUrl(issue.number)).withAuth(githubUser, githubToken) - _ <- client.fetch(req.withBody(comment.asJson))(Task.now) - - _ <- client.shutdown - resp <- Ok("Updated PR checked") - } yield resp - } - - def checkPullRequest(issue: Issue): Task[Response] = - issue.action match { - case Some("opened") => checkFreshPR(issue) - case Some("synchronize") => checkSynchronize(issue) - case Some(action) => BadRequest(s"Unhandled action: $action") - case None => BadRequest("Cannot check pull request, missing action field") - } - - def restartCI(issue: Issue): Task[Response] = { - implicit val client = PooledHttp1Client() - - def restartedComment: Comment = { - import scala.util.Random - val answers = Array( - "Okidokey, boss! :clap:", - "You got it, homie! :pray:", - "No problem, big shot! :punch:", - "Sure thing, I got your back! :heart:", - "No WAY! :-1: ...wait, don't fire me please! There, I did it! :tada:" - ) - - Comment(Author(None), answers(Random.nextInt(answers.length))) - } - - for { - commits <- getCommits(issue.number) - latest = commits.last - _ <- cancelBuilds(latest :: Nil) - _ <- startBuild(latest) - req <- post(issueCommentsUrl(issue.number)).withAuth(githubUser, githubToken) - _ <- client.fetch(req.withBody(restartedComment.asJson))(Task.now) - res <- Ok("Replied to request for CI restart") - } yield res - } - - def cannotUnderstand(line: String, issueComment: IssueComment): Task[Response] = { - implicit val client = PooledHttp1Client() - val comment = Comment(Author(None), { - s"""Hey, sorry - I could not understand what you meant by: - | - |> $line - | - |I'm just a dumb bot after all :cry: - | - |I mostly understand when your mention contains these words: - | - |- (re)check (the) cla - |- recheck - |- restart drone - | - |Maybe if you want to make me smarter, you could open a PR? :heart_eyes: - |""".stripMargin - }) - for { - req <- post(issueCommentsUrl(issueComment.issue.number)).withAuth(githubUser, githubToken) - _ <- client.fetch(req.withBody(comment.asJson))(Task.now) - res <- Ok("Delivered could not understand comment") - } yield res - } - - def extractMention(body: String): Option[String] = - body.lines.find(_.startsWith("@dotty-bot:")) - - /** Try to make sense of what the user is requesting from the bot - * - * The bot's abilities currently only include: - * - * - Checking or re-checking the CLA - * - Restarting the CI tests - * - * @note The implementation here could be quite elegant if we used a trie - * instead - */ - def interpretMention(line: String, issueComment: IssueComment): Task[Response] = { - val loweredLine = line.toLowerCase - if (loweredLine.contains("check cla") || loweredLine.contains("check the cla")) - checkSynchronize(issueComment.issue) - else if (loweredLine.contains("recheck") || loweredLine.contains("restart drone")) - restartCI(issueComment.issue) - else - cannotUnderstand(line, issueComment) - } - - def respondToComment(issueComment: IssueComment): Task[Response] = - extractMention(issueComment.comment.body) - .map(interpretMention(_, issueComment)) - .getOrElse(Ok("Nothing to do here, move along!")) -} diff --git a/bot/src/dotty/tools/bot/model/Drone.scala b/bot/src/dotty/tools/bot/model/Drone.scala deleted file mode 100644 index 710f18554333..000000000000 --- a/bot/src/dotty/tools/bot/model/Drone.scala +++ /dev/null @@ -1,49 +0,0 @@ -package dotty.tools -package bot -package model - -import io.circe._ -import io.circe.generic.auto._ -import io.circe.syntax._ - -import org.http4s._ -import org.http4s.circe._ -import org.http4s.client.Client - -import scalaz.concurrent.Task -import bot.util.HttpClientAux - -object Drone { - import HttpClientAux._ - - case class Build( - number: Int, - event: String, - status: String, - commit: String, - author: String - ) - - private[this] val baseUrl = "http://dotty-ci.epfl.ch/api" - - private def job(id: Int) = - s"$baseUrl/repos/lampepfl/dotty/builds/$id" - - private def job(id: Int, subId: Int) = - s"$baseUrl/repos/lampepfl/dotty/builds/$id/$subId" - - def stopBuild(id: Int, token: String)(implicit client: Client): Task[Boolean] = { - def resToBoolean(res: Response): Task[Boolean] = Task.now { - res.status.code >= 200 && res.status.code < 400 - } - - val responses = List(1, 2, 3, 4).map { subId => - client.fetch(delete(job(id, subId)).withOauth2(token))(resToBoolean) - } - - Task.gatherUnordered(responses).map(xs => xs.exists(_ == true)) - } - - def startBuild(id: Int, token: String)(implicit client: Client): Task[Build] = - client.expect(post(job(id)).withOauth2(token))(jsonOf[Build]) -} diff --git a/bot/src/dotty/tools/bot/model/Github.scala b/bot/src/dotty/tools/bot/model/Github.scala deleted file mode 100644 index b28e57f669bc..000000000000 --- a/bot/src/dotty/tools/bot/model/Github.scala +++ /dev/null @@ -1,57 +0,0 @@ -package dotty.tools.bot -package model - -object Github { - case class Issue( - action: Option[String], // "opened", "reopened", "closed", "synchronize" - number: Int, - pull_request: Option[PullRequest] - ) - - case class PullRequest(url: String, id: Option[Long], commits_url: Option[String]) - - case class CommitInfo(message: String) - - case class Commit( - sha: String, - author: Author, - committer: Author, - commit: CommitInfo - ) - - case class Author( - login: Option[String] - ) - - case class Status( - state: String, - target_url: String, - description: String, - context: String = "CLA" - ) - - case class StatusResponse( - url: String, - id: Long, - state: String, - context: String, - target_url: String - ) { - def sha: String = url.split('/').last - } - - /** A PR review */ - case class Review(body: String, event: String) - - object Review { - def approve(body: String) = Review(body, "APPROVE") - def requestChanges(body: String) = Review(body, "REQUEST_CHANGES") - def comment(body: String) = Review(body, "COMMENT") - } - - case class ReviewResponse(body: String, state: String, id: Long) - - case class IssueComment(action: String, issue: Issue, comment: Comment) - - case class Comment(user: Author, body: String) -} diff --git a/bot/src/dotty/tools/bot/util/HttpClientAux.scala b/bot/src/dotty/tools/bot/util/HttpClientAux.scala deleted file mode 100644 index d5fbe363dc14..000000000000 --- a/bot/src/dotty/tools/bot/util/HttpClientAux.scala +++ /dev/null @@ -1,35 +0,0 @@ -package dotty.tools.bot.util - -import org.http4s._ -import scalaz.concurrent.Task -import org.http4s.headers.{ Accept, Authorization } - -object HttpClientAux { - def uriFromString(url: String): Task[Uri] = - Uri.fromString(url).fold(Task.fail, Task.now) - - implicit class RicherTask(val task: Task[Request]) extends AnyVal { - def withOauth2(token: String): Task[Request] = - task.map(_.putHeaders(new Authorization(new OAuth2BearerToken(token)))) - - def withAuth(user: String, pass: String): Task[Request] = - task.map(_.putHeaders(new Authorization(BasicCredentials(user, pass)))) - } - - private[this] lazy val previewAcceptHeader = - Accept.parse("application/vnd.github.black-cat-preview+json") - .getOrElse(throw new Exception("Couldn't initialize accept header")) - - @inline private def request(method: Method, endpoint: Uri): Request = - Request(uri = endpoint, method = method) - .putHeaders(previewAcceptHeader) - - def get(endpoint: String): Task[Request] = - uriFromString(endpoint).map(request(Method.GET, _)) - - def post(endpoint: String): Task[Request] = - uriFromString(endpoint).map(request(Method.POST, _)) - - def delete(endpoint: String): Task[Request] = - uriFromString(endpoint).map(request(Method.DELETE, _)) -} diff --git a/bot/src/dotty/tools/bot/util/TaskIsApplicative.scala b/bot/src/dotty/tools/bot/util/TaskIsApplicative.scala deleted file mode 100644 index c97b1ac5f456..000000000000 --- a/bot/src/dotty/tools/bot/util/TaskIsApplicative.scala +++ /dev/null @@ -1,13 +0,0 @@ -package dotty.tools.bot -package util - -import cats.syntax.applicative._ -import scalaz.concurrent.Task - -object TaskIsApplicative { - implicit val taskIsApplicative = new cats.Applicative[Task] { - def pure[A](x: A): Task[A] = Task.now(x) - def ap[A, B](ff: Task[A => B])(fa: Task[A]): Task[B] = - for(f <- ff; a <- fa) yield f(a) - } -} diff --git a/bot/test/PRServiceTests.scala b/bot/test/PRServiceTests.scala deleted file mode 100644 index 29f08dddf1cd..000000000000 --- a/bot/test/PRServiceTests.scala +++ /dev/null @@ -1,168 +0,0 @@ -package dotty.tools.bot - -import org.junit.Assert._ -import org.junit.Test - -import io.circe._ -import io.circe.generic.auto._ -import io.circe.syntax._ -import io.circe.parser.decode - -import model.Github._ -import model.Drone -import org.http4s.client.blaze._ -import org.http4s.client.Client -import scalaz.concurrent.Task - -class PRServiceTests extends PullRequestService { - val githubUser = sys.env("GITHUB_USER") - val githubToken = sys.env("GITHUB_TOKEN") - val droneToken = sys.env("DRONE_TOKEN") - val githubClientId = sys.env("GITHUB_CLIENT_ID") - val githubClientSecret = sys.env("GITHUB_CLIENT_SECRET") - - private def withClient[A](f: Client => Task[A]): A = { - val httpClient = PooledHttp1Client() - val ret = f(httpClient).run - httpClient.shutdownNow() - ret - } - - def getResource(r: String): String = - Option(getClass.getResourceAsStream(r)).map(scala.io.Source.fromInputStream) - .map(_.mkString) - .getOrElse(throw new Exception(s"resource not found: $r")) - - @Test def canUnmarshalIssueJson = { - val json = getResource("/test-pr.json") - val issue: Issue = decode[Issue](json) match { - case Right(is: Issue) => is - case Left(ex) => throw ex - } - - assert(issue.pull_request.isDefined, "missing pull request") - } - - @Test def canUnmarshalIssueComment = { - val json = getResource("/test-mention.json") - val issueComment: IssueComment = decode[IssueComment](json) match { - case Right(is: IssueComment) => is - case Left(ex) => throw ex - } - - assert( - issueComment.comment.body == "@dotty-bot: could you recheck this please?", - s"incorrect body: ${issueComment.comment.body}" - ) - } - - @Test def canGetAllCommitsFromPR = { - val issueNbr = 1941 // has 2 commits: https://github.com/lampepfl/dotty/pull/1941/commits - val List(c1, c2) = withClient(implicit client => getCommits(issueNbr)) - - assertEquals( - "Represent untyped operators as Ident instead of Name", - c1.commit.message.takeWhile(_ != '\n') - ) - - assertEquals( - "Better positions for infix term operations.", - c2.commit.message.takeWhile(_ != '\n') - ) - } - - @Test def canGetMoreThan100Commits = { - val issueNbr = 1840 // has >100 commits: https://github.com/lampepfl/dotty/pull/1840/commits - val numberOfCommits = withClient(implicit client => getCommits(issueNbr)).length - - assert( - numberOfCommits > 100, - s"PR 1840, should have a number of commits greater than 100, but was: $numberOfCommits" - ) - } - - @Test def canGetComments = { - val comments: List[Comment] = withClient(getComments(2136, _)) - - assert(comments.find(_.user.login == Some("odersky")).isDefined, - "Could not find Martin's comment on PR 2136") - } - - @Test def canCheckCLA = { - val validUserCommit = Commit("sha-here", Author(Some("felixmulder")), Author(Some("felixmulder")), CommitInfo("")) - val statuses: List[CommitStatus] = withClient(checkCLA(validUserCommit :: Nil, _)) - - assert(statuses.length == 1, s"wrong number of valid statuses: got ${statuses.length}, expected 1") - } - - @Test def canSetStatus = { - val sha = "fa64b4b613fe5e78a5b4185b4aeda89e2f1446ff" - val status = Invalid("smarter", Commit(sha, Author(Some("smarter")), Author(Some("smarter")), CommitInfo(""))) - - val statuses: List[StatusResponse] = withClient(sendStatuses(status :: Nil, _)) - - assert( - statuses.length == 1, - s"assumed one status response would be returned, got: ${statuses.length}" - ) - - assert( - statuses.head.state == "failure", - s"status set had wrong state, expected 'failure', got: ${statuses.head.state}" - ) - } - - @Test def canGetStatus = { - val sha = "fa64b4b613fe5e78a5b4185b4aeda89e2f1446ff" - val commit = Commit(sha, Author(None), Author(None), CommitInfo("")) - val status = withClient(getStatus(commit, _)).head - - assert(status.sha == sha, "someting wong") - } - - @Test def canPostReview = { - val invalidUsers = "felixmulder" :: "smarter" :: Nil - val commit = Commit("", Author(Some("smarter")), Author(Some("smarter")), CommitInfo("Added stuff")) - val resBody = - withClient(sendInitialComment(2281, invalidUsers, commit :: Nil, false)(_)) - - assert( - resBody.contains("We want to keep history") && - resBody.contains("Could you folks please sign the CLA?") && - resBody.contains("Have an awesome day!"), - s"Body of review was not as expected:\n${resBody}" - ) - } - - @Test def canStartAndStopBuild = { - val build = withClient(implicit client => Drone.startBuild(1921, droneToken)) - assert(build.status == "pending" || build.status == "building") - val killed = withClient(implicit client => Drone.stopBuild(1921, droneToken)) - assert(killed, "Couldn't kill build") - } - - @Test def canUnderstandWhenToRestartBuild = { - val json = getResource("/test-mention.json") - val issueComment: IssueComment = decode[IssueComment](json) match { - case Right(is: IssueComment) => is - case Left(ex) => throw ex - } - - assert(respondToComment(issueComment).run.status.code == 200) - } - - @Test def canTellUserWhenNotUnderstanding = { - val json = getResource("/test-mention-no-understandy.json") - val issueComment: IssueComment = decode[IssueComment](json) match { - case Right(is: IssueComment) => is - case Left(ex) => throw ex - } - - assert(respondToComment(issueComment).run.status.code == 200) - } - - @Test def canGetContributors = { - val contributors = withClient(getContributors(_)) - assert(contributors.contains("felixmulder")) - } -} diff --git a/bot/test/resources/test-mention-no-understandy.json b/bot/test/resources/test-mention-no-understandy.json deleted file mode 100644 index 0b17d83de34e..000000000000 --- a/bot/test/resources/test-mention-no-understandy.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "action": "created", - "issue": { - "url": "https://api.github.com/repos/lampepfl/dotty/issues/2304", - "repository_url": "https://api.github.com/repos/lampepfl/dotty", - "labels_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304/labels{/name}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304/comments", - "events_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304/events", - "html_url": "https://github.com/lampepfl/dotty/pull/2304", - "id": 224071012, - "number": 2304, - "title": "Bot improvements - CLA checks, killing old jobs, nagging about form", - "user": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars2.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - }, - "labels": [ - - ], - "state": "open", - "locked": false, - "assignee": null, - "assignees": [ - - ], - "milestone": null, - "comments": 0, - "created_at": "2017-04-25T09:10:15Z", - "updated_at": "2017-04-25T11:34:20Z", - "closed_at": null, - "pull_request": { - "url": "https://api.github.com/repos/lampepfl/dotty/pulls/2304", - "html_url": "https://github.com/lampepfl/dotty/pull/2304", - "diff_url": "https://github.com/lampepfl/dotty/pull/2304.diff", - "patch_url": "https://github.com/lampepfl/dotty/pull/2304.patch" - }, - "body": "Bot improvements include:\r\n\r\n- Deleting old jobs from PR, only keep the latest drone build\r\n- Check CLA and only approve last commit\r\n- Add some greetings to opened PRs helping people on where to sign CLA etc" - }, - "comment": { - "url": "https://api.github.com/repos/lampepfl/dotty/issues/comments/297001946", - "html_url": "https://github.com/lampepfl/dotty/pull/2304#issuecomment-297001946", - "issue_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304", - "id": 297001946, - "user": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars2.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2017-04-25T11:34:20Z", - "updated_at": "2017-04-25T11:34:20Z", - "body": "@dotty-bot: I don't like you." - }, - "repository": { - "id": 7035651, - "name": "dotty", - "full_name": "lampepfl/dotty", - "owner": { - "login": "lampepfl", - "id": 2684793, - "avatar_url": "https://avatars2.githubusercontent.com/u/2684793?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/lampepfl", - "html_url": "https://github.com/lampepfl", - "followers_url": "https://api.github.com/users/lampepfl/followers", - "following_url": "https://api.github.com/users/lampepfl/following{/other_user}", - "gists_url": "https://api.github.com/users/lampepfl/gists{/gist_id}", - "starred_url": "https://api.github.com/users/lampepfl/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/lampepfl/subscriptions", - "organizations_url": "https://api.github.com/users/lampepfl/orgs", - "repos_url": "https://api.github.com/users/lampepfl/repos", - "events_url": "https://api.github.com/users/lampepfl/events{/privacy}", - "received_events_url": "https://api.github.com/users/lampepfl/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/lampepfl/dotty", - "description": "Research platform for new language concepts and compiler technologies for Scala.", - "fork": false, - "url": "https://api.github.com/repos/lampepfl/dotty", - "forks_url": "https://api.github.com/repos/lampepfl/dotty/forks", - "keys_url": "https://api.github.com/repos/lampepfl/dotty/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/lampepfl/dotty/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/lampepfl/dotty/teams", - "hooks_url": "https://api.github.com/repos/lampepfl/dotty/hooks", - "issue_events_url": "https://api.github.com/repos/lampepfl/dotty/issues/events{/number}", - "events_url": "https://api.github.com/repos/lampepfl/dotty/events", - "assignees_url": "https://api.github.com/repos/lampepfl/dotty/assignees{/user}", - "branches_url": "https://api.github.com/repos/lampepfl/dotty/branches{/branch}", - "tags_url": "https://api.github.com/repos/lampepfl/dotty/tags", - "blobs_url": "https://api.github.com/repos/lampepfl/dotty/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/lampepfl/dotty/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/lampepfl/dotty/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/lampepfl/dotty/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/lampepfl/dotty/statuses/{sha}", - "languages_url": "https://api.github.com/repos/lampepfl/dotty/languages", - "stargazers_url": "https://api.github.com/repos/lampepfl/dotty/stargazers", - "contributors_url": "https://api.github.com/repos/lampepfl/dotty/contributors", - "subscribers_url": "https://api.github.com/repos/lampepfl/dotty/subscribers", - "subscription_url": "https://api.github.com/repos/lampepfl/dotty/subscription", - "commits_url": "https://api.github.com/repos/lampepfl/dotty/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/lampepfl/dotty/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/lampepfl/dotty/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/lampepfl/dotty/contents/{+path}", - "compare_url": "https://api.github.com/repos/lampepfl/dotty/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/lampepfl/dotty/merges", - "archive_url": "https://api.github.com/repos/lampepfl/dotty/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/lampepfl/dotty/downloads", - "issues_url": "https://api.github.com/repos/lampepfl/dotty/issues{/number}", - "pulls_url": "https://api.github.com/repos/lampepfl/dotty/pulls{/number}", - "milestones_url": "https://api.github.com/repos/lampepfl/dotty/milestones{/number}", - "notifications_url": "https://api.github.com/repos/lampepfl/dotty/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/lampepfl/dotty/labels{/name}", - "releases_url": "https://api.github.com/repos/lampepfl/dotty/releases{/id}", - "deployments_url": "https://api.github.com/repos/lampepfl/dotty/deployments", - "created_at": "2012-12-06T12:57:33Z", - "updated_at": "2017-04-23T22:50:39Z", - "pushed_at": "2017-04-25T11:28:03Z", - "git_url": "git://github.com/lampepfl/dotty.git", - "ssh_url": "git@github.com:lampepfl/dotty.git", - "clone_url": "https://github.com/lampepfl/dotty.git", - "svn_url": "https://github.com/lampepfl/dotty", - "homepage": "http://dotty.epfl.ch", - "size": 38144, - "stargazers_count": 1567, - "watchers_count": 1567, - "language": "Scala", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": false, - "has_pages": true, - "forks_count": 233, - "mirror_url": null, - "open_issues_count": 309, - "forks": 233, - "open_issues": 309, - "watchers": 1567, - "default_branch": "master" - }, - "organization": { - "login": "lampepfl", - "id": 2684793, - "url": "https://api.github.com/orgs/lampepfl", - "repos_url": "https://api.github.com/orgs/lampepfl/repos", - "events_url": "https://api.github.com/orgs/lampepfl/events", - "hooks_url": "https://api.github.com/orgs/lampepfl/hooks", - "issues_url": "https://api.github.com/orgs/lampepfl/issues", - "members_url": "https://api.github.com/orgs/lampepfl/members{/member}", - "public_members_url": "https://api.github.com/orgs/lampepfl/public_members{/member}", - "avatar_url": "https://avatars2.githubusercontent.com/u/2684793?v=3", - "description": null - }, - "sender": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars2.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/bot/test/resources/test-mention.json b/bot/test/resources/test-mention.json deleted file mode 100644 index d888e82c7234..000000000000 --- a/bot/test/resources/test-mention.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "action": "created", - "issue": { - "url": "https://api.github.com/repos/lampepfl/dotty/issues/2304", - "repository_url": "https://api.github.com/repos/lampepfl/dotty", - "labels_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304/labels{/name}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304/comments", - "events_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304/events", - "html_url": "https://github.com/lampepfl/dotty/pull/2304", - "id": 224071012, - "number": 2304, - "title": "Bot improvements - CLA checks, killing old jobs, nagging about form", - "user": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars2.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - }, - "labels": [ - - ], - "state": "open", - "locked": false, - "assignee": null, - "assignees": [ - - ], - "milestone": null, - "comments": 0, - "created_at": "2017-04-25T09:10:15Z", - "updated_at": "2017-04-25T11:34:20Z", - "closed_at": null, - "pull_request": { - "url": "https://api.github.com/repos/lampepfl/dotty/pulls/2304", - "html_url": "https://github.com/lampepfl/dotty/pull/2304", - "diff_url": "https://github.com/lampepfl/dotty/pull/2304.diff", - "patch_url": "https://github.com/lampepfl/dotty/pull/2304.patch" - }, - "body": "Bot improvements include:\r\n\r\n- Deleting old jobs from PR, only keep the latest drone build\r\n- Check CLA and only approve last commit\r\n- Add some greetings to opened PRs helping people on where to sign CLA etc" - }, - "comment": { - "url": "https://api.github.com/repos/lampepfl/dotty/issues/comments/297001946", - "html_url": "https://github.com/lampepfl/dotty/pull/2304#issuecomment-297001946", - "issue_url": "https://api.github.com/repos/lampepfl/dotty/issues/2304", - "id": 297001946, - "user": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars2.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - }, - "created_at": "2017-04-25T11:34:20Z", - "updated_at": "2017-04-25T11:34:20Z", - "body": "@dotty-bot: could you recheck this please?" - }, - "repository": { - "id": 7035651, - "name": "dotty", - "full_name": "lampepfl/dotty", - "owner": { - "login": "lampepfl", - "id": 2684793, - "avatar_url": "https://avatars2.githubusercontent.com/u/2684793?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/lampepfl", - "html_url": "https://github.com/lampepfl", - "followers_url": "https://api.github.com/users/lampepfl/followers", - "following_url": "https://api.github.com/users/lampepfl/following{/other_user}", - "gists_url": "https://api.github.com/users/lampepfl/gists{/gist_id}", - "starred_url": "https://api.github.com/users/lampepfl/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/lampepfl/subscriptions", - "organizations_url": "https://api.github.com/users/lampepfl/orgs", - "repos_url": "https://api.github.com/users/lampepfl/repos", - "events_url": "https://api.github.com/users/lampepfl/events{/privacy}", - "received_events_url": "https://api.github.com/users/lampepfl/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/lampepfl/dotty", - "description": "Research platform for new language concepts and compiler technologies for Scala.", - "fork": false, - "url": "https://api.github.com/repos/lampepfl/dotty", - "forks_url": "https://api.github.com/repos/lampepfl/dotty/forks", - "keys_url": "https://api.github.com/repos/lampepfl/dotty/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/lampepfl/dotty/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/lampepfl/dotty/teams", - "hooks_url": "https://api.github.com/repos/lampepfl/dotty/hooks", - "issue_events_url": "https://api.github.com/repos/lampepfl/dotty/issues/events{/number}", - "events_url": "https://api.github.com/repos/lampepfl/dotty/events", - "assignees_url": "https://api.github.com/repos/lampepfl/dotty/assignees{/user}", - "branches_url": "https://api.github.com/repos/lampepfl/dotty/branches{/branch}", - "tags_url": "https://api.github.com/repos/lampepfl/dotty/tags", - "blobs_url": "https://api.github.com/repos/lampepfl/dotty/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/lampepfl/dotty/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/lampepfl/dotty/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/lampepfl/dotty/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/lampepfl/dotty/statuses/{sha}", - "languages_url": "https://api.github.com/repos/lampepfl/dotty/languages", - "stargazers_url": "https://api.github.com/repos/lampepfl/dotty/stargazers", - "contributors_url": "https://api.github.com/repos/lampepfl/dotty/contributors", - "subscribers_url": "https://api.github.com/repos/lampepfl/dotty/subscribers", - "subscription_url": "https://api.github.com/repos/lampepfl/dotty/subscription", - "commits_url": "https://api.github.com/repos/lampepfl/dotty/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/lampepfl/dotty/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/lampepfl/dotty/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/lampepfl/dotty/contents/{+path}", - "compare_url": "https://api.github.com/repos/lampepfl/dotty/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/lampepfl/dotty/merges", - "archive_url": "https://api.github.com/repos/lampepfl/dotty/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/lampepfl/dotty/downloads", - "issues_url": "https://api.github.com/repos/lampepfl/dotty/issues{/number}", - "pulls_url": "https://api.github.com/repos/lampepfl/dotty/pulls{/number}", - "milestones_url": "https://api.github.com/repos/lampepfl/dotty/milestones{/number}", - "notifications_url": "https://api.github.com/repos/lampepfl/dotty/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/lampepfl/dotty/labels{/name}", - "releases_url": "https://api.github.com/repos/lampepfl/dotty/releases{/id}", - "deployments_url": "https://api.github.com/repos/lampepfl/dotty/deployments", - "created_at": "2012-12-06T12:57:33Z", - "updated_at": "2017-04-23T22:50:39Z", - "pushed_at": "2017-04-25T11:28:03Z", - "git_url": "git://github.com/lampepfl/dotty.git", - "ssh_url": "git@github.com:lampepfl/dotty.git", - "clone_url": "https://github.com/lampepfl/dotty.git", - "svn_url": "https://github.com/lampepfl/dotty", - "homepage": "http://dotty.epfl.ch", - "size": 38144, - "stargazers_count": 1567, - "watchers_count": 1567, - "language": "Scala", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": false, - "has_pages": true, - "forks_count": 233, - "mirror_url": null, - "open_issues_count": 309, - "forks": 233, - "open_issues": 309, - "watchers": 1567, - "default_branch": "master" - }, - "organization": { - "login": "lampepfl", - "id": 2684793, - "url": "https://api.github.com/orgs/lampepfl", - "repos_url": "https://api.github.com/orgs/lampepfl/repos", - "events_url": "https://api.github.com/orgs/lampepfl/events", - "hooks_url": "https://api.github.com/orgs/lampepfl/hooks", - "issues_url": "https://api.github.com/orgs/lampepfl/issues", - "members_url": "https://api.github.com/orgs/lampepfl/members{/member}", - "public_members_url": "https://api.github.com/orgs/lampepfl/public_members{/member}", - "avatar_url": "https://avatars2.githubusercontent.com/u/2684793?v=3", - "description": null - }, - "sender": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars2.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - } -} \ No newline at end of file diff --git a/bot/test/resources/test-pr.json b/bot/test/resources/test-pr.json deleted file mode 100644 index 599215f8c9a6..000000000000 --- a/bot/test/resources/test-pr.json +++ /dev/null @@ -1,437 +0,0 @@ -{ - "action": "synchronize", - "number": 1958, - "pull_request": { - "url": "https://api.github.com/repos/lampepfl/dotty/pulls/1958", - "id": 105198014, - "html_url": "https://github.com/lampepfl/dotty/pull/1958", - "diff_url": "https://github.com/lampepfl/dotty/pull/1958.diff", - "patch_url": "https://github.com/lampepfl/dotty/pull/1958.patch", - "issue_url": "https://api.github.com/repos/lampepfl/dotty/issues/1958", - "number": 1958, - "state": "open", - "locked": false, - "title": "WIP Add \"enum\" construct", - "user": { - "login": "odersky", - "id": 795990, - "avatar_url": "https://avatars.githubusercontent.com/u/795990?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/odersky", - "html_url": "https://github.com/odersky", - "followers_url": "https://api.github.com/users/odersky/followers", - "following_url": "https://api.github.com/users/odersky/following{/other_user}", - "gists_url": "https://api.github.com/users/odersky/gists{/gist_id}", - "starred_url": "https://api.github.com/users/odersky/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/odersky/subscriptions", - "organizations_url": "https://api.github.com/users/odersky/orgs", - "repos_url": "https://api.github.com/users/odersky/repos", - "events_url": "https://api.github.com/users/odersky/events{/privacy}", - "received_events_url": "https://api.github.com/users/odersky/received_events", - "type": "User", - "site_admin": false - }, - "body": "This is a prototype implementation to add an \"enum\" construct to Scala. Scala enums give a more concise notation for \r\n\r\n - enums as in Java\r\n - ADTs\r\n - GADTs\r\n\r\nCurrent status\r\n\r\n - [x] First implementation\r\n - [x] Some test cases\r\n - [ ] A specification\r\n - [ ] An implementation of generic programming in the style of SYB. We need to clarify first exactly\r\n what we want from the compiler\r\n - [ ] A decision whether we want to go ahead with this", - "created_at": "2017-02-08T11:29:18Z", - "updated_at": "2017-02-09T09:18:27Z", - "closed_at": null, - "merged_at": null, - "merge_commit_sha": "7100d31c76a0317b8cd3445970c463b133215252", - "assignee": null, - "assignees": [ - - ], - "milestone": null, - "commits_url": "https://api.github.com/repos/lampepfl/dotty/pulls/1958/commits", - "review_comments_url": "https://api.github.com/repos/lampepfl/dotty/pulls/1958/comments", - "review_comment_url": "https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/issues/1958/comments", - "statuses_url": "https://api.github.com/repos/lampepfl/dotty/statuses/ce4051743d590721dc969c92c44a35147e1e3abc", - "head": { - "label": "dotty-staging:add-enum", - "ref": "add-enum", - "sha": "ce4051743d590721dc969c92c44a35147e1e3abc", - "user": { - "login": "dotty-staging", - "id": 6998674, - "avatar_url": "https://avatars.githubusercontent.com/u/6998674?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/dotty-staging", - "html_url": "https://github.com/dotty-staging", - "followers_url": "https://api.github.com/users/dotty-staging/followers", - "following_url": "https://api.github.com/users/dotty-staging/following{/other_user}", - "gists_url": "https://api.github.com/users/dotty-staging/gists{/gist_id}", - "starred_url": "https://api.github.com/users/dotty-staging/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/dotty-staging/subscriptions", - "organizations_url": "https://api.github.com/users/dotty-staging/orgs", - "repos_url": "https://api.github.com/users/dotty-staging/repos", - "events_url": "https://api.github.com/users/dotty-staging/events{/privacy}", - "received_events_url": "https://api.github.com/users/dotty-staging/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 17904384, - "name": "dotty", - "full_name": "dotty-staging/dotty", - "owner": { - "login": "dotty-staging", - "id": 6998674, - "avatar_url": "https://avatars.githubusercontent.com/u/6998674?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/dotty-staging", - "html_url": "https://github.com/dotty-staging", - "followers_url": "https://api.github.com/users/dotty-staging/followers", - "following_url": "https://api.github.com/users/dotty-staging/following{/other_user}", - "gists_url": "https://api.github.com/users/dotty-staging/gists{/gist_id}", - "starred_url": "https://api.github.com/users/dotty-staging/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/dotty-staging/subscriptions", - "organizations_url": "https://api.github.com/users/dotty-staging/orgs", - "repos_url": "https://api.github.com/users/dotty-staging/repos", - "events_url": "https://api.github.com/users/dotty-staging/events{/privacy}", - "received_events_url": "https://api.github.com/users/dotty-staging/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/dotty-staging/dotty", - "description": "Research platform for new language concepts and compiler technologies for Scala.", - "fork": true, - "url": "https://api.github.com/repos/dotty-staging/dotty", - "forks_url": "https://api.github.com/repos/dotty-staging/dotty/forks", - "keys_url": "https://api.github.com/repos/dotty-staging/dotty/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/dotty-staging/dotty/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/dotty-staging/dotty/teams", - "hooks_url": "https://api.github.com/repos/dotty-staging/dotty/hooks", - "issue_events_url": "https://api.github.com/repos/dotty-staging/dotty/issues/events{/number}", - "events_url": "https://api.github.com/repos/dotty-staging/dotty/events", - "assignees_url": "https://api.github.com/repos/dotty-staging/dotty/assignees{/user}", - "branches_url": "https://api.github.com/repos/dotty-staging/dotty/branches{/branch}", - "tags_url": "https://api.github.com/repos/dotty-staging/dotty/tags", - "blobs_url": "https://api.github.com/repos/dotty-staging/dotty/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/dotty-staging/dotty/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/dotty-staging/dotty/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/dotty-staging/dotty/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/dotty-staging/dotty/statuses/{sha}", - "languages_url": "https://api.github.com/repos/dotty-staging/dotty/languages", - "stargazers_url": "https://api.github.com/repos/dotty-staging/dotty/stargazers", - "contributors_url": "https://api.github.com/repos/dotty-staging/dotty/contributors", - "subscribers_url": "https://api.github.com/repos/dotty-staging/dotty/subscribers", - "subscription_url": "https://api.github.com/repos/dotty-staging/dotty/subscription", - "commits_url": "https://api.github.com/repos/dotty-staging/dotty/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/dotty-staging/dotty/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/dotty-staging/dotty/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/dotty-staging/dotty/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/dotty-staging/dotty/contents/{+path}", - "compare_url": "https://api.github.com/repos/dotty-staging/dotty/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/dotty-staging/dotty/merges", - "archive_url": "https://api.github.com/repos/dotty-staging/dotty/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/dotty-staging/dotty/downloads", - "issues_url": "https://api.github.com/repos/dotty-staging/dotty/issues{/number}", - "pulls_url": "https://api.github.com/repos/dotty-staging/dotty/pulls{/number}", - "milestones_url": "https://api.github.com/repos/dotty-staging/dotty/milestones{/number}", - "notifications_url": "https://api.github.com/repos/dotty-staging/dotty/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/dotty-staging/dotty/labels{/name}", - "releases_url": "https://api.github.com/repos/dotty-staging/dotty/releases{/id}", - "deployments_url": "https://api.github.com/repos/dotty-staging/dotty/deployments", - "created_at": "2014-03-19T13:06:15Z", - "updated_at": "2016-07-11T14:41:18Z", - "pushed_at": "2017-02-09T09:18:27Z", - "git_url": "git://github.com/dotty-staging/dotty.git", - "ssh_url": "git@github.com:dotty-staging/dotty.git", - "clone_url": "https://github.com/dotty-staging/dotty.git", - "svn_url": "https://github.com/dotty-staging/dotty", - "homepage": "", - "size": 27676, - "stargazers_count": 4, - "watchers_count": 4, - "language": "Scala", - "has_issues": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "open_issues_count": 0, - "forks": 0, - "open_issues": 0, - "watchers": 4, - "default_branch": "master" - } - }, - "base": { - "label": "lampepfl:master", - "ref": "master", - "sha": "75bea8dccce2bc3c0e8298ee71061c9871fd26ac", - "user": { - "login": "lampepfl", - "id": 2684793, - "avatar_url": "https://avatars.githubusercontent.com/u/2684793?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/lampepfl", - "html_url": "https://github.com/lampepfl", - "followers_url": "https://api.github.com/users/lampepfl/followers", - "following_url": "https://api.github.com/users/lampepfl/following{/other_user}", - "gists_url": "https://api.github.com/users/lampepfl/gists{/gist_id}", - "starred_url": "https://api.github.com/users/lampepfl/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/lampepfl/subscriptions", - "organizations_url": "https://api.github.com/users/lampepfl/orgs", - "repos_url": "https://api.github.com/users/lampepfl/repos", - "events_url": "https://api.github.com/users/lampepfl/events{/privacy}", - "received_events_url": "https://api.github.com/users/lampepfl/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 7035651, - "name": "dotty", - "full_name": "lampepfl/dotty", - "owner": { - "login": "lampepfl", - "id": 2684793, - "avatar_url": "https://avatars.githubusercontent.com/u/2684793?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/lampepfl", - "html_url": "https://github.com/lampepfl", - "followers_url": "https://api.github.com/users/lampepfl/followers", - "following_url": "https://api.github.com/users/lampepfl/following{/other_user}", - "gists_url": "https://api.github.com/users/lampepfl/gists{/gist_id}", - "starred_url": "https://api.github.com/users/lampepfl/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/lampepfl/subscriptions", - "organizations_url": "https://api.github.com/users/lampepfl/orgs", - "repos_url": "https://api.github.com/users/lampepfl/repos", - "events_url": "https://api.github.com/users/lampepfl/events{/privacy}", - "received_events_url": "https://api.github.com/users/lampepfl/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/lampepfl/dotty", - "description": "Research platform for new language concepts and compiler technologies for Scala.", - "fork": false, - "url": "https://api.github.com/repos/lampepfl/dotty", - "forks_url": "https://api.github.com/repos/lampepfl/dotty/forks", - "keys_url": "https://api.github.com/repos/lampepfl/dotty/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/lampepfl/dotty/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/lampepfl/dotty/teams", - "hooks_url": "https://api.github.com/repos/lampepfl/dotty/hooks", - "issue_events_url": "https://api.github.com/repos/lampepfl/dotty/issues/events{/number}", - "events_url": "https://api.github.com/repos/lampepfl/dotty/events", - "assignees_url": "https://api.github.com/repos/lampepfl/dotty/assignees{/user}", - "branches_url": "https://api.github.com/repos/lampepfl/dotty/branches{/branch}", - "tags_url": "https://api.github.com/repos/lampepfl/dotty/tags", - "blobs_url": "https://api.github.com/repos/lampepfl/dotty/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/lampepfl/dotty/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/lampepfl/dotty/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/lampepfl/dotty/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/lampepfl/dotty/statuses/{sha}", - "languages_url": "https://api.github.com/repos/lampepfl/dotty/languages", - "stargazers_url": "https://api.github.com/repos/lampepfl/dotty/stargazers", - "contributors_url": "https://api.github.com/repos/lampepfl/dotty/contributors", - "subscribers_url": "https://api.github.com/repos/lampepfl/dotty/subscribers", - "subscription_url": "https://api.github.com/repos/lampepfl/dotty/subscription", - "commits_url": "https://api.github.com/repos/lampepfl/dotty/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/lampepfl/dotty/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/lampepfl/dotty/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/lampepfl/dotty/contents/{+path}", - "compare_url": "https://api.github.com/repos/lampepfl/dotty/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/lampepfl/dotty/merges", - "archive_url": "https://api.github.com/repos/lampepfl/dotty/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/lampepfl/dotty/downloads", - "issues_url": "https://api.github.com/repos/lampepfl/dotty/issues{/number}", - "pulls_url": "https://api.github.com/repos/lampepfl/dotty/pulls{/number}", - "milestones_url": "https://api.github.com/repos/lampepfl/dotty/milestones{/number}", - "notifications_url": "https://api.github.com/repos/lampepfl/dotty/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/lampepfl/dotty/labels{/name}", - "releases_url": "https://api.github.com/repos/lampepfl/dotty/releases{/id}", - "deployments_url": "https://api.github.com/repos/lampepfl/dotty/deployments", - "created_at": "2012-12-06T12:57:33Z", - "updated_at": "2017-02-08T13:10:05Z", - "pushed_at": "2017-02-09T08:51:58Z", - "git_url": "git://github.com/lampepfl/dotty.git", - "ssh_url": "git@github.com:lampepfl/dotty.git", - "clone_url": "https://github.com/lampepfl/dotty.git", - "svn_url": "https://github.com/lampepfl/dotty", - "homepage": "http://dotty.epfl.ch", - "size": 28896, - "stargazers_count": 1452, - "watchers_count": 1452, - "language": "Scala", - "has_issues": true, - "has_downloads": true, - "has_wiki": false, - "has_pages": true, - "forks_count": 213, - "mirror_url": null, - "open_issues_count": 250, - "forks": 213, - "open_issues": 250, - "watchers": 1452, - "default_branch": "master" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/lampepfl/dotty/pulls/1958" - }, - "html": { - "href": "https://github.com/lampepfl/dotty/pull/1958" - }, - "issue": { - "href": "https://api.github.com/repos/lampepfl/dotty/issues/1958" - }, - "comments": { - "href": "https://api.github.com/repos/lampepfl/dotty/issues/1958/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/lampepfl/dotty/pulls/1958/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/lampepfl/dotty/pulls/1958/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/lampepfl/dotty/statuses/ce4051743d590721dc969c92c44a35147e1e3abc" - } - }, - "requested_reviewers": [ - - ], - "merged": false, - "mergeable": null, - "mergeable_state": "unknown", - "merged_by": null, - "comments": 1, - "review_comments": 2, - "maintainer_can_modify": true, - "commits": 13, - "additions": 501, - "deletions": 173, - "changed_files": 29 - }, - "before": "a51a963005eb6f5a42a0cef7420a7008956e622a", - "after": "ce4051743d590721dc969c92c44a35147e1e3abc", - "repository": { - "id": 7035651, - "name": "dotty", - "full_name": "lampepfl/dotty", - "owner": { - "login": "lampepfl", - "id": 2684793, - "avatar_url": "https://avatars.githubusercontent.com/u/2684793?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/lampepfl", - "html_url": "https://github.com/lampepfl", - "followers_url": "https://api.github.com/users/lampepfl/followers", - "following_url": "https://api.github.com/users/lampepfl/following{/other_user}", - "gists_url": "https://api.github.com/users/lampepfl/gists{/gist_id}", - "starred_url": "https://api.github.com/users/lampepfl/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/lampepfl/subscriptions", - "organizations_url": "https://api.github.com/users/lampepfl/orgs", - "repos_url": "https://api.github.com/users/lampepfl/repos", - "events_url": "https://api.github.com/users/lampepfl/events{/privacy}", - "received_events_url": "https://api.github.com/users/lampepfl/received_events", - "type": "Organization", - "site_admin": false - }, - "private": false, - "html_url": "https://github.com/lampepfl/dotty", - "description": "Research platform for new language concepts and compiler technologies for Scala.", - "fork": false, - "url": "https://api.github.com/repos/lampepfl/dotty", - "forks_url": "https://api.github.com/repos/lampepfl/dotty/forks", - "keys_url": "https://api.github.com/repos/lampepfl/dotty/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/lampepfl/dotty/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/lampepfl/dotty/teams", - "hooks_url": "https://api.github.com/repos/lampepfl/dotty/hooks", - "issue_events_url": "https://api.github.com/repos/lampepfl/dotty/issues/events{/number}", - "events_url": "https://api.github.com/repos/lampepfl/dotty/events", - "assignees_url": "https://api.github.com/repos/lampepfl/dotty/assignees{/user}", - "branches_url": "https://api.github.com/repos/lampepfl/dotty/branches{/branch}", - "tags_url": "https://api.github.com/repos/lampepfl/dotty/tags", - "blobs_url": "https://api.github.com/repos/lampepfl/dotty/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/lampepfl/dotty/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/lampepfl/dotty/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/lampepfl/dotty/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/lampepfl/dotty/statuses/{sha}", - "languages_url": "https://api.github.com/repos/lampepfl/dotty/languages", - "stargazers_url": "https://api.github.com/repos/lampepfl/dotty/stargazers", - "contributors_url": "https://api.github.com/repos/lampepfl/dotty/contributors", - "subscribers_url": "https://api.github.com/repos/lampepfl/dotty/subscribers", - "subscription_url": "https://api.github.com/repos/lampepfl/dotty/subscription", - "commits_url": "https://api.github.com/repos/lampepfl/dotty/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/lampepfl/dotty/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/lampepfl/dotty/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/lampepfl/dotty/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/lampepfl/dotty/contents/{+path}", - "compare_url": "https://api.github.com/repos/lampepfl/dotty/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/lampepfl/dotty/merges", - "archive_url": "https://api.github.com/repos/lampepfl/dotty/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/lampepfl/dotty/downloads", - "issues_url": "https://api.github.com/repos/lampepfl/dotty/issues{/number}", - "pulls_url": "https://api.github.com/repos/lampepfl/dotty/pulls{/number}", - "milestones_url": "https://api.github.com/repos/lampepfl/dotty/milestones{/number}", - "notifications_url": "https://api.github.com/repos/lampepfl/dotty/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/lampepfl/dotty/labels{/name}", - "releases_url": "https://api.github.com/repos/lampepfl/dotty/releases{/id}", - "deployments_url": "https://api.github.com/repos/lampepfl/dotty/deployments", - "created_at": "2012-12-06T12:57:33Z", - "updated_at": "2017-02-08T13:10:05Z", - "pushed_at": "2017-02-09T08:51:58Z", - "git_url": "git://github.com/lampepfl/dotty.git", - "ssh_url": "git@github.com:lampepfl/dotty.git", - "clone_url": "https://github.com/lampepfl/dotty.git", - "svn_url": "https://github.com/lampepfl/dotty", - "homepage": "http://dotty.epfl.ch", - "size": 28896, - "stargazers_count": 1452, - "watchers_count": 1452, - "language": "Scala", - "has_issues": true, - "has_downloads": true, - "has_wiki": false, - "has_pages": true, - "forks_count": 213, - "mirror_url": null, - "open_issues_count": 250, - "forks": 213, - "open_issues": 250, - "watchers": 1452, - "default_branch": "master" - }, - "organization": { - "login": "lampepfl", - "id": 2684793, - "url": "https://api.github.com/orgs/lampepfl", - "repos_url": "https://api.github.com/orgs/lampepfl/repos", - "events_url": "https://api.github.com/orgs/lampepfl/events", - "hooks_url": "https://api.github.com/orgs/lampepfl/hooks", - "issues_url": "https://api.github.com/orgs/lampepfl/issues", - "members_url": "https://api.github.com/orgs/lampepfl/members{/member}", - "public_members_url": "https://api.github.com/orgs/lampepfl/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/2684793?v=3", - "description": null - }, - "sender": { - "login": "felixmulder", - "id": 1530049, - "avatar_url": "https://avatars.githubusercontent.com/u/1530049?v=3", - "gravatar_id": "", - "url": "https://api.github.com/users/felixmulder", - "html_url": "https://github.com/felixmulder", - "followers_url": "https://api.github.com/users/felixmulder/followers", - "following_url": "https://api.github.com/users/felixmulder/following{/other_user}", - "gists_url": "https://api.github.com/users/felixmulder/gists{/gist_id}", - "starred_url": "https://api.github.com/users/felixmulder/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/felixmulder/subscriptions", - "organizations_url": "https://api.github.com/users/felixmulder/orgs", - "repos_url": "https://api.github.com/users/felixmulder/repos", - "events_url": "https://api.github.com/users/felixmulder/events{/privacy}", - "received_events_url": "https://api.github.com/users/felixmulder/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/build.sbt b/build.sbt index 2939ebf2ec79..46468833a7d2 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,6 @@ val `dotty-interfaces` = Build.`dotty-interfaces` val `dotty-doc` = Build.`dotty-doc` val `dotty-doc-bootstrapped` = Build.`dotty-doc-bootstrapped` val `dotty-doc-optimised` = Build.`dotty-doc-optimised` -val `dotty-bot` = Build.`dotty-bot` val `dotty-compiler` = Build.`dotty-compiler` val `dotty-compiler-bootstrapped` = Build.`dotty-compiler-bootstrapped` val `dotty-compiler-optimised` = Build.`dotty-compiler-optimised` diff --git a/project/Build.scala b/project/Build.scala index 4570cb02b7ff..033f701d44d7 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -411,31 +411,6 @@ object Build { case BootstrappedOptimised => `dotty-doc-optimised` } - lazy val `dotty-bot` = project.in(file("bot")). - settings(commonScala2Settings). - settings( - resourceDirectory in Test := baseDirectory.value / "test" / "resources", - - // specify main and ignore tests when assembling - mainClass in assembly := Some("dotty.tools.bot.Main"), - test in assembly := {}, - - libraryDependencies ++= { - val circeVersion = "0.7.0" - val http4sVersion = "0.15.3" - Seq( - "com.novocode" % "junit-interface" % "0.11" % "test", - "io.circe" %% "circe-generic" % circeVersion, - "io.circe" %% "circe-parser" % circeVersion, - "ch.qos.logback" % "logback-classic" % "1.1.7", - "org.http4s" %% "http4s-dsl" % http4sVersion, - "org.http4s" %% "http4s-blaze-server" % http4sVersion, - "org.http4s" %% "http4s-blaze-client" % http4sVersion, - "org.http4s" %% "http4s-circe" % http4sVersion - ) - } - ) - // Settings shared between dotty-compiler and dotty-compiler-bootstrapped lazy val commonDottyCompilerSettings = Seq(