Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Disabled estimations copying #1813

Merged
merged 1 commit into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}