Skip to content

Commit

Permalink
Merge pull request #156 from nulab/BLG_INTG-1231/backport
Browse files Browse the repository at this point in the history
BLG_INTG-1181 Fix that changes from comment are not being updated usi…
  • Loading branch information
jtakakura authored Sep 21, 2023
2 parents 5a8d164 + a854810 commit ad77f5d
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.nulabinc.backlog.migration.common.service

import java.io.{File, FileInputStream}
import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand All @@ -25,6 +26,7 @@ class AttachmentServiceImpl @Inject() (implicit
override def postAttachment(
path: String
): Either[Throwable, BacklogAttachment] = {
sleep(500)
val file = new File(path)
val attachmentData =
new AttachmentDataImpl(file.getName, new FileInputStream(file))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nulabinc.backlog.migration.common.service

import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -43,6 +44,7 @@ class CommentServiceImpl @Inject() (
offset: Long
): Seq[IssueComment] =
if (offset < allCount) {
sleep(500)
val queryParams = new QueryParams()
for { minId <- optMinId } yield {
queryParams.minId(minId)
Expand Down Expand Up @@ -156,6 +158,7 @@ class CommentServiceImpl @Inject() (
logger.warn("No update item")
true
} else {
sleep(500)
Convert.toBacklog(backlog.importUpdateIssue(params))
false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nulabinc.backlog.migration.common.service

import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -37,6 +38,7 @@ class GroupServiceImpl @Inject() (implicit
val memberIds = group.members.flatMap(_.optUserId).flatMap(propertyResolver.optResolvedUserId)
val params = new CreateGroupParams(group.name)
params.members(memberIds.asJava)
sleep(500)
backlog.createGroup(params)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nulabinc.backlog.migration.common.service

import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -28,6 +29,7 @@ class IssueCategoryServiceImpl @Inject() (implicit
override def add(
backlogIssueCategory: BacklogIssueCategory
): BacklogIssueCategory = {
sleep(500)
val params =
new AddCategoryParams(projectKey.value, backlogIssueCategory.name)
Convert.toBacklog(backlog.addCategory(params))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.nulabinc.backlog.migration.common.service

import java.io.InputStream
import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -31,8 +32,10 @@ class IssueServiceImpl @Inject() (implicit
) extends IssueService
with Logging {

override def issueOfId(id: Long): BacklogIssue =
override def issueOfId(id: Long): BacklogIssue = {
sleep(500)
Convert.toBacklog(backlog.getIssue(id))
}

override def optIssueOfId(id: Long): Option[Issue] =
try {
Expand Down Expand Up @@ -164,6 +167,7 @@ class IssueServiceImpl @Inject() (implicit
params.getParamList.asScala.foreach(p =>
logger.debug(s" [Issue Parameter]:${p.getName}:${p.getValue}")
)
sleep(500)
Right(Convert.toBacklog(backlog.importIssue(params)))
} catch {
case e: Throwable =>
Expand Down Expand Up @@ -313,6 +317,7 @@ class IssueServiceImpl @Inject() (implicit
propertyResolver.tryDefaultIssueTypeId(),
PriorityType.Normal
)
sleep(500)
val issue = backlog.importIssue(params)
logger.debug(
s"[Success Finish Create Dummy Issue]:${issue.getId}----------------------------"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nulabinc.backlog.migration.common.service

import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -27,6 +28,7 @@ class IssueTypeServiceImpl @Inject() (implicit
backlog.getIssueTypes(projectKey.value).asScala.toSeq.map(Convert.toBacklog(_))

override def add(issueType: BacklogIssueType): BacklogIssueType = {
sleep(500)
val params = new AddIssueTypeParams(
projectKey.value,
issueType.name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nulabinc.backlog.migration.common.service

import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -32,7 +33,9 @@ class ProjectUserServiceImpl @Inject() (implicit
}
}

override def add(userId: Long) =
override def add(userId: Long) = {
sleep(500)
backlog.addProjectUser(projectKey.value, userId)
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nulabinc.backlog.migration.common.service

import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand All @@ -26,6 +27,7 @@ class VersionServiceImpl @Inject() (implicit
backlog.getVersions(projectKey.value).asScala.toSeq.map(Convert.toBacklog(_))

override def add(backlogVersion: BacklogVersion): Option[BacklogVersion] = {
sleep(500)
val params = new AddVersionParams(projectKey.value, backlogVersion.name)
params.description(backlogVersion.description)
for { startDate <- backlogVersion.optStartDate } yield {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.nulabinc.backlog.migration.common.service

import java.io.InputStream
import java.lang.Thread.sleep
import javax.inject.Inject

import com.nulabinc.backlog.migration.common.client.BacklogAPIClient
Expand Down Expand Up @@ -37,8 +38,10 @@ class WikiServiceImpl @Inject() (implicit
override def allWikis(): Seq[BacklogWiki] =
backlog.getWikis(projectKey.value).asScala.toSeq.map(Convert.toBacklog(_))

override def wikiOfId(wikiId: Long): BacklogWiki =
override def wikiOfId(wikiId: Long): BacklogWiki = {
sleep(500)
Convert.toBacklog(backlog.getWiki(wikiId))
}

override def update(wiki: BacklogWiki): Option[BacklogWiki] =
for {
Expand Down

0 comments on commit ad77f5d

Please sign in to comment.