rill icon indicating copy to clipboard operation
rill copied to clipboard

fix: Reduce redundant network calls in rill developer

Open AdityaHegde opened this issue 1 year ago • 3 comments

We have multiple redundant network calls in rill developer.

  • [x] During initial load we make a call to all resource and all files names. Separately we also make a call to all resources, this can be filled in using all resources call.
  • [x] WatchResourceClient receives the updated resource, but we still make another call to it.
  • [x] We refresh list of all file names for every file write. We can only do this when a new file is added or file is deleted.
  • [x] We make a call to ListResources with kind in addition to the ListResource with no params. We can filter from the full list instead. (Dashboard list is pending since it used in cloud where we might not always make a call to list resources)

This also attempts to move any metadata needed for these watch clients to those files instead of the global store FileArtifacts.

  • [x] Add WatchFileClient to store any metadata needed only during watching files.
  • [x] Add WatchResourceClient to store metadata needed only during watching resources.
  • [ ] Finally fix E2E and make sure there are no regressions.

AdityaHegde avatar May 13 '24 10:05 AdityaHegde

/review

ericpgreen2 avatar May 14 '24 15:05 ericpgreen2

Code Review Agent Run Status

  • AI Based Review: Successful

Code Review Overview

  • Summary: The PR introduces significant optimizations and refactoring aimed at reducing redundant network calls in the Rill Developer environment. Changes include the introduction of new utility classes for resource management, optimization of resource and file metadata handling, and removal of outdated methods and properties.
  • Code change type: Optimisation, Refactoring
  • Unit tests added: True
  • Estimated effort to review (1-5, lower is better): 3

>>See detailed code suggestions<<
The Bito AI Code Review Agent successfully reviewed 16 files and discovered 4 issues. Please review these issues along with suggested fixes in the Changed Files.

See other commands you can run

High-level Feedback

Ensure consistent use of resource management methods across all components to maintain efficiency. Review the changes for potential impacts on existing functionalities and compatibility with cloud environments. Consider adding more comprehensive tests to cover new changes and ensure that private constructors do not hinder unit testing.

rill-dev avatar May 14 '24 15:05 rill-dev

Hey sorry this is not ready for review. Hence the bunch of console logs. Sorry if i gave the wrong impression. Also the AI seems wrong most of the time. It feels like spam most of the time.

AdityaHegde avatar May 14 '24 15:05 AdityaHegde