Skip to content

khepri_evf: Add event_filter_or_compat() type#346

Merged
dumbbell merged 3 commits into
v0.17.xfrom
fix-event_filter-type-spec
Sep 9, 2025
Merged

khepri_evf: Add event_filter_or_compat() type#346
dumbbell merged 3 commits into
v0.17.xfrom
fix-event_filter-type-spec

Conversation

@dumbbell
Copy link
Copy Markdown
Collaborator

@dumbbell dumbbell commented Sep 9, 2025

Why

Before, khepri_evf:wrap/{1,2} and all users of khepri_evf:event_filter() were specifying the compatible types as well, i.e. a Khepri path pattern, a string, and so on.

This list of compatible types was inconsistent and sometimes incomplete.

How

With the new event filter types coming in a future version of Khepri, let's add an event_filter_or_compat() type which encapsulates the event_filter() type and all compatible types that can be wrapped into/converted to an event filter automatically.

While here, improve a new macros to correcly check a Khepri path or path pattern in a guard expression.

[Why]
This ensures that all public types are correctly exported.
[Why]
`string()` is already included in `khepri_path:pattern()`.

Also, `khepri_path:pattern()` includes `binary()` which was missing to
be consistent.
[Why]
Before, `khepri_evf:wrap/{1,2}` and all users of
`khepri_evf:event_filter()` were specifying the compatible types as
well, i.e. a Khepri path pattern, a string, and so on.

This list of compatible types was inconsistent and sometimes incomplete.

[How]
With the new event filter types coming in a future version of Khepri,
let's add an `event_filter_or_compat()` type which encapsulates the
`event_filter()` type and all compatible types that can be
wrapped into/converted to an event filter automatically.

While here, improve a new macros to correcly check a Khepri path or path
pattern in a guard expression.
@dumbbell dumbbell added this to the v0.17.2 milestone Sep 9, 2025
@dumbbell dumbbell self-assigned this Sep 9, 2025
@dumbbell dumbbell added the documentation Improvements or additions to documentation label Sep 9, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.37%. Comparing base (23d76c5) to head (739ac8a).
⚠️ Report is 4 commits behind head on v0.17.x.

Additional details and impacted files
@@             Coverage Diff             @@
##           v0.17.x     #346      +/-   ##
===========================================
+ Coverage    86.08%   86.37%   +0.28%     
===========================================
  Files           22       22              
  Lines         3450     3450              
===========================================
+ Hits          2970     2980      +10     
+ Misses         480      470      -10     
Flag Coverage Δ
erlang-26 86.00% <ø> (-0.06%) ⬇️
erlang-27 86.34% <ø> (+0.31%) ⬆️
erlang-28 86.31% <ø> (+0.26%) ⬆️
os-ubuntu-latest 86.08% <ø> (+0.02%) ⬆️
os-windows-latest 86.34% <ø> (+0.26%) ⬆️

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.

@dumbbell dumbbell marked this pull request as ready for review September 9, 2025 09:32
@dumbbell dumbbell merged commit e4e7817 into v0.17.x Sep 9, 2025
26 checks passed
@dumbbell dumbbell deleted the fix-event_filter-type-spec branch September 9, 2025 09:32
@dumbbell dumbbell modified the milestones: v0.17.2, v0.17.3 Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant