Improve startup.js
What does this MR do?
This MR does multiple things:
-
Add specs for setupAxiosStartupCalls
We are missing specs for setupAxiosStartupCalls, so this introduces them to test the current behavior
-
Stop delegating calls to startup if they failed
fetch
doesn't consider requests that have a status code outside of 200-299 to be a failure. So if our startup.js calls fail, we will actually cache that behavior and the later axios request which might have been successful will never have the chance to be successful. -
Resolve startup.js call exactly once
Currently we will always resolve to the same value, if the same URL is requested multiple times. This is unexpected, and we should only cache the first call.
-
Detach StartupJS interceptor after startup
If all StartupJS calls have been made we can detach the interceptor.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team