Skip to content

Commit

Permalink
Update byte-unit dependency with breaking changes
Browse files Browse the repository at this point in the history
Byte unit 4 broke a lot of interfaces that we depended on. This commit uses the new interfaces:

- Byte::from_bytes -> Byte::from_<type> (like Byte::from_u64)
- Byte.get_appropriate_unit(bool) -> Byte.get_appropriate_unit(UnitType)
- macros such as `n_mib_bytes` are no longer present.

This has one (technically) breaking change in the `mib` convenience function provided by commons. However if a literal is being used in the code (which it is in the Ruby main.rs) then it is not affected.

Even though lots of things changed internally, the overall interface to AppCache stayed (almost) stable and no code inside of the main buildpack needed to be updated. That indicates a relatively successful encapsulation attempt.

Moving forward it would be best to not directly rely on types from external crates but rather to provide new type interfaces for them so we have control over the API and therefore stability.
  • Loading branch information
schneems committed Oct 1, 2024
1 parent da9c2ff commit 1370df3
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 33 deletions.
Loading

0 comments on commit 1370df3

Please sign in to comment.