Skip to content

add feature , request can be handle by self-defined class#3377

Merged
little-cui merged 13 commits intoapache:masterfrom
gudelian941:governance_enhancement
Oct 14, 2022
Merged

add feature , request can be handle by self-defined class#3377
little-cui merged 13 commits intoapache:masterfrom
gudelian941:governance_enhancement

Conversation

@gudelian941
Copy link
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install -Pit to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Comment on lines +26 to +28
private String profileValues;

private String profileExtractClass;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +113 to +119
public Object getSourceRequest() {
return sourceRequest;
}

public void setSourceRequest(Object sourceRequest) {
this.sourceRequest = sourceRequest;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property will make design not specific and not descriptive, I think this is not good extension.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@liubao68
Copy link
Contributor

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.

Comment on lines +113 to +119
public Object getSourceRequest() {
return sourceRequest;
}

public void setSourceRequest(Object sourceRequest) {
this.sourceRequest = sourceRequest;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't let the user to use this constant string, it's better just put them into the log method.

@codecov-commenter
Copy link

Codecov Report

Merging #3377 (1a470e6) into master (6d20460) will decrease coverage by 0.01%.
The diff coverage is 70.90%.

@@             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     
Impacted Files Coverage Δ
...rvicecomb/governance/marker/GovernanceRequest.java 81.81% <0.00%> (-12.92%) ⬇️
...ervicecomb/governance/marker/RequestProcessor.java 81.25% <69.04%> (-13.63%) ⬇️
...e/servicecomb/governance/marker/CustomMatcher.java 100.00% <100.00%> (ø)
.../apache/servicecomb/governance/marker/Matcher.java 100.00% <100.00%> (ø)
...thentication/consumer/RSAConsumerTokenManager.java 70.96% <0.00%> (-6.46%) ⬇️
...ervicecomb/common/rest/AbstractRestInvocation.java 87.91% <0.00%> (-4.69%) ⬇️
...mb/config/ConfigCenterConfigurationSourceImpl.java 9.57% <0.00%> (-1.07%) ⬇️
...cecomb/serviceregistry/auth/TokenCacheManager.java 13.04% <0.00%> (-1.02%) ⬇️
...g/apache/servicecomb/edge/core/EdgeInvocation.java 5.12% <0.00%> (-0.14%) ⬇️
...ache/servicecomb/router/cache/RouterRuleCache.java 58.13% <0.00%> (ø)
... and 8 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@little-cui little-cui merged commit 7e661e3 into apache:master Oct 14, 2022
lbc97 pushed a commit to lbc97/servicecomb-java-chassis that referenced this pull request Feb 21, 2023
* 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
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.

6 participants