-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add GitExtractor component #5459
feat: add GitExtractor component #5459
Conversation
f2d65d0
to
68737d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @raphaelchristi
This is looking good.
The tmpdir calls are blocking and it would be better if they were async. Could you refactor that?
Also, you don't need to delete the folder because you could use a context manager that will remove the folder once the code block runs.
Hi @ogabrielluiz , Thank you for the review! I've implemented the suggested changes:
Let me know if you'd like me to make any additional adjustments to the implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Good Work! @raphaelchristi Please follow up if the tests in CI Fails! |
… cleanup - Convert methods to async using async/await - Add asynccontextmanager for automatic tmpdir cleanup - Remove manual shutil.rmtree calls
3583f2a
to
21f978b
Compare
This pull request introduces a new component called
GitExtractorComponent
to thelangflow
project, for analyzing Git repositories.Features:
The
GitExtractorComponent
is designed to analyze a Git repository and provide various information and file contents. Additionally, the__init__.py
file has been updated to include this new component.New component addition:
src/backend/base/langflow/components/git/gitextractor.py
: Introduced theGitExtractorComponent
class, which includes methods for retrieving repository information, statistics, directory structure, file contents, and text-based file contents. This component uses asynchronous context management for temporary Git repository cloning and handles potentialGitError
exceptions.Initialization update:
src/backend/base/langflow/components/git/__init__.py
: AddedGitExtractorComponent
to the module's exports, ensuring it is available for use in other parts of the application.