I’m working on upgrading our pants version to 2.27...
# general
f
I’m working on upgrading our pants version to 2.27.0. It had been at 2.23. We are using ruff for linting/formatting. And, have a github action using
pants-init
My issue is that
pants lint ::
is catching errors in the github action, but not on my local machine. Any suggestions on tracking this discrepancy down?
f
Is the configuration the same in CI and locally? E.g., is there a
pants.ci.toml
in place (assuming you are using the init-pants GHA action)?
f
yes, using init-pants, but using the same pants.toml
f
Maybe Pants is seeing cached results? You can dump the monitoring counters with the
--stats-log
option which will include cache hit / miss counts.
Theory: CI is not seeing cache hits so it actually runs the lint tasks, while local runs are seeing caching.
Quick fix locally is to wipe the Pants local cache with a
rm -rf ~/.cache/pants/lmdb_store
but that should be a last resort.
Assuming that caching at issue, I'd rather understand what has changed that is not part of the relevant cache key. (But I'm getting ahead of the issue. I'd like to know if caching is at issue here.)
f
Before I saw your message, I decided it was a local state issue. So, I closed and restarted VSCode and of course it started working.
pants lint --stats-log ::
gave me all zeros when I tried it after the restart. Somehow the cache got reset. The project is in a devcontainer. I didn’t rebuild the container, so since ~/.cache is in the image, in principle the cache should be the same after the restart. So, I’m going to chalk it up to more weird docker file system nonsense. Thanks for the prompts.