casbin / jcasbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Java
https://casbin.org
Apache License 2.0
2.4k stars 464 forks source link

feat: update WatcherEx interface #342

Closed PokIsemaine closed 1 year ago

PokIsemaine commented 1 year ago

feat: update WatcherEx interface a part of https://github.com/casbin/jcasbin/issues/340

casbin-bot commented 1 year ago

@tangyang9464 @imp2002 please review

codecov-commenter commented 1 year ago

Codecov Report

Merging #342 (cd02491) into master (b8df7d8) will decrease coverage by 0.05%. The diff coverage is 42.42%.

@@            Coverage Diff             @@
##           master     #342      +/-   ##
==========================================
- Coverage   69.33%   69.28%   -0.05%     
==========================================
  Files          48       49       +1     
  Lines        2214     2230      +16     
  Branches      409      405       -4     
==========================================
+ Hits         1535     1545      +10     
- Misses        561      570       +9     
+ Partials      118      115       -3     
Impacted Files Coverage Δ
...java/org/casbin/jcasbin/main/InternalEnforcer.java 49.07% <17.39%> (-1.88%) :arrow_down:
...ain/java/org/casbin/jcasbin/persist/WatcherEx.java 100.00% <100.00%> (ø)

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

PokIsemaine commented 1 year ago

need some suggestions about codeclimate. I tried refactoring three versions and none of them passed codeclimate image

The problem goes back and forth between similar blocks of code and the function being too complex. Because I tried to reduce similar code blocks and extracted a notifyWatcher function, but it seems easy to complicate (for codeclimate)

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.33.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: