kibana/test
Jean-Louis Leysens e90c2098f2
[Http] Replace buildNr with buildSha in static asset paths (#175898)
## Summary

Follow up of [first CDN
PR](https://github.com/elastic/kibana/pull/169408). Primary focus is
replacing our build nr with SHA that allows cache busting and maintains
anti-collision properties.

## How to test

Start Kibana as usual navigating around the app with the network tab
open in your browser of choice. Keep an eye out for any asset loading
errors. It's tricky to test every possible asset since there are many
permutations, but generally navigating around Kibana should work exactly
as it did before regarding loading bundles and assets.

## Notes
* did a high-level audit of usages of `buildNum` in `packages`, `src`
and `x-pack` adding comments where appropriate.
* In non-distributable builds (like dev) static asset paths will be
prefixed with `XXXXXXXXXXXX` instead of Node's `Number.MAX_SAFE_INTEGER`
* Added some validation to ensure the CDN url is of the expected form:
nothing trailing the pathname

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### Risk Matrix

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| We break some first or third party dependencies on existing asset
routes | Med | High | Attempting to mitgate by serving static assets
from both old and new paths where paths have updated to include the
build SHA. Additioanlly: it is very bad practice to rely on the values
of the static paths, but someone might be |
| Cache-busting is more aggressive | High | Low | Unlikely to be a big
problem, but we are not scoping more static assets to a SHA and so every
new Kibana release will require clients to, for example, download fonts
again. |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-02-07 09:54:41 +01:00
..
accessibility [Discover] Move total hits counter from histogram to grid area. New controls in histogram. (#171638) 2024-01-12 03:36:27 -07:00
analytics async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
api_integration Make the drop_null_columns configurable in ES|QL search strategies (#176236) 2024-02-06 16:28:08 +02:00
common [FTR] Mv test subjs svc to shared location (#174048) 2024-01-09 11:43:39 +00:00
examples Fix broken tests as a result of tsid hashing (#176120) 2024-02-02 16:24:41 -04:00
functional [Http] Replace buildNr with buildSha in static asset paths (#175898) 2024-02-07 09:54:41 +01:00
harden Add test to ensure security related eslint rules are applied (#151434) 2023-02-24 16:48:11 +01:00
health_gateway async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
interactive_setup_api_integration async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
interactive_setup_functional Unskip interactive setup functional tests (#157863) 2023-05-16 09:20:00 -04:00
interpreter_functional async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
node_roles_functional async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
package [artifacts/package testing] Update apt cache (#175789) 2024-01-29 07:51:00 -06:00
plugin_functional [Fleet] Support output and Fleet server proxies on serverless (#175315) 2024-02-05 16:00:53 +01:00
scripts [ci] Remove jenkins config (#173745) 2023-12-21 12:09:43 -06:00
server_integration Inject initial "not reported" to prevent blocking /api/status (#173371) 2023-12-14 09:31:58 -07:00
ui_capabilities/newsfeed_err [ftr] automatically determine config run order (#130983) 2022-05-04 17:05:58 -05:00
tsconfig.json Update Kibana code editor dependencies (#171720) 2024-01-25 10:30:02 +01:00