This repository has been archived by the owner on Jan 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ValidateChangelogVerticle and list issue comments option
- Loading branch information
Showing
8 changed files
with
102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/io/github/spair/repoxbot/command/ValidateChangelogVerticle.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.github.spair.repoxbot.command | ||
|
||
import io.github.spair.repoxbot.constant.EB_COMMAND_CHANGELOG_VALIDATE | ||
import io.github.spair.repoxbot.constant.EB_GITHUB_ISSUE_LIST | ||
import io.github.spair.repoxbot.dto.IssueComment | ||
import io.github.spair.repoxbot.dto.PullRequest | ||
import io.vertx.core.AbstractVerticle | ||
|
||
class ValidateChangelogVerticle : AbstractVerticle() { | ||
|
||
private val eventBus by lazy { vertx.eventBus() } | ||
|
||
override fun start() { | ||
eventBus.localConsumer<PullRequest>(EB_COMMAND_CHANGELOG_VALIDATE) { msg -> | ||
val pullRequest = msg.body() | ||
eventBus.send<List<IssueComment>>(EB_GITHUB_ISSUE_LIST, pullRequest.number) { issueComments -> | ||
println(issueComments.result().body()) | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/io/github/spair/repoxbot/constant/event_bus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
package io.github.spair.repoxbot.constant | ||
|
||
// Event | ||
const val EB_EVENT_PULLREQUEST = "eb.event.pull_request" | ||
|
||
// Command | ||
const val EB_COMMAND_CHANGELOG_UPDATE = "eb.command.changelog.update" | ||
const val EB_COMMAND_CHANGELOG_VALIDATE = "eb.command.changelog.validate" | ||
|
||
// Github | ||
const val EB_GITHUB_CONFIG_READ = "eb.github.config.read" | ||
|
||
const val EB_GITHUB_FILE_READ = "eb.github.file.read" | ||
const val EB_GITHUB_FILE_UPDATE = "eb.github.file.update" | ||
|
||
const val EB_GITHUB_ISSUE_LIST = "eb.github.issue.list" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.github.spair.repoxbot.dto | ||
|
||
data class IssueComment(val id: Int, val user: String, val body: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/io/github/spair/repoxbot/dto/codec/IssueCommentListCodec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.github.spair.repoxbot.dto.codec | ||
|
||
import io.github.spair.repoxbot.dto.IssueComment | ||
|
||
class IssueCommentListCodec : LocalMessageCodec<List<IssueComment>, List<IssueComment>>() { | ||
|
||
companion object { | ||
const val NAME = "localIssueCommentListCodec" | ||
} | ||
|
||
override fun transform(issueCommentList: List<IssueComment>): List<IssueComment> = issueCommentList | ||
|
||
override fun name(): String = NAME | ||
} |