Allow more than 2 files to form cache key
<!--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=301161) </details> <!--IssueSummary end--> <!-- This template is a great use for issues that are feature::additions or technical tasks for larger issues.--> ### Proposal <!-- Use this section to explain the feature and how it will work. It can be helpful to add technical details, design proposals, and links to related epics or issues. --> <!-- Consider adding related issues and epics to this issue. You can also reference the Feature Proposal Template (https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Feature%20proposal.md) for additional details to consider adding to this issue. Additionally, as a data oriented organization, when your feature exits planning breakdown, consider adding the `What does success look like, and how can we measure that?` section. --> Quoting from https://docs.gitlab.com/ee/ci/yaml/README.html#cachekeyfiles: > When you include cache:key:files, you must also list the project files that are used to generate the key, **up to a maximum of two files**. The proposal is, basically, to remove such files limit. There are some possibilities to implement this feature: 1. #272556 could be used to replace this one if fixed. 1. Allow defining several caches, instead of just one per job. Example: ```yaml variables: MOLECULE_EPHEMERAL_DIRECTORY: $CI_PROJECT_DIR/.cache/molecule POETRY_VIRTUALENVS_IN_PROJECT: "true" PRE_COMMIT_HOME: $CI_PROJECT_DIR/.cache/pre-commit cache: - paths: - $PRE_COMMIT_HOME key: prefix: pre-commit files: - .pre-commit-config.yaml - paths: - .venv key: prefix: poetry files: - pyproject.toml - poetry.lock - paths: - $MOLECULE_EPHEMERAL_DIRECTORY key: prefix: molecule files: - tests/molecule/default/collections.yml - tests/molecule/default/requirements.yml ```
issue