-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Added support DingTalk notifier. #1653
Conversation
Hi @mask616! Thanks for your contribution. Could you please change the property |
Done. Opened to any feedback. |
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.
LG2M! But tests are missing.
.../main/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration.java
Show resolved
Hide resolved
public DingTalkNotifier(InstanceRepository repository, RestTemplate restTemplate) { | ||
super(repository); | ||
this.restTemplate = restTemplate; | ||
this.message = parser.parseExpression(DEFAULT_MESSAGE, ParserContext.TEMPLATE_EXPRESSION); |
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 is always using DEFAULT_MESSAGE, right? I cannot find any place where the text from property spring.boot.admin.notify.dingtalk.message
is being used.
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.
It is used on line 106.
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.
yes the property message
from this class is used, but it is always initialized with DEFAULT_MESSAGE
(being passed to parseExpression()
, the configuration spring.boot.admin.notify.dingtalk.message
is not used (never passed to parseExpression()
)
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 is a reference to other notifiers(eg. TelegramNotifier, SlackNotifier, PagerdutyNotifier, OpsGenieNotifier, LetsChatNotifier...).In oreder to be consistent with others notifiers, So I did.
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.
For example :
In TelegramNotifier
public TelegramNotifier(InstanceRepository repository, RestTemplate restTemplate) {
super(repository);
this.restTemplate = restTemplate;
this.message = parser.parseExpression(DEFAULT_MESSAGE, ParserContext.TEMPLATE_EXPRESSION);
}
In SlackNotifier
public SlackNotifier(InstanceRepository repository, RestTemplate restTemplate) {
super(repository);
this.restTemplate = restTemplate;
this.message = parser.parseExpression(DEFAULT_MESSAGE, ParserContext.TEMPLATE_EXPRESSION);
}
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.
Hi, sorry for answering so late. These other notifiers have a setter for the description where it is parsed:
public void setMessage(String message) {
this.message = parser.parseExpression(message, ParserContext.TEMPLATE_EXPRESSION);
}
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.
@mask616 if you add this piece we could merge your PR
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.
@mask616 if you add this piece we could merge your PR
@erikpetzold I had add it just now.
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.
Please add some tests as well.
Hi, I've added DingTalk tests. |
@SteKoe @erikpetzold Thank you for reviewing my code. I am very happy that my PR can be merged. This is the first time I have participated in open source software. I have learned a lot from this practice. This has also helped me participate in more open source software improvements Gained courage and confidence. Thank you again. |
Hey @mask616, great to hear 🎉 |
…-relpaths * origin/master: Add retry on failing subscription (codecentric#1697) chore(deps): update dependency pl.project13.maven:git-commit-id-plugin to v4.0.4 (codecentric#1663) chore(deps): update dependency com.puppycrawl.tools:checkstyle to v8.41.1 (codecentric#1648) Fix for codecentric#1638 (codecentric#1673) Improve npm ci build times (see codecentric#1688) (codecentric#1689) Improved execution of grouped assertions (codecentric#1674) Use maven repo cache during publish snapshots (codecentric#1687) chore(deps): update metcalfc/changelog-generator action to v1 (codecentric#1669) chore(deps): update dependency org.codehaus.mojo:flatten-maven-plugin to v1.2.7 (codecentric#1686) Fix file formating by applying spring-javaformat:apply (codecentric#1685) Cache mvn repo in main build (see codecentric#1677 ) (codecentric#1678) Added support DingTalk notifier. (codecentric#1653) Simplify some code (codecentric#1670) Bugfix/1646 (codecentric#1661) Upgrade spring cloud dependencies (codecentric#1645) chore(deps): update dependency com.github.eirslett:frontend-maven-plugin to v1.11.2 (codecentric#1635) chore(deps): update spring boot to v2.4.3 (codecentric#1637) Bump version to 2.4.1-SNAPSHOT chore(deps): update testcontainers.version to v1.15.2 (codecentric#1629)
No description provided.