Skip to content

Conversation

yuz10
Copy link
Member

@yuz10 yuz10 commented Aug 20, 2021

Make sure set the target branch to develop

What is the purpose of the change

#3281 fix fail to delete topic perm list

#3128 still cant delete global white address
- the pr #3132 missed the client side, and its still sending null, resulting in global white address not updated

#3177 updateAclConfig in all brokers
- the pr #3184 only chages updateAclConfig, missed deleteAccessConfig and updateGlobalWhiteAddr

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@yuz10 yuz10 changed the title [ISSUE #3177 #3128][acl] fix fail to delete topic perm list and #3128 still cant delete global white address, and #3177 updateAclConfig in all brokers [ISSUE #3281 #3177 #3128][acl] fix fail to delete topic perm list and #3128 still cant delete global white address, and #3177 updateAclConfig in all brokers Aug 20, 2021
@coveralls
Copy link

coveralls commented Aug 20, 2021

Coverage Status

Coverage increased (+0.08%) to 54.304% when pulling f9f432a on yuz10:develop into 2cac866 on apache:develop.

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2021

Codecov Report

Merging #3280 (f9f432a) into develop (7c7e9ac) will increase coverage by 0.05%.
The diff coverage is 75.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3280      +/-   ##
=============================================
+ Coverage      48.02%   48.08%   +0.05%     
- Complexity      4564     4575      +11     
=============================================
  Files            552      552              
  Lines          36536    36589      +53     
  Branches        4822     4826       +4     
=============================================
+ Hits           17546    17592      +46     
- Misses         16768    16773       +5     
- Partials        2222     2224       +2     
Impacted Files Coverage Δ
...ocketmq/broker/processor/AdminBrokerProcessor.java 7.92% <0.00%> (ø)
...che/rocketmq/acl/plain/PlainPermissionManager.java 71.87% <100.00%> (+3.12%) ⬆️
...g/apache/rocketmq/client/impl/MQClientAPIImpl.java 12.18% <100.00%> (ø)
.../main/java/org/apache/rocketmq/common/UtilAll.java 41.21% <100.00%> (+0.95%) ⬆️
...rg/apache/rocketmq/common/stats/StatsSnapshot.java 84.61% <0.00%> (-15.39%) ⬇️
...in/java/org/apache/rocketmq/test/util/MQAdmin.java 38.88% <0.00%> (-5.56%) ⬇️
...va/org/apache/rocketmq/common/stats/StatsItem.java 50.00% <0.00%> (-5.00%) ⬇️
...org/apache/rocketmq/common/stats/StatsItemSet.java 41.79% <0.00%> (-2.99%) ⬇️
...a/org/apache/rocketmq/store/StoreStatsService.java 29.50% <0.00%> (-0.66%) ⬇️
...ocketmq/broker/processor/SendMessageProcessor.java 39.74% <0.00%> (-0.53%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c7e9ac...f9f432a. Read the comment docs.

@zongtanghu
Copy link
Contributor

Can you resolve the codes' conflicts in your local enviroments. @yuz10

@yuz10
Copy link
Member Author

yuz10 commented Aug 23, 2021

resolved. @zongtanghu

@yuz10 yuz10 requested a review from zongtanghu August 24, 2021 03:43
@zongtanghu
Copy link
Contributor

I see the travis ci test failed. Please check the reason of travis ci failed. @yuz10

@yuz10
Copy link
Member Author

yuz10 commented Aug 27, 2021

I see the travis ci test failed. Please check the reason of travis ci failed. @yuz10

The tests are fixed

@vongosling
Copy link
Member

@yuz10 Generally speaking, one pr solves the one issue. I am confused by your topic. could you clarify why you involve a big pr to solve so many problems, although I see we really have many problems in the ACL module?

@yuz10
Copy link
Member Author

yuz10 commented Aug 27, 2021

@vongosling UtilAll.string2List is invoked by both topicPerms and globalWhiteAddrs,and modify the function can solve two issue s. The other issue, "updateAclConfig in all brokers" can be seperated, If you request

@yuz10 yuz10 changed the title [ISSUE #3281 #3177 #3128][acl] fix fail to delete topic perm list and #3128 still cant delete global white address, and #3177 updateAclConfig in all brokers [ISSUE #3281 ][acl] fix fail to delete topic perm list and global white address(#3128) Aug 27, 2021
@vongosling
Copy link
Member

vongosling commented Aug 27, 2021

I hope to see changes to UtilAll class, and you'll have a new idea right away. That's we could gradually strip out some of the cohesive functions to form new proprietary tool classes :-) We don't need such a God class, string2list is also confused :-(

@yuz10
Copy link
Member Author

yuz10 commented Aug 27, 2021

@vongosling I have removed some confusing functions from the UtilAll class.

@vongosling vongosling added this to the 4.9.2 milestone Aug 28, 2021
Comment on lines 2267 to 2280
private static String join(List<String> list, String splitter) {
if (list == null) {
return null;
}
StringBuilder str = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
str.append(list.get(i));
if (i == list.size() - 1) {
break;
}
str.append(splitter);
}
return str.toString();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe, you put this function into UtilAll or AclUtils class is better!

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your advice, I have moved this two functions to UtilAll

Comment on lines 1633 to 1640
private static List<String> split(String str, String splitter) {
if (str == null) {
return null;
}

String[] addrArray = str.split(splitter);
return Arrays.asList(addrArray);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The code-review advice is the same as anthor one.

@zongtanghu
Copy link
Contributor

And you need to notice the coverage decrease issues!Maybe, add some more unit test case codes.

@vongosling vongosling added the progress/wip Work in progress. Accept or refused to be continue. label Sep 8, 2021
@vongosling vongosling merged commit 147d23e into apache:develop Sep 14, 2021
@francisoliverlee francisoliverlee changed the title [ISSUE #3281 ][acl] fix fail to delete topic perm list and global white address(#3128) [ISSUE #3281]fix fail to delete topic perm list and global white address(#3128) Oct 11, 2021
GenerousMan pushed a commit to GenerousMan/rocketmq that referenced this pull request Aug 12, 2022
…al white address(apache#3128) (apache#3280)

* fix fail to remove topic/group permissions and global white address of acl config

* update acl config for all brokers

* refactor rename UtilAll.string2List and list2String

* fix fail to remove whiteRemoteAddress of acl config
carlvine500 pushed a commit to carlvine500/rocketmq-apache that referenced this pull request Sep 10, 2024
…al white address(apache#3128) (apache#3280)

* fix fail to remove topic/group permissions and global white address of acl config

* update acl config for all brokers

* refactor rename UtilAll.string2List and list2String

* fix fail to remove whiteRemoteAddress of acl config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
progress/wip Work in progress. Accept or refused to be continue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants