-
Notifications
You must be signed in to change notification settings - Fork 124
[Integration][Gitlab] gitlab-v2 memory optimizations #2137
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
[Integration][Gitlab] gitlab-v2 memory optimizations #2137
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
I wish I could see memory_profiler or tracemalloc summary of the difference between current integration and the new implementation. also please add unittests for core logic. |
also did you read about |
writer = Mock() | ||
streamer = YamlToJsonStreamer(writer) | ||
import yaml | ||
yaml_text = "key: value" |
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.
can you test for longer and more compilcated cases?
did some test by myself, perfomance looks ok. please fix the lint issues and the test issues (they seems to failing for some reason) |
unfortunately, ruamel is not giving the performance we would get from the custom code (I've tried it and it is not very different from the yaml package we are using...) |
User description
Description
What - gitlab-v2 memory optimizations
Why - ooms on large files (gitlab has no limit on the size)
How -
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
PR Type
Bug fix
Description
Memory optimizations for GitLab file processing
Stream-based file content handling to prevent OOM
Chunked base64 decoding and YAML-to-JSON conversion
Temporary file storage for large content processing
Diagram Walkthrough
File Walkthrough
base_client.py
Add streaming file download with chunked decoding
integrations/gitlab-v2/gitlab/clients/base_client.py
download_decoded_content
method for streaming file downloadsgitlab_client.py
Enhance file enrichment with type detection
integrations/gitlab-v2/gitlab/clients/gitlab_client.py
path
vscontent
)__base_jq
field for file processingrest_client.py
Implement chunked decoding for file content
integrations/gitlab-v2/gitlab/clients/rest_client.py
utils.py
Rewrite file parsing with streaming YAML-to-JSON
integrations/gitlab-v2/gitlab/helpers/utils.py
parse_file_content
for memory efficiencyYamlToJsonStreamer
CHANGELOG.md
Update changelog for memory optimizations
integrations/gitlab-v2/CHANGELOG.md
pyproject.toml
Version bump to 0.2.29
integrations/gitlab-v2/pyproject.toml