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

Improvements to cache invalidation #133

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jun 19, 2024

Now:

  • If the stack version file is missing, we don't assume the cached files belong to the current stack (since that could cause breakage), and instead invalidate the cache. (The cache actually offers little benefit in practice for this buildpack, so invalidating is cheap.)
  • The whole ${CACHE_DIR}/apt directory is removed rather than only the ${CACHE_DIR}/apt/cache directory. This ensures the APT indexes and other files from old stack versions are cleaned up too.
  • Some build output logs have been adjusted to be more accurate.
  • A test has been added for cache re-use, since it wasn't previously tested.

These papercuts were noticed whilst working on:
heroku/heroku-buildpack-chrome-for-testing#21

GUS-W-16045851.

@edmorley edmorley self-assigned this Jun 19, 2024
@edmorley edmorley force-pushed the edmorley/cache-invalidation-improvements branch 3 times, most recently from 9f2ae86 to 1436a0b Compare June 19, 2024 15:03
@edmorley edmorley marked this pull request as ready for review June 19, 2024 15:04
@edmorley edmorley requested a review from a team as a code owner June 19, 2024 15:04
test/run Outdated Show resolved Hide resolved
@edmorley edmorley force-pushed the edmorley/cache-invalidation-improvements branch 2 times, most recently from b64aa54 to 6a01b3a Compare June 21, 2024 14:07
Now:
- If the stack version file is missing, we don't assume the cached files
  belong to the current stack (since that could cause breakage), and
  instead invalidate the cache. (The cache actually offers little benefit
  in practice for this buildpack, so invalidating is cheap.)
- The whole `${CACHE_DIR}/apt` directory is removed rather than
  only the `${CACHE_DIR}/apt/cache` directory. This ensures the APT
  indexes and other files from old stack versions are cleaned up too.
- Some build output logs have been adjusted to be more accurate.
- A test has been added for cache re-use, since it wasn't previously
  tested.

These papercuts were noticed whilst working on:
heroku/heroku-buildpack-chrome-for-testing#21
@edmorley edmorley force-pushed the edmorley/cache-invalidation-improvements branch from 6a01b3a to 59d347d Compare June 21, 2024 14:12
@edmorley edmorley requested a review from colincasey June 21, 2024 14:20
@edmorley edmorley merged commit dc1102c into master Jun 24, 2024
5 checks passed
@edmorley edmorley deleted the edmorley/cache-invalidation-improvements branch June 24, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants