-
Notifications
You must be signed in to change notification settings - Fork 930
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
Ftr: [refer dubbo 2.7.6] attachment type from map[string]stiring to map[string]interface{} #713
Conversation
… invocation and result
… invocation and result
… invocation and result
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.
Travis still failing, check it again pls.
Thanks.
先等另外一个pr review通过之后,我修改下依赖,来跑CI。 因为两个pr有依赖。 |
ok,thanks a lot |
require ( | ||
github.com/apache/dubbo-go-hessian2 v1.6.0-rc1.0.20200819060303-9b32032784f6 | ||
) | ||
|
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.
这个是为了跑通集成测试,等hessian发布最新版本之后,可以删除。
@joeyzhouy zhou 帮忙协调下review。 |
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.
这里还没有调整,这里要评估下之前用户通过ctx传进的map[string]string的attachment
这个暂时不要动吧。 面向应用开发者还是不动先,面向框架扩展的得升级。 |
common/proxy/proxy_test.go
Outdated
@@ -19,6 +19,8 @@ package proxy | |||
|
|||
import ( | |||
"context" | |||
hessian "github.com/apache/dubbo-go-hessian2" |
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.
OMG. move it to the second import block, pls.
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.
done
protocol/dubbo/dubbo_invoker.go
Outdated
@@ -19,14 +19,14 @@ package dubbo | |||
|
|||
import ( | |||
"context" | |||
"github.com/opentracing/opentracing-go" |
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.
move this into github.com imports.
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.
done
protocol/invocation.go
Outdated
Attachments() map[string]string | ||
// AttachmentsByKey gets attachment by key , if nil then return default value | ||
Attachments() map[string]interface{} | ||
// AttachmentsByKey gets attachment by key , if nil then return default value. (It will be discarded) |
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.
change it to 'deprecated in the future'?
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.
done
@@ -151,6 +151,10 @@ func (p *Proxy) Implement(v common.RPCService) { | |||
for k, value := range m { | |||
inv.SetAttachments(k, value) | |||
} | |||
} else if m2, ok2 := atm.(map[string]interface{}); ok2 { |
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.
we'd better leave some comments here so that others can understand the context better.
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.
done
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.
done
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.
IMO, the comment should be aligned with the else branch in the same line or under the else branch if it is too long.
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.
done
d0286be
to
f7440be
Compare
@@ -151,6 +151,10 @@ func (p *Proxy) Implement(v common.RPCService) { | |||
for k, value := range m { | |||
inv.SetAttachments(k, value) | |||
} | |||
} else if m2, ok2 := atm.(map[string]interface{}); ok2 { |
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.
IMO, the comment should be aligned with the else branch in the same line or under the else branch if it is too long.
|
||
package dubbo | ||
|
||
import ( |
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.
pls do not place dubbo-go package and other packages in the same import block.
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.
done
protocol/dubbo/hessian2/const.go
Outdated
ErrIllegalPackage = perrors.New("illegal package!") | ||
) | ||
|
||
// DescRegex ... |
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.
pls add comment. If u do not wanna add comment, use "// nolint" instead.
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.
done
PackageType_BitSize = 0x2f | ||
) | ||
|
||
// PackageType ... |
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.
pls add comment. If u do not wanna add comment, use "// nolint" instead.
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.
done
…ap[string]interface{} (apache#713) * support attachment from map[sting]string to map[string]interface{} in invocation and result # Conflicts: # cluster/router/tag/tag_router.go
…ap[string]interface{} (#713) * support attachment from map[sting]string to map[string]interface{} in invocation and result # Conflicts: # cluster/router/tag/tag_router.go
…ap[string]interface{} (apache#713) * support attachment from map[sting]string to map[string]interface{} in invocation and result
1.attachment类型从attachment type from map[string]stiring 到 map[string]interface{} ,和dubbo java对齐
2.功能分成两部分,一部分会在dubbo-go里提交,一部分需要修改hessian.
dubbo-go-hessian :apache/dubbo-go-hessian2#218
这个pr依赖dubbo-go-hessian merge完成之后,修改依赖的版本之后,才能通过CI。提交上来是为了方便review的时候一起看。
先忽略CI