Skip to content
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

Add unit of work #52

Merged
merged 13 commits into from
Oct 24, 2023
Merged

Conversation

christoph-blessing
Copy link
Member

This PR adds the unit of work which governs if and when operations applied to a link are persisted.

Before:

link = gateway.create_link()
result = link.apply(Operations.START_PULL, requested=requested)
gateway.apply(result.updates)
result = link.apply(Operations.PROCESS, requested=requested)
gateway.apply(result.updates)

After:

with uow:
    uow.link.apply(Operations.START_PULL, requested=requested)
    uow.link.apply(Operations.PROCESS, requested=requested)
    uow.commit()

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (705da2d) 98.72% compared to head (508f348) 98.32%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   98.72%   98.32%   -0.41%     
==========================================
  Files          23       24       +1     
  Lines         785      894     +109     
  Branches       95      109      +14     
==========================================
+ Hits          775      879     +104     
- Misses          4        8       +4     
- Partials        6        7       +1     
Files Coverage Δ
link/infrastructure/link.py 97.36% <100.00%> (+0.14%) ⬆️
link/service/services.py 100.00% <100.00%> (ø)
link/service/uow.py 100.00% <100.00%> (ø)
link/domain/link.py 97.29% <92.00%> (-2.71%) ⬇️
link/domain/state.py 96.45% <94.11%> (-1.95%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@christoph-blessing christoph-blessing merged commit ba9e0bb into sinzlab:main Oct 24, 2023
6 of 8 checks passed
@christoph-blessing christoph-blessing deleted the unit_of_work branch October 24, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant