rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
12.32k stars 3.92k forks source link

Make sure Management UI JavaScript files are forced to reload after an upgrade #12683

Closed mkuratczyk closed 1 week ago

mkuratczyk commented 2 weeks ago

What

Users should no longer run into issues with the Management UI when upgrading RabbitMQ. There are numerous reports of JavaScript errors, blank pages, or just header+footer pages (without the main content).

How?

  1. When build RMQ, a version is injected into index.html
  2. index.html refers to all our JS and CSS files with query string v=$VERSION and therefore the URL changes from version to version
  3. If Management UI is disconnected from the server (red error at the top) and then reconnects, it'll trigger a full reload (likely we are now connected to a different node and/or different server version)
  4. If the Management UI is open on the main page, it checks the management_version returned by the /api/overview endpoint and compares it with its own version (defined in index.html). If there's a difference - a full page reload is performed (this is clearly an upgrade)

Breaking change: we no longer support MSIE 8 :) (evil.css was a piece of history: https://github.com/rabbitmq/rabbitmq-server/commits/v4.0.x/deps/rabbitmq_management/priv/www/css/evil.css)

michaelklishin commented 2 weeks ago

Sweet! It kind of sucks that we still do not have the new alpha builds infra for PRs but as soon as we sanity check it and merge, we will have a complete set of packages to try.

michaelklishin commented 1 week ago

Not sure why Selenium suites begin to flake again but given the scope of the change, I assume that if some of them pass, then all of them should and these are, indeed, flakes.

mkuratczyk commented 1 week ago

The OAuth2 issue looks legitimate - seems to be a race condition based on whether prefs.js is fetched before bootstrap.js is executed

mkuratczyk commented 1 week ago

Closing in favour of https://github.com/rabbitmq/rabbitmq-server/pull/12749/