-
Notifications
You must be signed in to change notification settings - Fork 312
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
fix(notifier): Provide the types for mailClient and jiraClient #8684
base: main
Are you sure you want to change the base?
Conversation
Make sure that the types for `mailClient` and `jiraClient` are always defined. Signed-off-by: Martin Nonnenmacher <[email protected]>
Codecov ReportAll 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. |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)!:
Make sure that the types for
mailClient
andjiraClient
are always defined.