magic-wormhole / magic-wormhole-transit-relay

Transit Relay server for Magic-Wormhole
MIT License
166 stars 42 forks source link

Automat statemachine + refactoring #18

Closed meejah closed 3 years ago

meejah commented 3 years ago

This branch defines an explicit state-machine using Automat and makes some associated re-factors so that the current TCP protocol uses the new state-machine. In principal, this makes it easier to implement #17 (support for WebSockets) which would be a second user of the state-machine.

It is still a draft because:

lgtm-com[bot] commented 3 years ago

This pull request introduces 11 alerts when merging 5552a75575de7959120da40cc87a3cbe473c9fbe into 4f818bb7e0d1a40547855b2958b89161e30c3be1 - view on LGTM.com

new alerts:

codecov[bot] commented 3 years ago

Codecov Report

Merging #18 (ed1025d) into master (46ec26f) will decrease coverage by 1.39%. The diff coverage is 97.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
- Coverage   98.79%   97.39%   -1.40%     
==========================================
  Files           5        6       +1     
  Lines         332      461     +129     
  Branches       47       45       -2     
==========================================
+ Hits          328      449     +121     
- Misses          2        6       +4     
- Partials        2        6       +4     
Impacted Files Coverage Δ
src/wormhole_transit_relay/transit_server.py 93.33% <97.22%> (-5.67%) :arrow_down:
src/wormhole_transit_relay/server_state.py 97.99% <97.99%> (ø)
src/wormhole_transit_relay/server_tap.py 100.00% <100.00%> (ø)

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 46ec26f...ed1025d. Read the comment docs.

lgtm-com[bot] commented 3 years ago

This pull request introduces 5 alerts when merging f8278b9db3da068d103fadc954aa8c9549540a17 into 4f818bb7e0d1a40547855b2958b89161e30c3be1 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

This pull request introduces 5 alerts when merging 5c62ebc3c2f2490eff274964b9d2469ef555584f into 4f818bb7e0d1a40547855b2958b89161e30c3be1 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

This pull request introduces 5 alerts when merging 0130e7551418eb49ecd38f5b7ff89cac84eabe6e into 4f818bb7e0d1a40547855b2958b89161e30c3be1 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

This pull request introduces 5 alerts when merging 9673b74fb373314a7da2f026939dd56c18c977bb into 4f818bb7e0d1a40547855b2958b89161e30c3be1 - view on LGTM.com

new alerts:

meejah commented 3 years ago

Not sure how codecov is computing percentages: there's 1 uncovered line (I think we'd need IOPump to cover it "fairly"...) and I get that as 99% locally..

meejah commented 3 years ago

In an unrelated comment on codecov #twisted-dev suggested maybe it's "because branch coverage" -- and there are indeed a few more uncovered lines if you use --branch but still not enough to get below 99% by my math.

lgtm-com[bot] commented 3 years ago

This pull request introduces 5 alerts when merging ed1025d12c7efecc2abe7eb3affafe80817e8d62 into 4f818bb7e0d1a40547855b2958b89161e30c3be1 - view on LGTM.com

new alerts:

meejah commented 3 years ago

I wonder if there's some way to get LGTM to ignore zope-interface things?