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

Make #khepri_machine{} private #252

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

dumbbell
Copy link
Member

Why

With the upcoming need to add a field to implement command deduplication, we will have two versions of the record for the machine state.

If we expose the definition, it will be more complicate to track which one we are using.

How

The record definition is moved to src/khepri_machine.erl and made an opaque type.

The module exports functions to access the fields of the record without ever exposing the record itself. Most of these functions were already exported if TEST was defined at compile-time. This is no longer needed.

[Why]
With the upcoming need to add a field to implement command
deduplication, we will have two versions of the record for the machine
state.

If we expose the definition, it will be more complicate to track which
one we are using.

[How]
The record definition is moved to `src/khepri_machine.erl` and made an
opaque type.

The module exports functions to access the fields of the record without
ever exposing the record itself. Most of these functions were already
exported if `TEST` was defined at compile-time. This is no longer
needed.
@dumbbell dumbbell added the enhancement New feature or request label Feb 21, 2024
@dumbbell dumbbell added this to the v0.13.0 milestone Feb 21, 2024
@dumbbell dumbbell self-assigned this Feb 21, 2024
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c49aeba) 89.14% compared to head (9ec1a6c) 89.18%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
+ Coverage   89.14%   89.18%   +0.04%     
==========================================
  Files          20       20              
  Lines        2920     2932      +12     
==========================================
+ Hits         2603     2615      +12     
  Misses        317      317              
Flag Coverage Δ
erlang-24 88.09% <100.00%> (+0.04%) ⬆️
erlang-25 87.96% <100.00%> (-0.13%) ⬇️
erlang-26 88.88% <100.00%> (+0.07%) ⬆️
os-ubuntu-latest 89.18% <100.00%> (+0.07%) ⬆️
os-windows-latest 88.88% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@dumbbell dumbbell marked this pull request as ready for review February 21, 2024 16:04
@dumbbell dumbbell merged commit 1bf8154 into main Feb 21, 2024
12 checks passed
@dumbbell dumbbell deleted the make-khepri_machine-state-private branch February 21, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant