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

Support empty binaries in string-based paths #156

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

dumbbell
Copy link
Member

This adds the ability to convert a path such as [<<>>] to a string ("//" in this case).

URIs can have meaningful consecutive forward slashes. We use this to encode empty binaries in string-based paths. This is breaking change because consecutive forward slashes were ignored before.

Here are a few examples:

  • [<<>>] = "//"
  • [<<>>, <<>>] = "///"
  • [foo, <<>>, bar] = "/:foo//:bar"
  • [foo, bar, <<>>] = "/:foo/:bar//

@dumbbell dumbbell added the enhancement New feature or request label Oct 21, 2022
@dumbbell dumbbell self-assigned this Oct 21, 2022
@dumbbell
Copy link
Member Author

FTR, we will use empty binaries in RabbitMQ.

@dumbbell dumbbell added this to the v0.6.0 milestone Oct 21, 2022
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Base: 90.80% // Head: 90.97% // Increases project coverage by +0.17% 🎉

Coverage data is based on head (fbeb0ed) compared to base (99c33da).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   90.80%   90.97%   +0.17%     
==========================================
  Files          16       16              
  Lines        2958     2971      +13     
==========================================
+ Hits         2686     2703      +17     
+ Misses        272      268       -4     
Flag Coverage Δ
erlang-24 89.56% <95.00%> (+0.04%) ⬆️
erlang-25 89.56% <100.00%> (+0.18%) ⬆️
os-ubuntu-latest 90.94% <95.00%> (+0.24%) ⬆️
os-windows-latest 89.36% <100.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
src/khepri_path.erl 96.57% <100.00%> (+0.33%) ⬆️
src/khepri_machine.erl 94.18% <0.00%> (+0.58%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/khepri_path.erl Outdated Show resolved Hide resolved
@dumbbell dumbbell force-pushed the encode-empty-binary-in-path branch 2 times, most recently from 729ee56 to c02bc40 Compare October 26, 2022 08:48
This adds the ability to convert a path such as `[<<>>]` to a string
(`"//"` in this case).

URIs can have meaningful consecutive forward slashes. We use this to
encode empty binaries in string-based paths. This is breaking change
because consecutive forward slashes were ignored before.

Here are a few examples:
* `[<<>>]` = `"//"`
* `[<<>>, <<>>]` = `"///"`
* `[foo, <<>>, bar]` = `"/:foo//:bar"`
* `[foo, bar, <<>>]` = `"/:foo/:bar//`
@dumbbell dumbbell marked this pull request as ready for review October 26, 2022 09:18
@dumbbell dumbbell merged commit 63e09ab into main Oct 26, 2022
@dumbbell dumbbell deleted the encode-empty-binary-in-path branch October 26, 2022 09:20
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.

None yet

2 participants