-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 auth plugin Page #11300
fix auth plugin Page #11300
Conversation
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.
CI not passed
本次修改没有修改到core模块哦。 Ci异常是某个测试类没有通过。 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #11300 +/- ##
=============================================
- Coverage 58.42% 57.62% -0.80%
- Complexity 5752 6429 +677
=============================================
Files 885 1059 +174
Lines 27356 31354 +3998
Branches 2890 3243 +353
=============================================
+ Hits 15982 18067 +2085
- Misses 10156 11974 +1818
- Partials 1218 1313 +95
... and 259 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
其他的CI可以通过,只有你修改后的PR不通过的话, 应该是修改的地方间接影响到了对应的UT,需要修复代码。而不是直接改UT |
1.我需要确认,我未提交PR之前。这两个DefaultTlsContextBuilderTest,DefaultTlsProtocolNegotiatorBuilderTest是否能正常运行? |
DefaultTlsContextBuilderTest.java 这个文件在另外一个PR合并了, 这个PR应该rebase一下develop分支。 |
6debecf
to
4225891
Compare
This reverts commit 4225891.
done |
* | ||
* @author hkm | ||
*/ | ||
public class DialectFactory { |
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.
这个设计不太好, 实际上数据源已经插件化, 不应该强制感知数据库类型,如果需要类似Dialect的东西, 最好在插件测实现。
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.
可以看下 datasource-plugin模块
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.
这个设计不太好, 实际上数据源已经插件化, 不应该强制感知数据库类型,如果需要类似Dialect的东西, 最好在插件测实现。
我也有思考过这个问题。
- 现在persistence 模块 是单独存在的,不依赖于 datasource-plugin模块。
- 但是PaginationHelper类这个分页是写在persistence模块下的。 如果不在persistence 模块下做数据分页查询条件的适配的话,更换数据源,会导致那么用户、角色等分页查询失效。
- 我认为现在最小的改动,就是在persistence 下将nacos所有支持的数据源类型,对应分页查询条件补齐Dialect类型。
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.
或者说 PaginationHelper 目前只支持实现类:
- ExternalStoragePaginationHelperImpl-mysql 、
- EmbeddedPaginationHelperImpl-derby。
- 后续继续增加实现类。xxxxHelperImpl-xxx。
已这种方式来弥补分页失效的问题。
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.
- 如果选择 DialectFactory 的方式。我可以补充好其他数据源的数据类型 ,继续PR。
- 或者说有更好的方式,我将关闭PR。
数据库类型的感知应该有datasource插件来做, 如果你需要加这个Dialect来进行分页的辅助,需要在不同的插件实现中进行实现,而不是把所有数据库的实现都放在nacos中来做。 |
像 auth这个模块,不依赖于 datasource插件,要使用分页查询。 又该如何实现? 比如下面这个接口: |
在auth模块自己实现,auth模块甚至可以使用jpa直接替换persistence service |
插件之间不应该互相依赖和影响。 |
|
|
PaginationHelper 可以作为基础接口,但是不管实现。 Dialect既然是适配的实现,就应该在实现的插件里面去实现, 插件管理器不应该有。if是a插件,if是b插件的逻辑,就应该是getDialect,然后Dialect.xxx(). |
|
|
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.
|
* Optimize paginated queries based on data sources * add startup conditions * user movkEnv * update Exception Class name * Optimize paginated queries based on data sources * update Exception Class name * Revert "add startup conditions" This reverts commit 4e2c85d * Optimize paginated queries based on data sources * add startup conditions * user movkEnv * update Exception Class name * Revert "add startup conditions" This reverts commit 4e2c85d * Revert "Revert "add startup conditions"" This reverts commit 4225891. * DialectFactory add database supported * fix auth plugin Page, add dataSource plugin Dialect * description * remove dataSource plugin Dialect * detail adjustment * DefaultPageHandlerAdapter
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
#11299
1.修复auth模块用户,角色,权限查询分页失效的问题。
Brief changelog
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.