Automate cache invalidation when patches/ directory changes in GitLab Rails codebase
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=554248)
</details>
<!--IssueSummary end-->
Implement a process to automatically invalidate the runner cache or update the cache key whenever there's a change in the `patches/` directory to prevent similar issues.
The Omnibus pipeline works the following way:
- Install Node modules using `yarn install`
- Apply patches to individual modules stored in the [`patches/`](https://gitlab.com/gitlab-org/gitlab/-/tree/57d17110ef8f137ec8c1507e8d1a60ec194d6876/patches) directory of the GitLab Rails codebase
- Cache the resulting `node_modules/` directory to the Runner cache
As long as the content of the `patches/` directory does not change, this is OK: The patches in this directory will be detected as `already applied` and there will be no failure.
Once the content of the `patches/` directory changes though, the patch application will fail blocking the Omnibus pipeline.
The NPM module that we use to apply the patches indicates that including the content of the `patches/` directory in the cache key is a requirement:
> If you cache node_modules rather than running yarn install every time, make sure that the patches dir is included in your cache key somehow. Otherwise if you update a patch then the change may not be reflected on subsequent CI runs.
>
> -- https://github.com/ds300/patch-package?tab=readme-ov-file#docker-and-ci
_This ticket was created from_ [_INC-2217_](https://app.incident.io/gitlab/incidents/2217) _and was automatically exported by_ [_incident.io_](https://app.incident.io) 🔥
issue