[COMPASS-5209] Refactor mongodb-collection-model to allow for decoupling of instance/db/coll fetching logic Created: 20/Oct/21  Updated: 29/Oct/23  Resolved: 02/Nov/21

Status: Closed
Project: Compass
Component/s: Collection
Affects Version/s: None
Fix Version/s: 1.29.5

Type: Task Priority: Major - P3
Reporter: Sergey Petushkov Assignee: Sergey Petushkov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on COMPASS-5206 Remove databases and collections rela... Closed
is depended on by COMPASS-5210 Refactor mongodb-instance-model to al... Closed
Epic Link: COMPASS-4764
Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Novokuybyshevsk, Iteration Orlando

 Description   
  • Provide collection and model fetch methods instead of relying on instance-model to populate this data
  • Collection fetch should resolve only with result of { listCollections: 1, nameOnly: 1 }

    (or from userInfo if there are not enough rights to list) not with the whole coll info

  • Model fetch gets the detailed collStats info

Note: we are not trying to drastically rewrite the code here, we just providing standard Ampersand methods for handling Model state fetching to unify the architecture approach with the currently used state mgmt framework, this also enables us to decouple the loading of this data from the instance-model eventually in the follow up tickets

Miro board with changes context



 Comments   
Comment by Githook User [ 10/Nov/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: chore(instance-model, database-model, collection-model): Refactor instance db coll models COMPASS-5208 COMPASS-5209 COMPASS-5210 (#2558)

  • chore(collection-model, database-model, instance-model): Update mocha and eslint
  • refactor(mongodb-data-service): Change and provide new methods for databases/collections info fetching
  • Remove db/coll fetching from instance method
  • Add databaseStats public method to fetch dbStats
  • Add listCollectionsNamesOnly that safely fetches collection names with priviliges fallback
  • Add collectionInfo method that gets coll info for a single collection from listCollections
  • Allow nameOnly option in listDatabases
  • chore(compass-schema-validation): Refactor schema-validation to use new dataService.collectionInfo method
  • feat(collection-model): Add fetch method to the collection model and collection so it can handle it's own data loading
  • feat(database-model): Add fetch method to the database model and collection so it can handle it's own data loading
  • refactor(instance-model): Refactor instance fetch method
  • refactor(compass-app-stores): Refactor instance store to use new instance/db/coll fetch methods
  • fix(compass-home): Do not show overlay from compass-home

It races with the one in app-stores plugin, no need for that

  • refactor(compass-sidebar): Refactor sidebar instance state handling to match new app-stores behaviour, update mocks in tests
  • chore: Update package-lock
  • chore: Address review feedback
  • Use async methods in data-service instead of callbacks
  • Rename extended-model to model
  • chore(sidebar): Destruct arguments
  • chore: Mention relevant NODE ticket
  • test(data-service): Don't forget to call done in tests
  • test(instance-model): Update instance method mock
Comment by Githook User [ 02/Nov/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: chore(instance-model, database-model, collection-model): Refactor instance db coll models COMPASS-5208 COMPASS-5209 COMPASS-5210 (#2558)

  • chore(collection-model, database-model, instance-model): Update mocha and eslint
  • refactor(mongodb-data-service): Change and provide new methods for databases/collections info fetching
  • Remove db/coll fetching from instance method
  • Add databaseStats public method to fetch dbStats
  • Add listCollectionsNamesOnly that safely fetches collection names with priviliges fallback
  • Add collectionInfo method that gets coll info for a single collection from listCollections
  • Allow nameOnly option in listDatabases
  • chore(compass-schema-validation): Refactor schema-validation to use new dataService.collectionInfo method
  • feat(collection-model): Add fetch method to the collection model and collection so it can handle it's own data loading
  • feat(database-model): Add fetch method to the database model and collection so it can handle it's own data loading
  • refactor(instance-model): Refactor instance fetch method
  • refactor(compass-app-stores): Refactor instance store to use new instance/db/coll fetch methods
  • fix(compass-home): Do not show overlay from compass-home

It races with the one in app-stores plugin, no need for that

  • refactor(compass-sidebar): Refactor sidebar instance state handling to match new app-stores behaviour, update mocks in tests
  • chore: Update package-lock
  • chore: Address review feedback
  • Use async methods in data-service instead of callbacks
  • Rename extended-model to model
  • chore(sidebar): Destruct arguments
  • chore: Mention relevant NODE ticket
  • test(data-service): Don't forget to call done in tests
  • test(instance-model): Update instance method mock
Comment by Githook User [ 02/Nov/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: chore(instance-model, database-model, collection-model): Refactor instance db coll models COMPASS-5208 COMPASS-5209 COMPASS-5210 (#2558)

  • chore(collection-model, database-model, instance-model): Update mocha and eslint
  • refactor(mongodb-data-service): Change and provide new methods for databases/collections info fetching
  • Remove db/coll fetching from instance method
  • Add databaseStats public method to fetch dbStats
  • Add listCollectionsNamesOnly that safely fetches collection names with priviliges fallback
  • Add collectionInfo method that gets coll info for a single collection from listCollections
  • Allow nameOnly option in listDatabases
  • chore(compass-schema-validation): Refactor schema-validation to use new dataService.collectionInfo method
  • feat(collection-model): Add fetch method to the collection model and collection so it can handle it's own data loading
  • feat(database-model): Add fetch method to the database model and collection so it can handle it's own data loading
  • refactor(instance-model): Refactor instance fetch method
  • refactor(compass-app-stores): Refactor instance store to use new instance/db/coll fetch methods
  • fix(compass-home): Do not show overlay from compass-home

It races with the one in app-stores plugin, no need for that

  • refactor(compass-sidebar): Refactor sidebar instance state handling to match new app-stores behaviour, update mocks in tests
  • chore: Update package-lock
  • chore: Address review feedback
  • Use async methods in data-service instead of callbacks
  • Rename extended-model to model
  • chore(sidebar): Destruct arguments
  • chore: Mention relevant NODE ticket
  • test(data-service): Don't forget to call done in tests
  • test(instance-model): Update instance method mock
Comment by Githook User [ 02/Nov/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: chore(instance-model, database-model, collection-model): Refactor instance db coll models COMPASS-5208 COMPASS-5209 COMPASS-5210 (#2558)

  • chore(collection-model, database-model, instance-model): Update mocha and eslint
  • refactor(mongodb-data-service): Change and provide new methods for databases/collections info fetching
  • Remove db/coll fetching from instance method
  • Add databaseStats public method to fetch dbStats
  • Add listCollectionsNamesOnly that safely fetches collection names with priviliges fallback
  • Add collectionInfo method that gets coll info for a single collection from listCollections
  • Allow nameOnly option in listDatabases
  • chore(compass-schema-validation): Refactor schema-validation to use new dataService.collectionInfo method
  • feat(collection-model): Add fetch method to the collection model and collection so it can handle it's own data loading
  • feat(database-model): Add fetch method to the database model and collection so it can handle it's own data loading
  • refactor(instance-model): Refactor instance fetch method
  • refactor(compass-app-stores): Refactor instance store to use new instance/db/coll fetch methods
  • fix(compass-home): Do not show overlay from compass-home

It races with the one in app-stores plugin, no need for that

  • refactor(compass-sidebar): Refactor sidebar instance state handling to match new app-stores behaviour, update mocks in tests
  • chore: Update package-lock
  • chore: Address review feedback
  • Use async methods in data-service instead of callbacks
  • Rename extended-model to model
  • chore(sidebar): Destruct arguments
  • chore: Mention relevant NODE ticket
  • test(data-service): Don't forget to call done in tests
  • test(instance-model): Update instance method mock
Comment by Githook User [ 02/Nov/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: chore(instance-model, database-model, collection-model): Refactor instance db coll models COMPASS-5208 COMPASS-5209 COMPASS-5210 (#2558)

  • chore(collection-model, database-model, instance-model): Update mocha and eslint
  • refactor(mongodb-data-service): Change and provide new methods for databases/collections info fetching
  • Remove db/coll fetching from instance method
  • Add databaseStats public method to fetch dbStats
  • Add listCollectionsNamesOnly that safely fetches collection names with priviliges fallback
  • Add collectionInfo method that gets coll info for a single collection from listCollections
  • Allow nameOnly option in listDatabases
  • chore(compass-schema-validation): Refactor schema-validation to use new dataService.collectionInfo method
  • feat(collection-model): Add fetch method to the collection model and collection so it can handle it's own data loading
  • feat(database-model): Add fetch method to the database model and collection so it can handle it's own data loading
  • refactor(instance-model): Refactor instance fetch method
  • refactor(compass-app-stores): Refactor instance store to use new instance/db/coll fetch methods
  • fix(compass-home): Do not show overlay from compass-home

It races with the one in app-stores plugin, no need for that

  • refactor(compass-sidebar): Refactor sidebar instance state handling to match new app-stores behaviour, update mocks in tests
  • chore: Update package-lock
  • chore: Address review feedback
  • Use async methods in data-service instead of callbacks
  • Rename extended-model to model
  • chore(sidebar): Destruct arguments
  • chore: Mention relevant NODE ticket
  • test(data-service): Don't forget to call done in tests
  • test(instance-model): Update instance method mock
Generated at Wed Feb 07 22:38:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.