Skip to content

Proposal: Prevent creation of ActiveRecord objects in serializers

What does this MR do and why?

Related #374088 (closed)

Describe in detail what your merge request does and why.

Prevent the creation of ActiveRecord objects in serializers.

  • Number of offenses under spec/serializers: 191 files inspected, 615 offenses detected
  • Number of offenses under ee/spec/serializers: 94 files inspected, 297 offenses detected

Example MR: Use build in DashboardEnvironmentsProjectEntity... (!101192 - merged)

It might be that we cannot do this in all serializers specs, there could be exceptions.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alina Mihaila

Merge request reports