Migrate activity log to JSON-based file from database (#2468)

This also includes:
- Record rename and transfer repository in activity log
- Check existence of repsoitory when rendering activity logs
- Drop Akka dependency
This commit is contained in:
Naoki Takezoe
2020-07-18 23:28:40 +09:00
committed by GitHub
parent f9fcb54861
commit c8f6017be9
30 changed files with 751 additions and 535 deletions

View File

@@ -14,7 +14,7 @@ import scala.util.Using
class MergeServiceSpec extends FunSpec {
val service = new MergeService with AccountService with ActivityService with IssuesService with LabelsService
with MilestonesService with RepositoryService with PrioritiesService with PullRequestService with CommitsService
with WebHookPullRequestService with WebHookPullRequestReviewCommentService {}
with WebHookPullRequestService with WebHookPullRequestReviewCommentService with RequestCache {}
val branch = "master"
val issueId = 10
def initRepository(owner: String, name: String): File = {

View File

@@ -18,7 +18,8 @@ class PullRequestServiceSpec
with PrioritiesService
with WebHookService
with WebHookPullRequestService
with WebHookPullRequestReviewCommentService {
with WebHookPullRequestReviewCommentService
with RequestCache {
def swap(r: (Issue, PullRequest)) = (r._2 -> r._1)

View File

@@ -99,7 +99,7 @@ trait ServiceSpecBase extends MockitoSugar {
lazy val dummyService = new RepositoryService with AccountService with ActivityService with IssuesService
with MergeService with PullRequestService with CommitsService with CommitStatusService with LabelsService
with MilestonesService with PrioritiesService with WebHookService with WebHookPullRequestService
with WebHookPullRequestReviewCommentService {
with WebHookPullRequestReviewCommentService with RequestCache {
override def fetchAsPullRequest(
userName: String,
repositoryName: String,

View File

@@ -7,7 +7,7 @@ import gitbucket.core.model.WebHookContentType
class WebHookServiceSpec extends FunSuite with ServiceSpecBase {
lazy val service = new WebHookPullRequestService with AccountService with ActivityService with RepositoryService
with MergeService with PullRequestService with IssuesService with CommitsService with LabelsService
with MilestonesService with PrioritiesService with WebHookPullRequestReviewCommentService
with MilestonesService with PrioritiesService with WebHookPullRequestReviewCommentService with RequestCache
test("WebHookPullRequestService.getPullRequestsByRequestForWebhook") {
withTestDB { implicit session =>

View File

@@ -169,8 +169,9 @@ class AvatarImageProviderSpec extends FunSpec with MockitoSugar {
context: Context
): Html = getAvatarImageHtml(userName, size, mailAddress, tooltip)
override def getAccountByMailAddress(mailAddress: String)(implicit context: Context): Option[Account] = account
override def getAccountByUserName(userName: String)(implicit context: Context): Option[Account] = account
override def getAccountByMailAddressFromCache(mailAddress: String)(implicit context: Context): Option[Account] =
account
override def getAccountByUserNameFromCache(userName: String)(implicit context: Context): Option[Account] = account
}
}