You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/07/21 01:15:03 UTC

[GitHub] [dolphinscheduler] EricGao888 opened a new issue, #11074: [Doc][Development] Add tips about how to use lombok

EricGao888 opened a new issue, #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
   
   
   ### Description
   
   * Add some tips in docs about how to use `lombok`:
   
   1. Use `lombok` for `setters`, `getters` and `toString` methods in data objects to keep code neat.
   2. Avoid using `@Data` annotation because it will generate some code we may not need, cause the test coverage to decrease and make the `Sonar Analysis` fail for it.
   
   See: https://stackoverflow.com/questions/45569085/sonarqube-bad-coverage-because-of-lombok-data and https://projectlombok.org/features/Data 
   
   ### Documentation Links
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] kezhenxu94 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1200160371

   
   > One possible solution is to create a `lombok.config` file in the root of the project and add the config below:
   > 
   > ```
   > 
   > lombok.addLombokGeneratedAnnotation = true
   > 
   > ```
   > 
   
   This is what I expected. Refer to this file and the related changes if needed https://github.com/apache/skywalking/blob/master/lombok.config


-- 
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 issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1195271183

   I think the second option is more friendly for contributors. So it's better to me.


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1201985256

   closed by: #11212


-- 
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] rickchengx commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
rickchengx commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1191060287

   Hi, @EricGao888 , I'm interested in this issue.


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1201985845

   Hi @rickchengx , next time you submit a pull request, you could add `This PR closes: #xxxxx` so that the related issue will close automatically when PR 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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1195281278

   Sure, seems we have reached a consensus here, then we will take the second one @rickchengx  


-- 
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] rickchengx commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
rickchengx commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1200599834

   > Ref:
   > https://community.sonarsource.com/t/getting-meaningful-coverage-results-in-sonarqube-when-using-jacoco-and-lombok/13821
   > https://projectlombok.org/features/configuration
   
   Thanks a lot.


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1195174214

   We might need some discussions here. Currently there are two potential methods to avoid `sonar` failing for UT coverage decrease caused by `@Data`:
   
   1. Use the method described in this issue.
   2. Keep `@Data` and fix `sonar` instead to exclude code generated by `lombok`
   
   See: https://github.com/apache/dolphinscheduler/pull/11133#issuecomment-1195168073
   
   related: #11133
   


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1200159887

   > Hi, @kezhenxu94 @SbloodyS @EricGao888 So we need to exclude the `Lombok` generated code during the coverage tests and make the code coverage results of `Sonar` more meaningful. One possible solution is to create a `lombok.config` file in the root of the project and add the config below:
   > 
   > ```
   > lombok.addLombokGeneratedAnnotation = true
   > ```
   > 
   > which makes Lombok to add @lombok.Generated annotation to all generated methods so that Jacoco will automatically ignore the lombok auto generated code.
   > 
   > Ref: https://community.sonarsource.com/t/getting-meaningful-coverage-results-in-sonarqube-when-using-jacoco-and-lombok/13821 https://projectlombok.org/features/configuration
   > 
   > WDYT
   
   This method sounds good to me.


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1190928451

   Anyone interested in this issue could comment here to take it. If no one picks it up in 2 weeks, I will take this. Thx : )


-- 
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] github-actions[bot] commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1190927958

   Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can [join our slack](https://s.apache.org/dolphinscheduler-slack) and send your question to channel `#troubleshooting`


-- 
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] kezhenxu94 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1195279083

   Excluding generated codes in coverage should be possible and that's what we should do, i prefer the 2nd way


-- 
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] EricGao888 closed issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 closed issue #11074: [Doc][Development] Add tips about how to use lombok
URL: https://github.com/apache/dolphinscheduler/issues/11074


-- 
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] rickchengx commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
rickchengx commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1200152306

   Hi, @kezhenxu94 @SbloodyS @EricGao888 
   So we need to exclude the `Lombok` generated code during the coverage tests and make the code coverage results of `Sonar` more meaningful.
   One possible solution is to create a `lombok.config` file in the root of the project and add the config below:
   ```
   lombok.addLombokGeneratedAnnotation = true
   ```
   which makes Lombok to add @lombok.Generated annotation to all generated methods so that Jacoco will automatically ignore the lombok auto generated code.
   
   Ref:
   https://community.sonarsource.com/t/getting-meaningful-coverage-results-in-sonarqube-when-using-jacoco-and-lombok/13821
   https://projectlombok.org/features/configuration
   
   WDYT


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1191060185

   Here is an example: https://github.com/apache/dolphinscheduler/pull/11045


-- 
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] EricGao888 commented on issue #11074: [Doc][Development] Add tips about how to use lombok

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on issue #11074:
URL: https://github.com/apache/dolphinscheduler/issues/11074#issuecomment-1195268802

   > We might need some discussions here. Currently there are two potential methods to avoid `sonar` failing for UT coverage decrease caused by `@Data`:
   > 
   > 1. Use the method described in this issue.
   > 2. Keep `@Data` and fix `sonar` instead to exclude code generated by `lombok`
   > 
   > See: [#11133 (comment)](https://github.com/apache/dolphinscheduler/pull/11133#issuecomment-1195168073)
   > 
   > related: #11133
   
   I don't have strong opinions here about which method to take, as long as we stick to one of them to keep consistency. If we agree on taking the second one, we need to fix `sonar` in this issue instead of adding docs and changing CI. WDYT @SbloodyS @kezhenxu94 @rickchengx 


-- 
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