Skip to content

Migrate Project published_releases property to M2M relation field #3312

@ahmedxgouda

Description

@ahmedxgouda

Is your feature request related to a problem? Please describe.
Currently, the published_releases property is just another query to execute, which is fine when we are fetching one project, but when we will fetch multiple projects we will execute this query for each project which we will have N+1 queries.
For example:

query {
   recentProjects(limit: 1000) {
      recentReleases {
         id
      }
   }
}

We will have a query for fetching the projects and one query for each project to fetch its releases, so we will have 1001 queries!

Describe the solution you'd like

  1. Add an M2M field to the Project model for the releases.
  2. Remove the published_releases property.
  3. Update any related properties (e.g. recent_releases_count) to use this new field.
  4. Update the GraphQL ProjectNode to use this field instead.
  5. Update the owasp_aggregate_projects command to populate the releases in the new field (we should use the same query in the published_relealses property).
  6. Update related tests.

Are you going to work on implementing this?

  • Yes
  • No

Metadata

Metadata

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions