Expire relevant ETag caches for importers
What does this MR do and why?
Related issue #292861 (closed)
This MR ensures that ETag caches of relevant importers are properly flushed when import status is changed
Additionally:
- it handles expiring github cache when stats are updated (relevant for #348744 (closed))
- removes support for query params in
realtime_changes
endpoint, as this is incorrect according to our ETag caching docs https://docs.gitlab.com/ee/development/polling.html :
Do not use query parameters (for example ?scope=all) for endpoints where you want to enable ETag caching. The middleware takes into account only the request path and ignores query parameters. All parameters should be included in the request path. By doing this we avoid query parameter ordering problems and make route matching easier.
For now it is sufficient not to alter routes to include query param to path. frontend removal of query param will be done in #348744 (closed), however this will not break any existing frontend code path when this one will be merged
How to set up and validate locally
- Open
/projects/new
- Initiate any import (github might be probably the easiest)
- Observe statuses being correctly updated (previously due to ETag
realtime_changes
endpoint will stuck forever in304 Not modified
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.