meshery icon indicating copy to clipboard operation
meshery copied to clipboard

Enhance mesheryctl to Update Existing Components and Models from Local CSV Director

Open Aijeyomah opened this issue 1 year ago • 4 comments

Current Behavior

At present, mesheryctl supports updating component metadata and models by referring to a Google Spreadsheet. This spreadsheet holds the necessary information for updating the system's components and models, and mesheryctl pulls the data, processes it, and updates the relevant registry entries.

The command works as follows:

// Updating models from Meshery Integration Spreadsheet
mesheryctl registry update --spreadsheet-id [id] --spreadsheet-cred [base64 encoded spreadsheet credential] -i [path to the directory containing models].

This functionality limits users to Google Sheets as the only source for updating models and components.

Desired Behavior

We would like to enhance the existing functionality by allowing mesheryctl to update models and components directly from a local directory containing CSV files. This will enable users to bypass Google Sheets and use local CSV files for updating components and models.

  • Users should be able to specify a path to a local CSV directory, and the system should process the files to update the existing models and components.
  • The structure and format of the local CSV files should match the format expected from the Google Sheets data (i.e., columns and data structure should be consistent).
  • If both a Google Sheets URL and a local CSV directory are provided, the local CSV directory should take precedence, and the Google Sheets data should be ignored.
  • Validation should be added to ensure that the CSV files are correctly formatted and contain the necessary data for updating components and models.
  • Appropriate error handling should be implemented to manage cases where CSV files are missing, unreadable, or improperly formatted.

Implementation

The following changes should be made:

  1. Extend the current mesheryctl registry update command to accept a new flag: --csv-dir [path-to-local-directory].
  2. Add validation to ensure that the CSV files in the specified directory contain the necessary fields for updating the models and components.
  3. Implement functionality to parse and process the CSV files, updating the registry entries for existing models and components.
  4. Add error handling for missing or improperly formatted CSV files, with informative error messages.
  5. Ensure that local CSV files override any Google Sheets input if both are provided.
  6. Update the Meshery documentation to reflect these changes.

Example Command:

// Updating models from a local CSV directory
mesheryctl registry update --csv-dir /path/to/csv-directory

// Example to update with both Google Sheets and CSV, CSV takes precedence
mesheryctl registry update --spreadsheet-id [id] --spreadsheet-cred [base64 encoded spreadsheet credential] --csv-dir /path/to/csv-directory

Acceptance Tests

  • Verify that the system successfully updates models and components when provided with a local CSV directory.
  • Verify that the system processes the CSV files correctly and ensures the data structure matches the expected format.
  • Verify that the system handles errors appropriately for missing or improperly formatted CSV files.
  • Ensure that local CSV files take precedence over Google Sheets input when both are provided.

Mockups

No visual mockups are required for this enhancement, as it is a CLI-based functionality.


Contributor Resources

Aijeyomah avatar Sep 26 '24 13:09 Aijeyomah

This issue has been labeled with 'component/mesheryctl'. Note that after making changes you need to update it in the mesheryctl command tracker spreadsheet.


        Be sure to join the community, if you haven't yet and please leave a :star: star on the project :smile:

github-actions[bot] avatar Sep 26 '24 13:09 github-actions[bot]

i want to work on this

Raghav1783 avatar Sep 26 '24 18:09 Raghav1783

@chetak123 i am working on this one.

Raghav1783 avatar Sep 29 '24 06:09 Raghav1783

@chetak123, are you still up for this issue? Think you can wrangle it?

leecalcote avatar Oct 15 '24 12:10 leecalcote

Hi @leecalcote, I noticed that this issue hasn't seen any progress for a long time, and I am very interested in it. Could you assign this issue to me?

Standing-Man avatar Nov 10 '24 14:11 Standing-Man

I'll work on this, please assign me

weilirs avatar Dec 09 '24 13:12 weilirs

@weilirs how's your other assignment, golang upgrade, coming along?

leecalcote avatar Dec 09 '24 13:12 leecalcote

Hi @leecalcote , I'd love to work on this issue if it's still open to grab. I've finished the setup steps and could run meshery locally.

nganphan123 avatar Dec 13 '24 11:12 nganphan123

Hi @leecalcote @Aijeyomah , can you please assign the issue to me? i would love to get into it

abhisheksatpathy avatar Dec 24 '24 14:12 abhisheksatpathy

Here's a helpful reference to study while working through this issue. Screenshot 2024-12-31 at 3 52 52 PM

leecalcote avatar Dec 31 '24 21:12 leecalcote

@nganphan123 and @abhisheksatpathy, I missed your comments previously. My apologies. Please jump in here and learn with @weilirs.

leecalcote avatar Dec 31 '24 21:12 leecalcote

thanks for the reference @leecalcote, will learn more about meshery through this

abhisheksatpathy avatar Jan 01 '25 11:01 abhisheksatpathy

@leecalcote @weilirs, please have a look at my attempt to solve this issue with the above linked PR #13152

abhisheksatpathy avatar Jan 04 '25 11:01 abhisheksatpathy

Hi @abhisheksatpathy , I reviewed your PR and left some comments. Would love to work tgt with you on this!

nganphan123 avatar Jan 06 '25 11:01 nganphan123

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 15 '25 17:02 stale[bot]

This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue.

stale[bot] avatar Mar 01 '25 03:03 stale[bot]