Merge requests from forks should have cache available

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem:

Merge requests from forks do not have any cache like: https://gitlab.com/JeremyWuuuuu/gitlab/-/jobs/1632034441

Rubocop takes a very long time to run without having cache, and we're distributing workload based on cache being available for static-analysis. This can cause very imbalanced workload for the job runs Rubocop, causing timeout, for merge requests from forks.

Reason:

We are pushing cache under the following rules:

.shared:rules:update-cache:
  rules:
    - <<: *if-default-branch-schedule-2-hourly
    - <<: *if-security-schedule
    - <<: *if-merge-request-title-update-caches

This makes sense for the canonical project (this project), but it doesn't work well for forks, because generally forks do not have scheduled pipelines, and it's unlikely it'll try to put pipeline:update-cache in order to push the cache even for once.

Solution proposal:

Always push cache for forks from merge requests, because it's better than having no cache, and it will not require extra setup for forks? This can look like:

.shared:rules:update-cache:
  rules:
    - <<: *if-default-branch-schedule-2-hourly
    - <<: *if-security-schedule
    - <<: *if-merge-request-title-update-caches
    - <<: *if-merge-request-from-forks

References:

Edited by 🤖 GitLab Bot 🤖