Repository navigation
Conversation
Review: mention mapped GitHub users in WireOverall this is a solid feature. Using UUID placeholders in Potential bugs / behavioural issues
Security
Code quality
Performance
TestsCoverage is good. A few gaps worth filling:
Nice work overall. The main item I'd address before merging is the case-sensitivity on the review-request path. |
alexandreferris
left a comment
There was a problem hiding this comment.
Great addition of mentions, but there are still somethings that needs adjustment
| ) | ||
| const val HELP_COMMAND = "/github help" | ||
| const val WEBHOOK_HELP_COMMAND = "/github webhook help" | ||
| const val ACTIONS_HELP_COMMAND = "/github actions help" | ||
| const val HELP_COMMANDS = | ||
| "Available commands:\n" + | ||
| "- `/github map <github-login> @Wire user` - map a PR reviewer\n" + |
There was a problem hiding this comment.
Add the new /github map as a const:
| ) | |
| const val HELP_COMMAND = "/github help" | |
| const val WEBHOOK_HELP_COMMAND = "/github webhook help" | |
| const val ACTIONS_HELP_COMMAND = "/github actions help" | |
| const val HELP_COMMANDS = | |
| "Available commands:\n" + | |
| "- `/github map <github-login> @Wire user` - map a PR reviewer\n" + | |
| ) | |
| const val HELP_COMMAND = "/github help" | |
| const val WEBHOOK_HELP_COMMAND = "/github webhook help" | |
| const val ACTIONS_HELP_COMMAND = "/github actions help" | |
| const val MENTIONS_MAP_COMMAND = "/github map" | |
| const val HELP_COMMANDS = | |
| "Available commands:\n" + | |
| "- `$MENTIONS_MAP_COMMAND <github-login> @Wire user` - map a PR reviewer\n" + |
There was a problem hiding this comment.
There are other places using the same command, so need to update them accordingly
There was a problem hiding this comment.
Fixed in e127cd1: added MENTIONS_MAP_COMMAND and reused it in command dispatch, parsing, usage, and help text. The help now describes mapping a GitHub user rather than only a PR reviewer.
| WEBHOOK_HELP_COMMAND -> trackedHelp(webhookHelp(conversationId)) | ||
| ACTIONS_HELP_COMMAND -> trackedHelp(actionsHelp(conversationId)) | ||
| else -> null | ||
| else -> registerMapping(command, conversationId, mentions) |
There was a problem hiding this comment.
add the exact check and continue returning else -> null for unknown commands:
| else -> registerMapping(command, conversationId, mentions) | |
| MENTIONS_MAP_COMMAND -> registerMapping(command, conversationId, mentions) | |
| else -> null |
There was a problem hiding this comment.
Fixed in e127cd1: dispatch now explicitly matches the /github map command tokens before calling registerMapping, with else -> null for unknown commands. Matching the tokens preserves support for the required arguments. Regression tests cover unrelated commands, trailing whitespace, and extra text after the selected mention.
| ), | ||
| text = messageTemplate | ||
| text = messageTemplate, | ||
| mentions = templateHandler.repositoryMentions( |
There was a problem hiding this comment.
mentions are built inside sendMessage, so if redis fails or a stored id wont parse, the webhook returns 500 and no notification goes out, can we fall back to no mentions instead?
val mentions = runCatching { templateHandler.repositoryMentions(...) }
.getOrElse { application.log.warn("Failed to resolve mentions", it); emptyList() }
the same applies to actionsMentions at line 223.
If you'd rather put the comment where values get parsed, use RedisService.kt line 30 instead:
fromFullString throws on a malformed value, and the error ends up failing the whole delivery. Maybe parse with mapNotNull { runCatching { … }.getOrNull() }?
There was a problem hiding this comment.
Fixed in e127cd1: both repository and Actions notifications catch mention-resolution failures, log a warning, and send the original text without mentions. Cancellation still propagates. Endpoint regression tests verify successful delivery for unavailable Redis and malformed-ID errors. All 52 focused tests, lint, and CI checks pass.
| null | ||
| } | ||
|
|
||
| fun mentionRanges( |
There was a problem hiding this comment.
nit: mentionRanges is only used by repositoryMentions in AuthorMentions.kt
Can it be moved there as a private TemplateHandler extension? Then all the mention logic is in one file and TemplateHandler sticks to rendering
It only needs the public handleEvent, so nothing has to change visibility
There was a problem hiding this comment.
Fixed in e127cd1: moved mentionRanges into AuthorMentions.kt as a private TemplateHandler extension. TemplateHandler now only handles rendering. Also skip the second render when no eligible mappings remain; repeated title/body tests pass.
GitHub notifications can now mention the corresponding Wire users.
/github map <github-login> @Wire userregisters a persistent, conversation-specific mapping using Wire's mention picker.@github-logintags in their bodies, excluding the reviewer/comment author.Build configuration now resolves plugin dependencies directly from Maven Central, avoiding missing transitive dependencies through the Plugin Portal.
Mention failures now fall back to plain-text delivery. Automatic review requests can resolve a unique mapping with different capitalization; explicit body tags remain case-sensitive. Mapping commands accept trailing whitespace after a selected Wire mention.
Validation: 52 focused tests passed after review fixes, including command dispatch, reviewer capitalization, author exclusions, repeated body/title offsets, and delivery when mention lookup fails.
ktlintCheck,detekt, andgit diff --checkpassed. Live Wire delivery has not been tested.