Change project cache key to depend on ID instead of full path
What does this MR do?
Change project cache key to depend on ID instead of full path
Previously, project cache used as part of the namespace the full_path
, which included the namespace and project slug.
That meant that anytime a project was renamed or transferred to a different namespace, we would lose the existing cache.
This is not necessary, nor desired.
I've prefixed cache key with project:
to make it easy to find in redis if necessary as well as make it possible to do any
project related operations just by looking at the pattern: project:#{id}:#{type}
Similar change was done to the project pipeline status cache key to follow the new convention.
Old cache key was: projects/#{id}/pipeline_status/#{sha}
New one is: project:#{id}:pipeline_status:#{sha}
What are the relevant issue numbers?
See the previous discussion here: https://gitlab.com/gitlab-org/gitlab-ee/issues/3062#note_36468758
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
Related to gitlab-org/gitlab-ee#3062 Closes #42191 (closed)