Prevent malformed asset paths from working in GDK
Currently in the GDK, sprockets is far more forgiving with bad image asset paths than it should be. Assets with bad paths can work locally, but fail in production.
Ever since !9917 (merged) in Gitlab v9.3, we've had config.assets.compile = false
in production so our assets are no longer re-compiled on-the-fly. When it is enabled (as it is in development) this setting has the side effect of making paths that lack file extensions or asset digests still continue to work.
This caused an issue recently with #40285 (closed) in which the empty state illustrations in the Prometheus monitoring page were not loading properly.
Before:
(URL works in gdk, breaks in production)
# image_path('illustrations/monitoring/unable_to_connect')
http://localhost:3000/assets/illustrations/monitoring/unable_to_connect
After:
(URL works everywhere)
# image_path('illustrations/monitoring/unable_to_connect.svg')
http://localhost:3000/assets/illustrations/monitoring/unable_to_connect-eace0f700993376a1af0fc6f50b0dfd061010d2fa0244106940007e19bbfeec9.svg
We need a way to prevent sprockets from making bad image paths appear to work in the GDK so these errors are actually noticed in development.