Resolve "LicenseHelper uses "extend self" inapproriately"
What does this MR do?
- The
LicenseHelper
module has a number of methods that use instance variables for memoization. - At the end of the module,
extend self
is called. - This results in the memoization being stored in the module itself for these calls. So it's cached for the life of the process
This PR is about:
- Remove the memoization from the module level.
- Find a home for the methods that require some additional input (project / group) - just so they live along some other methods that do similar things
By leaving all the original definitions (but one) in place in the LicenseHelper
we make sure that all the external references that are using those will still find the definition. (and by not altering the logic we ensure that this definition will behave and return as expected)
The method that was moved was referenced by a single template and was properly updated on the template's end
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
Closes #3326 (closed)
Edited by Michael Kozono