Skip to content

Commit

Permalink
ci: Disabled Estimation copying (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotradamczyk5 authored Apr 16, 2021
1 parent 458a12e commit 8be0ee4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion flank-scripts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ shadowJar.apply {
}
}
// <breaking change>.<feature added>.<fix/minor change>
version = "1.9.11"
version = "1.9.12"
group = "com.github.flank"

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand All @@ -31,13 +30,6 @@ fun copyGitHubProperties(githubToken: String, zenhubToken: String, prNumber: Int
prNumber
)
}
launch(Dispatchers.IO) {
copyZenhubProperties(
zenhubToken,
issueNumber,
prNumber
)
}
}
}

Expand Down Expand Up @@ -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)
}

0 comments on commit 8be0ee4

Please sign in to comment.