@@ -84,9 +84,6 @@ trait PullRequestService {
84
84
def reviewUrl (issueNbr : Int ): String =
85
85
s " $githubUrl/repos/lampepfl/dotty/pulls/ $issueNbr/reviews "
86
86
87
- def shutdownClient (client : Client ): Task [Unit ] =
88
- client.shutdownNow().pure[Task ]
89
-
90
87
sealed trait CommitStatus {
91
88
def commit : Commit
92
89
def isValid : Boolean
@@ -207,7 +204,7 @@ trait PullRequestService {
207
204
=> false
208
205
}
209
206
210
- wrongTense || firstLine.last == '.' || firstLine.length > 100
207
+ wrongTense || firstLine.last == '.' || firstLine.length > 80
211
208
}
212
209
213
210
def sendInitialComment (issueNbr : Int , invalidUsers : List [String ], commits : List [Commit ], client : Client ): Task [ReviewResponse ] = {
@@ -235,7 +232,7 @@ trait PullRequestService {
235
232
|
236
233
|> 1. Separate subject from body with a blank line
237
234
|> 1. When fixing an issue, start your commit message with `Fix #<ISSUE-NBR>: `
238
- |> 1. Limit the subject line to 80 characters
235
+ |> 1. Limit the subject line to 72 characters
239
236
|> 1. Capitalize the subject line
240
237
|> 1. Do not end the subject line with a period
241
238
|> 1. Use the imperative mood in the subject line ("Added" instead of "Add")
@@ -288,7 +285,7 @@ trait PullRequestService {
288
285
289
286
// Send positive comment:
290
287
_ <- sendInitialComment(issue.number, invalidUsers, commits, httpClient)
291
- _ <- shutdownClient( httpClient)
288
+ _ <- httpClient.shutdown
292
289
resp <- Ok (" Fresh PR checked" )
293
290
} yield resp
294
291
@@ -331,10 +328,10 @@ trait PullRequestService {
331
328
cancellable = statuses.filter(status => status.state == " pending" && status.context == droneContext)
332
329
runningJobs = cancellable.map(_.target_url.split('/' ).last.toInt)
333
330
cancelled <- Task .gatherUnordered(runningJobs.map(Drone .stopBuild(_, droneToken)))
334
- } yield cancelled.foldLeft( true )(_ == _ )
331
+ } yield cancelled.forall(identity )
335
332
}
336
333
}
337
- .map(xs => xs.foldLeft( true )(_ == _ ))
334
+ .map(_.forall(identity ))
338
335
339
336
def checkSynchronize (issue : Issue ): Task [Response ] = {
340
337
implicit val httpClient = PooledHttp1Client ()
@@ -353,7 +350,7 @@ trait PullRequestService {
353
350
else
354
351
setStatus(statuses.last, httpClient)
355
352
}
356
- _ <- shutdownClient( httpClient)
353
+ _ <- httpClient.shutdown
357
354
resp <- Ok (" Updated PR checked" )
358
355
} yield resp
359
356
}
@@ -421,7 +418,16 @@ trait PullRequestService {
421
418
def extractMention (body : String ): Option [String ] =
422
419
body.lines.find(_.startsWith(" @dotty-bot:" ))
423
420
424
- /** TODO: The implementation here could be quite elegant if we used a trie instead */
421
+ /** Try to make sense of what the user is requesting from the bot
422
+ *
423
+ * The bot's abilities currently only include:
424
+ *
425
+ * - Checking or re-checking the CLA
426
+ * - Restarting the CI tests
427
+ *
428
+ * @note The implementation here could be quite elegant if we used a trie
429
+ * instead
430
+ */
425
431
def interpretMention (line : String , issueComment : IssueComment ): Task [Response ] = {
426
432
val loweredLine = line.toLowerCase
427
433
if (loweredLine.contains(" check cla" ) || loweredLine.contains(" check the cla" ))
0 commit comments