Skip to content

Remove timeago methods exposed on window object

What does this MR do?

We currently expose window.timeago and window.gl.utils.localTimeAgo. As far as I can tell, they are not used like that anymore and any part of the code base that still uses it like that should move to direct imports.

This was actually the last instance of a JavaScript file setting up a window.gl side-effect. Unfortunately this breaks a lot of tests. Therefore we add the window.gl sideeffect to our jest set up. And in order to be 100% sure that we do not break production, we add the sideeffect to main.js as well.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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

Related to #335482

Edited by Lukas Eipert

Merge request reports

Loading