Skip to content

Avoids querying twice on IndexMlModel component

What does this MR do and why?

Avoids querying twice on IndexMlModel component

Graphql would try to warmup with the wrong variables, while queries should only be fetched when prompted by SearchableList.

How to set up and validate locally

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

How to set up and validate locally

  1. Enable the feature flag and create a few models

    Feature.enable(:model_registry)
    
    p = Project.find_by(id: 1)
    100.times { |i| Ml::FindOrCreateModelService.new(p, "model_#{i}").execute }
  2. Navigate to <gdk>/<project>/-/ml/models?first=30&orderBy=created_at&sort=asc.

  3. If changes are not applied, you will notice the list first showing the results in descending order, and then refreshing with ascending order. When the Developer Console > Network there will be two graphql calls.

  4. Changes are applied, the initial flickering does not happen anymore, and only query will show up in the developer console

Edited by Eduardo Bonet

Merge request reports

Loading