-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
The repo:purge_cache
command doesn't actually remove all files from the cache, but tries to preserve anything under vendor/heroku/
:
heroku-repo/commands/purge_cache.js
Lines 21 to 36 in 3e7167d
METADATA="vendor/heroku" | |
if [ -d "$METADATA" ]; then | |
TMPDIR=\`mktemp -d\` | |
cp -rf $METADATA $TMPDIR | |
fi | |
cd .. | |
rm -rf unpack | |
mkdir unpack | |
cd unpack | |
TMPDATA="$TMPDIR/heroku" | |
VENDOR="vendor" | |
if [ -d "$TMPDATA" ]; then | |
mkdir $VENDOR | |
cp -rf $TMPDATA $VENDOR | |
rm -rf $TMPDIR | |
fi |
This was added in:
16b17f3
I believe the intention was to preserve the implicit previous Ruby version, for apps that don't define a specific required version.
However this seems flawed/fragile for a few reasons:
- There isn't a command to unconditionally delete all files for users who really want to.
- It's likely confusing to the user if there's still hidden state preserved after clearing the cache (eg think of the use case of "why doesn't my new stage app or review apps work, my prod app still works after clearing the cache")
- It only helps Ruby apps, and even then only so long as the path for the Ruby metadata doesn't change from
vendor/heroku/
. (Each buildpack does it's own thing, for example Python uses the.heroku/python
directory instead) - Even if the language runtime version is preserved, it doesn't help the user if they haven't pinned eg package deps properly etc.
As such I would propose either:
- Scrapping the partial cache clearing version of the command entirely, and just clearing the whole cache.
- Offering two commands - one that clears the whole cache, and one that tries to preserve certain files. The latter command should be improved to also save the Python/other buildpacks' metadata too.
dmathieutt and kennethreitz
Metadata
Metadata
Assignees
Labels
No labels