Skip to content

khepri_machine: Fix query/command options filtering for transactions#327

Merged
dumbbell merged 1 commit into
mainfrom
fix-option-filtering-on-txs
Apr 1, 2025
Merged

khepri_machine: Fix query/command options filtering for transactions#327
dumbbell merged 1 commit into
mainfrom
fix-option-filtering-on-txs

Conversation

@dumbbell
Copy link
Copy Markdown
Collaborator

@dumbbell dumbbell commented Apr 1, 2025

Why

We used split_{query,command}_options() to extract relevant options to pass to the transaction implementation. However these split_*() functions are strict and they will raise an exception if a query option is mixed with a command option.

This is impracticle with "auto" transactions that could be queries or writes.

How

In the context of auto transactions, we remove query options before we extract command options, or the opposite. This way, we are sure the the split_*() function will not raise an exception.

@dumbbell dumbbell added the bug Something isn't working label Apr 1, 2025
@dumbbell dumbbell added this to the v0.17.0 milestone Apr 1, 2025
@dumbbell dumbbell self-assigned this Apr 1, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.43%. Comparing base (83dc3bc) to head (8b5ba15).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #327      +/-   ##
==========================================
+ Coverage   89.29%   89.43%   +0.14%     
==========================================
  Files          22       22              
  Lines        3326     3342      +16     
==========================================
+ Hits         2970     2989      +19     
+ Misses        356      353       -3     
Flag Coverage Δ
erlang-26 89.40% <100.00%> (+0.32%) ⬆️
erlang-27 89.22% <100.00%> (+0.05%) ⬆️
os-ubuntu-latest 89.22% <100.00%> (+0.11%) ⬆️
os-windows-latest 89.43% <100.00%> (+0.14%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

[Why]
We used `split_{query,command}_options()` to extract relevant options to
pass to the transaction implementation. However these `split_*()`
functions are strict and they will raise an exception if a query option
is mixed with a command option.

This is impracticle with "auto" transactions that could be queries or
writes.

[How]
In the context of auto transactions, we remove query options before we
extract command options, or the opposite. This way, we are sure the the
`split_*()` function will not raise an exception.
@dumbbell dumbbell force-pushed the fix-option-filtering-on-txs branch from 9a0402d to 8b5ba15 Compare April 1, 2025 14:41
@dumbbell dumbbell marked this pull request as ready for review April 1, 2025 14:42
@dumbbell dumbbell merged commit bf1cad9 into main Apr 1, 2025
22 checks passed
@dumbbell dumbbell deleted the fix-option-filtering-on-txs branch April 1, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant