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

fix(notifier): Provide the types for mailClient and jiraClient #8684

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mnonnenmacher
Copy link
Member

Make sure that the types for mailClient and jiraClient are always defined.

Make sure that the types for `mailClient` and `jiraClient` are always
defined.

Signed-off-by: Martin Nonnenmacher <[email protected]>
Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.88%. Comparing base (2bfeec1) to head (b8eb171).
Report is 720 commits behind head on main.

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           
Flag Coverage Δ
funTest-docker 66.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

config.mail?.let { put("mailClient", MailNotifier(it)) }
config.jira?.let { put("jiraClient", JiraNotifier(it)) }

put("mailClient", config.mail?.let { MailNotifier(it) })
Copy link
Member

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)
Copy link
Member

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.

Comment on lines +53 to +54
"mailClient" to KotlinType(MailNotifier::class, isNullable = true),
"jiraClient" to KotlinType(JiraNotifier::class, isNullable = true),
Copy link
Member

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)!:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants