add feature , request can be handle by self-defined class#3377
add feature , request can be handle by self-defined class#3377little-cui merged 13 commits intoapache:masterfrom
Conversation
| private String profileValues; | ||
|
|
||
| private String profileExtractClass; |
There was a problem hiding this comment.
I think it is not a good idea to create these two properties here. We need to keep the specification clear and clarity, see https://github.com/huaweicloud/spring-cloud-huawei/wiki/using-governance
First of all, we should keep the specification language independent. For your requirement, I think you can add this logic when you create your governance request, and set the header you need.
| public Object getSourceRequest() { | ||
| return sourceRequest; | ||
| } | ||
|
|
||
| public void setSourceRequest(Object sourceRequest) { | ||
| this.sourceRequest = sourceRequest; | ||
| } |
There was a problem hiding this comment.
This property will make design not specific and not descriptive, I think this is not good extension.
There was a problem hiding this comment.
I don't think it's reasonable to treat the sourceRequest as a Object.
If it just a URI, we can change the Object to String.
|
Can you create a issue on why you add this feature? and maybe we have other ways to implement your feature. Your PR seems not very good for a framework extension. |
governance/src/main/java/org/apache/servicecomb/governance/marker/RequestProcessor.java
Show resolved
Hide resolved
governance/src/main/java/org/apache/servicecomb/governance/utils/CustomMatch.java
Show resolved
Hide resolved
governance/src/main/java/org/apache/servicecomb/governance/marker/CustomMatcher.java
Show resolved
Hide resolved
| public Object getSourceRequest() { | ||
| return sourceRequest; | ||
| } | ||
|
|
||
| public void setSourceRequest(Object sourceRequest) { | ||
| this.sourceRequest = sourceRequest; | ||
| } |
There was a problem hiding this comment.
I don't think it's reasonable to treat the sourceRequest as a Object.
If it just a URI, we can change the Object to String.
governance/src/main/java/org/apache/servicecomb/governance/marker/RequestProcessor.java
Show resolved
Hide resolved
governance/src/test/java/org/apache/servicecomb/governance/CustomMatchTest.java
Show resolved
Hide resolved
governance/src/test/java/org/apache/servicecomb/governance/CustomMatchTest.java
Outdated
Show resolved
Hide resolved
governance/src/test/java/org/apache/servicecomb/governance/mockclasses/ClassNotImplments.java
Show resolved
Hide resolved
governance/src/test/java/org/apache/servicecomb/governance/mockclasses/ClassWithAnnotation.java
Show resolved
Hide resolved
governance/src/test/java/org/apache/servicecomb/governance/mockclasses/CustomMatchDemo.java
Show resolved
Hide resolved
...org/apache/servicecomb/governance/mockclasses/service/MockConfigurationForCustomMatcher.java
Show resolved
Hide resolved
.../java/org/apache/servicecomb/governance/mockclasses/service/MockProfileClassUserService.java
Show resolved
Hide resolved
| public interface CustomMatch { | ||
| String errorMessageForNotImplements = " didn't implement interface org.apache.servicecomb.governance.utils.CustomMatch"; | ||
| String errorMessageForAbstractClass = " should be a instantiable class rather than abstract class or other else"; | ||
| String infoMessageForCreatingClass = "is not in spring container, create one and register it to spring container"; |
There was a problem hiding this comment.
If we don't let the user to use this constant string, it's better just put them into the log method.
Codecov Report
@@ Coverage Diff @@
## master #3377 +/- ##
============================================
- Coverage 77.57% 77.55% -0.02%
- Complexity 1462 1463 +1
============================================
Files 1650 1651 +1
Lines 43772 43860 +88
Branches 3685 3693 +8
============================================
+ Hits 33955 34016 +61
- Misses 8280 8306 +26
- Partials 1537 1538 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
* add feature , request can be handle by self-defined class * refactor for advice * refactor for advice * refactor for advice * refactor for advice * add apache license information for file header * fix issue * rename function * modify for suggestion * modify for suggession * modify for suggestion * resolv checkstyle issue * fix issue
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles, where you replaceSCB-XXXwith the appropriate JIRA issue.mvn clean install -Pitto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.