pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 4 forks source link

[Q] Explain the cache invalidation mechanism #233

Closed webknjaz closed 1 month ago

webknjaz commented 1 month ago

So I have a case where I added an unversioned Git reference into additional_depenencies (as in pkg-name @ git+https://github.com/owner/repo.git). The dependency changed and pre-commit.ci is still fetching the old one. I don't care too much about updating the dependency often at this point, so I don't want to look into pinning the commit hashes there. But I did want to ask about a few related things.

1) Does pre-commit.ci cache get invalidated after a certain period of time, or is it effectively immortal? 2) Is migrating to pre-commit-ci/lite-action the recommended way of dealing with the cache control? Have you considered having some sort of a cache-version key in the config that could contribute to the computed cache key, effectively letting people reset the cache instead of updating the additional_dependencies list?

asottile commented 1 month ago

the cache invalidation is the same as pre-commit. "moving" dependencies are not supported by pre-commit https://pre-commit.com/#using-the-latest-version-for-a-repository

moving to lite-action might work but you're still in unsupported and not recommended territory