fix(notifier): Provide the types for mailClient and jiraClient#8684
fix(notifier): Provide the types for mailClient and jiraClient#8684mnonnenmacher wants to merge 1 commit intomainfrom
Conversation
Make sure that the types for `mailClient` and `jiraClient` are always defined. Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8684 +/- ##
=========================================
Coverage 67.88% 67.88%
Complexity 1165 1165
=========================================
Files 244 244
Lines 7732 7732
Branches 865 865
=========================================
Hits 5249 5249
Misses 2124 2124
Partials 359 359
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| config.mail?.let { put("mailClient", MailNotifier(it)) } | ||
| config.jira?.let { put("jiraClient", JiraNotifier(it)) } | ||
|
|
||
| put("mailClient", config.mail?.let { MailNotifier(it) }) |
There was a problem hiding this comment.
As the condition is now not at the outer level anymore, buildMap can be replaced with mapOf and "mailClient" to config.mail?.let { MailNotifier(it) } etc.
|
|
||
| override val compConfig = createJvmCompilationConfigurationFromTemplate<NotificationsScriptTemplate> { | ||
| providedProperties(customProperties.mapValues { (_, v) -> KotlinType(v::class) }) | ||
| providedProperties(customPropertyTypes) |
There was a problem hiding this comment.
This could be inlined, like done here (using a vararg of pairs). And I'd probably inline customProperties then as well.
| "mailClient" to KotlinType(MailNotifier::class, isNullable = true), | ||
| "jiraClient" to KotlinType(JiraNotifier::class, isNullable = true), |
There was a problem hiding this comment.
Making these types nullable will be a breaking change because all notifier scripts will need to be adjusted.
Please change your commit message: fix(notifier)!:
|
@mnonnenmacher are you going to continue working on this, or can it be closed? |
I stopped because I could not get IntelliJ syntax highlighting to work anymore, but yes, I still want to continue, maybe as part of making notifiers plugins. |
|
I'm not planning to continue this anymore. |
Make sure that the types for
mailClientandjiraClientare always defined.