PrivateStorageio / ZKAPAuthorizer

a Tahoe-LAFS storage-system plugin which authorizes storage operations based on privacy-respecting tokens
10 stars 7 forks source link

Further changes towards a clean strict mypy report #425

Closed exarkun closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #425 (6cdef59) into main (4bbbe04) will decrease coverage by 1.07%. The diff coverage is 94.05%.

@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
- Coverage   96.16%   95.09%   -1.08%     
==========================================
  Files          63       62       -1     
  Lines        7557     8026     +469     
  Branches     1013     1036      +23     
==========================================
+ Hits         7267     7632     +365     
- Misses        218      288      +70     
- Partials       72      106      +34     
Impacted Files Coverage Δ
src/_zkapauthorizer/validators.py 52.54% <63.88%> (-15.20%) :arrow_down:
src/_zkapauthorizer/tests/__init__.py 60.00% <66.66%> (+1.17%) :arrow_up:
src/_zkapauthorizer/recover.py 94.92% <71.42%> (-2.77%) :arrow_down:
src/_zkapauthorizer/_storage_client.py 83.58% <75.00%> (-14.76%) :arrow_down:
src/_zkapauthorizer/sql.py 77.60% <78.26%> (-2.23%) :arrow_down:
src/_zkapauthorizer/_types.py 86.66% <81.81%> (-13.34%) :arrow_down:
src/_zkapauthorizer/resource.py 91.78% <84.61%> (-7.49%) :arrow_down:
src/_zkapauthorizer/tests/fixtures.py 95.40% <88.23%> (-2.22%) :arrow_down:
src/_zkapauthorizer/foolscap.py 95.23% <90.00%> (-4.77%) :arrow_down:
src/_zkapauthorizer/model.py 95.23% <91.66%> (-2.19%) :arrow_down:
... and 54 more

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

exarkun commented 2 years ago

I skipped over this; what I saw looked good to me. It's too much code for me to "read" and grokk in a useful way really.

"Skimmed", maybe? :slightly_smiling_face:

Trying to execute mypy via flakes I currently get:

$ nix --experimental-features 'nix-command flakes' run .#mypy -- src
Success: no issues found in 63 source files

Which seems to be doing what it should.

Thanks for having a look @hacklschorsch . I agree this is too large to be reviewable in any meaningful way. Originally I thought that I might try to split it up after getting to the point where mypy reported no errors. I could do that but I think it would take a while. The changes would need to be landed in some kind of dependency order (roughly a topological ordering of dependencies between types as well as between the expressions that use them). Even computing this order is probably a large project.

So instead I re-reviewed the parts of the branch that could actually change runtime behavior and I'm satisfied that probably those changes mostly improve failure modes. With this, together with your review and green CI (pending ...), I feel okay merging this.