-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] Cleanup caches in the target repo #1758
Conversation
We may want to clear all caches once this is merged. I can do that if fine with you @louwers. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1758 +/- ##
==========================================
+ Coverage 85.78% 85.80% +0.02%
==========================================
Files 566 566
Lines 27815 27881 +66
==========================================
+ Hits 23860 23923 +63
- Misses 3955 3958 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Qt workflows are using up 4260MB of cache storage for a single workflow run, almost half of the 10GB cache limit. So even if this is merged relevant caches probably will continue to get evicted too soon.
Let's solve that problem first... One idea is to use an S3 Cache:
https://github.com/marketplace/actions/s3-cache-for-github-actions
We would save only on main (because a secret is needed) but retrieve with a public read-only key.
I'm not sure if I like removing caches from PRs because when workflows get skipped on main
(ideally almost always when a workflow already ran for a PR with the same code) we'd potentially end up with a stale cache.
Yes, I will disable the debug symbols. Still now all PR caches stay there. I see no reason why this would not get merged. It will never affect the caches of the branch merged into. |
To add, we already evict caches for PRs open from branches directly in this repo. It's just the forks that do not work. |
If a PR adds a node module (as an example), it will create a cache for it, then when it is merged the workflow is skipped on main and the cache is deleted. A subsequent PR won't have a cache of the node modules. If you still want to merge this we can, but we should not check out any code in a |
PRs only use caches from AFAIK we need the clone for GitHub CLI to work, but I can try to workaround it. Also I see no security issue in cloning what was just merged in Regarding |
A pull request can be closed by the author without being approved and merged. |
Sure, and then we should also delete the caches as they are irrelevant. As far as I understand this will still take the action from the |
"you should make sure that you do not check out (...) untrusted code" https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target But not sure what the harm is as long as we don't do anything with it. |
Will close (and reopen) this MR to see what happens. |
Hmm, nothing happened. I guess this is good from security point of view, although not solving the caches issues 😊 Let's merge this for now and monitor the behaviour. |
We need to use
pull_request_target
so that caches from forks are deleted. We only request relevant permissions so this should be safe enough.Also quote variables, just in case.
Why delete caches? We cache a lot of data and the quota we have is low. This prevents relevant caches to get evicted too soon.