From eaff2c9090ee312136dc70c36937741376a97b49 Mon Sep 17 00:00:00 2001 From: Shoma Nishitateno Date: Mon, 21 May 2018 12:03:56 +0900 Subject: [PATCH 1/4] Update: version to 0.1.0b2-SNAPSHOT --- build.sbt | 2 +- src/main/resources/application.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index b01baa4..4295a76 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ name := "backlog-migration-cybozulive" lazy val commonSettings = Seq( - version := "0.1.0b1", + version := "0.1.0b2-SNAPSHOT", scalaVersion := "2.12.6", libraryDependencies ++= Seq( "org.fusesource.jansi" % "jansi" % "1.17", diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 0ae3b98..1037ed3 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -1,14 +1,14 @@ app { name = "Backlog Migration for CybozuLive" - version = "0.1.0b1" + version = "0.1.0b2-SNAPSHOT" title = ${app.name} ${app.version} (c) nulab.inc fileName = backlog-migration-cybozulive-${app.version}.jar language = default dataDirectory = "./backlog-migration" mixpanel { - token = "5be8b628b7103858164142d02cb38347" - backlogtoolToken = "0512c52e553b9283143bed99e61c27e4" + token = "6aad3862b3514d664ebb4501f86f42c8" + backlogtoolToken = "6aad3862b3514d664ebb4501f86f42c8" product = "cybozulive" } } From 65f47612185bb8ed1adcaa6e017f1ada32da7b0a Mon Sep 17 00:00:00 2001 From: Shoma Nishitateno Date: Tue, 22 May 2018 17:23:20 +0900 Subject: [PATCH 2/4] Fix: user mapping requires userId. Not username. BLGMIGRATION-692 --- .../nulabinc/backlog/c2b/services/MappingFiles.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala b/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala index 2138caf..a2d67f1 100644 --- a/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala +++ b/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala @@ -41,8 +41,14 @@ object MappingFiles { def createMappingContext(): AppProgram[MappingContext] = for { userMappingStream <- read(Config.USERS_PATH) - users <- AppDSL.streamAsSeq(userMappingStream).orFail - userMappings = indexSeqToHashMap(users) + userNames <- AppDSL.streamAsSeq(userMappingStream).orFail + backlogUserStream <- AppDSL.fromStore(StoreDSL.getBacklogUsers) + backlogUsers <- AppDSL.streamAsSeq(backlogUserStream).orFail + userHashMap = userNames.map { + case (cybozu, backlog) => + (cybozu, backlogUsers.find(_.name == backlog).get.userId.getOrElse(throw new RuntimeException("It never happened. Admin user can get userId."))) // TODO: + } + userMappings = indexSeqToHashMap(userHashMap) priorityMappingStream <- read(Config.PRIORITIES_PATH) priorities <- AppDSL.streamAsSeq(priorityMappingStream).orFail priorityMappings = indexSeqToHashMap(priorities) From d8a839990b790ff7e2fa560cdc414ec5e24b23e4 Mon Sep 17 00:00:00 2001 From: Shoma Nishitateno Date: Tue, 22 May 2018 17:32:17 +0900 Subject: [PATCH 3/4] Clean: --- .../com/nulabinc/backlog/c2b/services/MappingFiles.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala b/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala index a2d67f1..fc714ed 100644 --- a/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala +++ b/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala @@ -46,7 +46,12 @@ object MappingFiles { backlogUsers <- AppDSL.streamAsSeq(backlogUserStream).orFail userHashMap = userNames.map { case (cybozu, backlog) => - (cybozu, backlogUsers.find(_.name == backlog).get.userId.getOrElse(throw new RuntimeException("It never happened. Admin user can get userId."))) // TODO: + val backlogUserId = backlogUsers + .find(_.name == backlog) + .getOrElse(throw new RuntimeException("It never happen. It has already validated.")) + .userId + .getOrElse(throw new RuntimeException("It never happen. Admin user can get userId.")) + (cybozu, backlogUserId) } userMappings = indexSeqToHashMap(userHashMap) priorityMappingStream <- read(Config.PRIORITIES_PATH) From 21a1b3106699ea52f72ec2bbbbf0101e615eb89f Mon Sep 17 00:00:00 2001 From: Shoma Nishitateno Date: Wed, 23 May 2018 10:36:10 +0900 Subject: [PATCH 4/4] Release: 0.1.0b2 --- build.sbt | 2 +- src/main/resources/application.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 4295a76..374eb99 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ name := "backlog-migration-cybozulive" lazy val commonSettings = Seq( - version := "0.1.0b2-SNAPSHOT", + version := "0.1.0b2", scalaVersion := "2.12.6", libraryDependencies ++= Seq( "org.fusesource.jansi" % "jansi" % "1.17", diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 1037ed3..7a2f63d 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -1,14 +1,14 @@ app { name = "Backlog Migration for CybozuLive" - version = "0.1.0b2-SNAPSHOT" + version = "0.1.0b2" title = ${app.name} ${app.version} (c) nulab.inc fileName = backlog-migration-cybozulive-${app.version}.jar language = default dataDirectory = "./backlog-migration" mixpanel { - token = "6aad3862b3514d664ebb4501f86f42c8" - backlogtoolToken = "6aad3862b3514d664ebb4501f86f42c8" + token = "5be8b628b7103858164142d02cb38347" + backlogtoolToken = "0512c52e553b9283143bed99e61c27e4" product = "cybozulive" } }