heroku / buildpacks-ruby

Heroku's Cloud Native Buildpack for Ruby applications.
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Shared layer logic for consistent output and unit testing #327

Closed schneems closed 2 weeks ago

schneems commented 3 weeks ago

PR #326 pointed out inconsistencies in the style of output for different layers and asked for additional tests. This refactor makes that request easier by introducing shared logic for invalid metadata and cache invalidation.

It's a ducktyping approach based on two traits:

These allow me to remove the bulk of cache invalidation logic into a central shared location. They also expose a clean interface for unit testing cache invalidation logic, which can then be used on other layers.

I described some of the background desires in #325, comment: https://github.com/heroku/buildpacks-ruby/pull/325#discussion_r1773558240.