[generator] add recursive component discovery for GitHub repositories#909
[generator] add recursive component discovery for GitHub repositories#909ShigrafS wants to merge 7 commits intomeshery:masterfrom
Conversation
|
Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, you can find updates in the #github-notifications channel in the community Slack. |
Summary of ChangesHello @ShigrafS, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves Meshery's ability to process component definitions from GitHub repositories by implementing recursive directory traversal. Users can now specify a root directory, and the system will automatically discover and process relevant files nested within subdirectories, overcoming previous limitations with deeply structured repositories. The new functionality is highly configurable, allowing fine-grained control over the depth of the recursive search, and has been integrated seamlessly while maintaining compatibility with existing operations. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces recursive component discovery for GitHub repositories, a valuable enhancement. The implementation adds options for recursion and depth control, and updates relevant parts of the generator logic. My review has identified a couple of high-severity issues: one is a bug in the recursion handling logic that can cause incorrect behavior, and the other is an off-by-one error in the max depth calculation which leads to counter-intuitive results. Additionally, the new tests for the recursive functionality are currently quite minimal and should be expanded to ensure the feature is robust. Overall, the changes are in the right direction, but these key issues should be addressed before merging.
e177431 to
444c8fc
Compare
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Closes #726
Description
This PR implements recursive component discovery for Meshery’s generator logic, addressing the limitation where only files directly under a specified directory were processed. With this enhancement:
Users can point to any root directory in a repository, and Meshery will automatically discover all component definition files in subdirectories.
Recursive search is enabled by default, with configurable options for:
MaxDepth)*.yaml,*.yml,*.json)Backward compatibility is maintained for existing workflows.
Relevant CLI commands and API endpoints have been updated to support these options.
Changes include updates to:
generators/generator.go&generator_test.go– AddedGeneratorOptionsfor recursion and depth.generators/github/git_repo.go&package_manager.go– GitRepo and GitHubPackageManager updated to handle recursive directory traversal.generators/github/scheme_interface.go– Downloader updated to pass recursive options.utils/walker/git.go– File walker now respects recursion and max depth.recursive_test.go).This fixes the configuration fragility for repositories with deeply nested component files and aligns with the desired behavior in #726 .
Notes for Reviewers
filepath.WalkDirwith max depth checks inutils/walker/git.go.MaxDepthlogic and that recursion is disabled whenRecursive: false.[Signed commits](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)