This feature request arises from the response to this question: https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/Can-a-dependency-cache-cause-incorrect-builds/qaq-p/1116127
The proposed feature would allow a given dependency cache to be linked to a file in the repository such that if there are any changes to that file in the current commti, the associated cache is cleared before any pipeline steps start.
I see two options for how to implement this;
Option 1: In the bitbucket-pipelines.yml file
One drawback of this approach is that there is no obvious way to associate a file with a pre-defined cache (i.e. I want to invalidate the default node cache based on package-lock.json). Maybe could get round this issue with this (no directory is specified);
Option 2: Create a new configuration page in the web interface
The contents of the page would be a form-based version of the settings proposed in Option 1 above. This option would perhaps make it easier to manage the contrasts between pre-defined caches and custom caches.
I think I’d prefer option 1 but without knowing more about the underlying architecture of Pipelines I can't know if either option is significant harder to implement.