-
Notifications
You must be signed in to change notification settings - Fork 527
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
fix: 🐛 [frontend-gray] 修复 请求非首页资源时候,路由配置 #1353
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1353 +/- ##
==========================================
+ Coverage 35.91% 44.25% +8.34%
==========================================
Files 69 76 +7
Lines 11576 9895 -1681
==========================================
+ Hits 4157 4379 +222
+ Misses 7104 5182 -1922
- Partials 315 334 +19 |
deployment = util.FilterGrayWeight(&grayConfig, preVersion, preUniqueClientId, uniqueClientId) | ||
} else { | ||
deployment = util.FilterGrayRule(&grayConfig, grayKeyValue) | ||
} | ||
log.Infof("index deployment: %v, path: %v, backend: %v, xPreHigressVersion: %s,%s", deployment, path, deployment.BackendVersion, preVersion, preUniqueClientId) | ||
} else { | ||
deployment = util.GetVersion(grayConfig, deployment, preVersion, isPageRequest) | ||
grayDeployment := deployment | ||
if deployment.Version == "" { |
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.
这个地方 deployment.Version
可能不是空吗?
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.
我捋一下这段的逻辑哦。
- 如果是页面请求:
- 如果配了权重,就按权重选择目标版本
- 如果没配权重,就按规则选择目标版本
- 这里不考虑当前请求中是否包含灰度 Cookie
- 如果不是页面请求:
- 不看权重,只按规则选择目标版本
- 如果 Cookie 中包含当前灰度版本信息,则优先选择 Cookie 中声明的版本
请问我理解的对吗?
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.
这个地方
deployment.Version
可能不是空吗?
可能的 ,因为有可能不经过首页html。直接访问 .css这样的文件,灰度规则会失效
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.
我捋一下这段的逻辑哦。
如果是页面请求:
- 如果配了权重,就按权重选择目标版本
- 如果没配权重,就按规则选择目标版本
- 这里不考虑当前请求中是否包含灰度 Cookie
如果不是页面请求:
- 不看权重,只按规则选择目标版本
- 如果 Cookie 中包含当前灰度版本信息,则优先选择 Cookie 中声明的版本
请问我理解的对吗?
是的,有Cookie的话,就认为是 页面请求种下的Cookie,这样可以做请求黏贴。
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.
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.
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.
LGTM
[bugfix] 修复 请求非首页资源时候,路由配置