Enhance mesheryctl to Update Existing Components and Models from Local CSV Director
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:
- Extend the current
mesheryctl registry updatecommand to accept a new flag:--csv-dir [path-to-local-directory]. - Add validation to ensure that the CSV files in the specified directory contain the necessary fields for updating the models and components.
- Implement functionality to parse and process the CSV files, updating the registry entries for existing models and components.
- Add error handling for missing or improperly formatted CSV files, with informative error messages.
- Ensure that local CSV files override any Google Sheets input if both are provided.
- 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
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:
i want to work on this
@chetak123 i am working on this one.
@chetak123, are you still up for this issue? Think you can wrangle it?
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?
I'll work on this, please assign me
@weilirs how's your other assignment, golang upgrade, coming along?
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.
Hi @leecalcote @Aijeyomah , can you please assign the issue to me? i would love to get into it
Here's a helpful reference to study while working through this issue.
@nganphan123 and @abhisheksatpathy, I missed your comments previously. My apologies. Please jump in here and learn with @weilirs.
thanks for the reference @leecalcote, will learn more about meshery through this
@leecalcote @weilirs, please have a look at my attempt to solve this issue with the above linked PR #13152
Hi @abhisheksatpathy , I reviewed your PR and left some comments. Would love to work tgt with you on this!
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.
This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue.