From 8be0ee4bbd59a189a9b1c02f6f362754761aea9e Mon Sep 17 00:00:00 2001 From: piotradamczyk5 <65554637+piotradamczyk5@users.noreply.github.com> Date: Fri, 16 Apr 2021 15:33:03 +0200 Subject: [PATCH] ci: Disabled Estimation copying (#1813) --- .github/workflows/pr_checks.yml | 2 +- flank-scripts/build.gradle.kts | 2 +- .../cli/github/CopyIssuePropertiesCommand.kt | 3 +-- .../scripts/ops/github/CopyGitHubProperties.kt | 18 +----------------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index 6a610846b2..1c4612085f 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -21,7 +21,7 @@ jobs: echo "./flank-scripts/bash" >> $GITHUB_PATH - name: Copy properties - run: flankScripts github copy_issue_properties --github-token=${{ secrets.GITHUB_TOKEN }} --zenhub-token=${{ secrets.ZENHUB_API_KEY }} --pr-number=${{ github.event.number }} + run: flankScripts github copy_issue_properties --github-token=${{ secrets.GITHUB_TOKEN }} --pr-number=${{ github.event.number }} check_title: runs-on: macos-latest steps: diff --git a/flank-scripts/build.gradle.kts b/flank-scripts/build.gradle.kts index 53b650ec59..4aa2a5663e 100644 --- a/flank-scripts/build.gradle.kts +++ b/flank-scripts/build.gradle.kts @@ -26,7 +26,7 @@ shadowJar.apply { } } // .. -version = "1.9.11" +version = "1.9.12" group = "com.github.flank" application { diff --git a/flank-scripts/src/main/kotlin/flank/scripts/cli/github/CopyIssuePropertiesCommand.kt b/flank-scripts/src/main/kotlin/flank/scripts/cli/github/CopyIssuePropertiesCommand.kt index 4fb9d97c3f..4354de25c4 100644 --- a/flank-scripts/src/main/kotlin/flank/scripts/cli/github/CopyIssuePropertiesCommand.kt +++ b/flank-scripts/src/main/kotlin/flank/scripts/cli/github/CopyIssuePropertiesCommand.kt @@ -11,10 +11,9 @@ object CopyIssuePropertiesCommand : CliktCommand( help = "Copy properties(assignees, story points, labels) from issue to pull request" ) { private val githubToken by option(help = "Git Token").required() - private val zenhubToken by option(help = "ZenHub api Token").required() private val prNumber by option(help = "Pull request number").int().required() override fun run() { - copyGitHubProperties(githubToken, zenhubToken, prNumber) + copyGitHubProperties(githubToken, prNumber) } } diff --git a/flank-scripts/src/main/kotlin/flank/scripts/ops/github/CopyGitHubProperties.kt b/flank-scripts/src/main/kotlin/flank/scripts/ops/github/CopyGitHubProperties.kt index 750c760780..a8229d2b96 100644 --- a/flank-scripts/src/main/kotlin/flank/scripts/ops/github/CopyGitHubProperties.kt +++ b/flank-scripts/src/main/kotlin/flank/scripts/ops/github/CopyGitHubProperties.kt @@ -10,14 +10,13 @@ import flank.scripts.data.github.getLabelsFromIssue import flank.scripts.data.github.objects.GithubPullRequest import flank.scripts.data.github.setAssigneesToPullRequest import flank.scripts.data.github.setLabelsToPullRequest -import flank.scripts.data.zenhub.copyEstimation import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.joinAll import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -fun copyGitHubProperties(githubToken: String, zenhubToken: String, prNumber: Int) = runBlocking { +fun copyGitHubProperties(githubToken: String, prNumber: Int) = runBlocking { getGitHubPullRequest(githubToken, prNumber) .onError { println("Could not copy properties, because of ${it.message}") } .success { pullRequest -> @@ -31,13 +30,6 @@ fun copyGitHubProperties(githubToken: String, zenhubToken: String, prNumber: Int prNumber ) } - launch(Dispatchers.IO) { - copyZenhubProperties( - zenhubToken, - issueNumber, - prNumber - ) - } } } @@ -80,11 +72,3 @@ internal suspend fun copyLabels(githubToken: String, issueNumber: Int, pullReque .getOrNull() ?.run { setLabelsToPullRequest(githubToken, pullRequestNumber, this) } } - -private suspend fun copyZenhubProperties( - zenhubToken: String, - baseIssueNumber: Int, - prNumber: Int -) { - copyEstimation(zenhubToken, baseIssueNumber, prNumber) -}