You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "kingbabingge (via GitHub)" <gi...@apache.org> on 2023/03/29 08:33:16 UTC
[GitHub] [dolphinscheduler] kingbabingge opened a new pull request, #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
kingbabingge opened a new pull request, #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821
<!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
## Purpose of the pull request
<!--(For example: This pull request adds checkstyle plugin).-->
initialize a empty objectNode to save contentField, if bodyParams is empty,will send message only include contentField
If ` bodyParams` is empty ,will get error log. `send http alert msg exception: null`
```java
private void setMsgInRequestBody(String msg) {
try {
ObjectNode objectNode = JSONUtils.parseObject(bodyParams);
// set msg content field
objectNode.put(contentField, msg);
StringEntity entity = new StringEntity(JSONUtils.toJsonString(objectNode), DEFAULT_CHARSET);
((HttpPost) httpRequest).setEntity(entity);
} catch (Exception e) {
log.error("send http alert msg exception : {}", e.getMessage());
}
}
```
fix `ObjectNode objectNode = JSONUtils.createObjectNode();` initialize a empty objectNode, `bodyParams` if not input anything , it works
```java
private void setMsgInRequestBody(String msg) {
try {
ObjectNode objectNode = JSONUtils.createObjectNode();
if(StringUtils.isNotBlank(bodyParams)){
objectNode = JSONUtils.parseObject(bodyParams);
}
// set msg content field
objectNode.put(contentField, msg);
StringEntity entity = new StringEntity(JSONUtils.toJsonString(objectNode), DEFAULT_CHARSET);
((HttpPost) httpRequest).setEntity(entity);
} catch (Exception e) {
log.error("send http alert msg exception : {}", e.getMessage());
}
}
```
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
## Verify this pull request
<!--*(Please pick either of the following options)*-->
This pull request is code cleanup without any test coverage.
*(or)*
This pull request is already covered by existing tests, such as *(please describe tests)*.
(or)
This change added tests and can be verified as follows:
<!--*(example:)*
- *Added dolphinscheduler-dao tests for end-to-end.*
- *Added CronUtilsTest to verify the change.*
- *Manually verified the change by testing locally.* -->
(or)
If your pull request contain incompatible change, you should also add it to `docs/docs/en/guide/upgrede/incompatible.md`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1514060900
> @SbloodyS plz run CI
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] fuchanghai commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "fuchanghai (via GitHub)" <gi...@apache.org>.
fuchanghai commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1512662172
@SbloodyS plz run CI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] kingbabingge commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "kingbabingge (via GitHub)" <gi...@apache.org>.
kingbabingge commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1498449464
Can this be merged ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS merged pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] kingbabingge commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "kingbabingge (via GitHub)" <gi...@apache.org>.
kingbabingge commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1514137811
@SbloodyS @fuchanghai tks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] ruanwenjun commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1495517377
Please rebase the upstream dev branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1514269100
Thanks for your contribution. This is a good beginning. Considering that it's your first contribution, I think we can get deep communication, you can contact me through mail or add WeChat(SbloodyS), when mail or added, please tell me who you are. I think I can help to familiar with the Dolphinscheduler if you meet with problems. @kingbabingge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1514076145
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=13821)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_coverage&view=list) [39.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_duplicated_lines_density&view=list) [4.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] kingbabingge commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "kingbabingge (via GitHub)" <gi...@apache.org>.
kingbabingge commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1497008735
> Please rebase the upstream dev branch.
thinks
I've rebase it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1514073316
## [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/13821?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#13821](https://codecov.io/gh/apache/dolphinscheduler/pull/13821?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7f20ca1) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/51afbfe159260216b806f0c3c3c20648cf01c0ac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (51afbfe) will **decrease** coverage by `0.03%`.
> The diff coverage is `66.66%`.
> :exclamation: Current head 7f20ca1 differs from pull request most recent head 4ded004. Consider uploading reports for the commit 4ded004 to get more accurate results
```diff
@@ Coverage Diff @@
## dev #13821 +/- ##
============================================
- Coverage 38.91% 38.88% -0.03%
- Complexity 4459 4460 +1
============================================
Files 1158 1158
Lines 42418 42420 +2
Branches 4777 4774 -3
============================================
- Hits 16506 16496 -10
- Misses 24095 24106 +11
- Partials 1817 1818 +1
```
| [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/13821?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...dolphinscheduler/plugin/alert/http/HttpSender.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13821?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9kb2xwaGluc2NoZWR1bGVyLWFsZXJ0LXBsdWdpbnMvZG9scGhpbnNjaGVkdWxlci1hbGVydC1odHRwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3BsdWdpbi9hbGVydC9odHRwL0h0dHBTZW5kZXIuamF2YQ==) | `47.76% <66.66%> (+0.06%)` | :arrow_up: |
... and [3 files with indirect coverage changes](https://codecov.io/gh/apache/dolphinscheduler/pull/13821/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #13821: [Fix-13820][alert] Fix bodyParams is empty get error log
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13821:
URL: https://github.com/apache/dolphinscheduler/pull/13821#issuecomment-1514077099
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=13821)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13821&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_coverage&view=list) [39.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_duplicated_lines_density&view=list) [4.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13821&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org