set `Custom-Time` metadata on GCS cache object when retrieving
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
When bazel retrieves an object from GCS cache bucket, set the [Custom-Time](https://cloud.google.com/storage/docs/metadata#custom-time) metadata on the object to the datetime of the retrieval.
### Which category does this issue belong to?
Remote Execution
### What underlying problem are you trying to solve with this feature?
Would like to use the GCS lifecycle condition [daysSinceCustomTime](https://cloud.google.com/storage/docs/lifecycle#dayssincecustomtime) to delete objects that are not recently retrieved to keep the bucket size down and reduce storage costs.
Note: the [age](https://cloud.google.com/storage/docs/lifecycle#age) lifecycle condition does not exactly do this because it is triggered in days from creation, not retrieval.
### Which operating system are you running Bazel on?
linux
### What is the output of `bazel info release`?
_No response_
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
Thoughts on implementation: the `daysSinceCustomTime` is very coarse and so it may not be important to set `Custom-Time` very precisely. Perhaps rounding retrieval datetime to the nearest hour and if the `Custom-Time` on a retrieved object is already set to that hour, then no need to set it again.
Contributor guide
Assessment
This issue has not been assessed yet.