feat(logstore): make graph field optional via env variable LOGSTORE…#30554
feat(logstore): make graph field optional via env variable LOGSTORE…#30554crazywoola merged 2 commits intolanggenius:mainfrom
graph field optional via env variable LOGSTORE…#30554Conversation
…_ENABLE_PUT_GRAPH_FIELD
Summary of ChangesHello @scdeng, 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 enhances control over data logging by introducing an environment variable that allows users to determine whether the full workflow Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 a new environment variable, LOGSTORE_ENABLE_PUT_GRAPH_FIELD, to optionally control the logging of the workflow graph field. This is a valuable addition for reducing log storage and preventing sensitive configuration data from being exposed. The implementation is straightforward and correct. I have one suggestion to improve maintainability by refactoring the duplicated logic for parsing boolean values from environment variables.
api/extensions/logstore/repositories/logstore_workflow_execution_repository.py Show resolved Hide resolved
…ples, docker/middleware.env.example and docker/docker-compose.yaml
| ✅ Updates completed and verified:
Thank you very much for the valuable feedback and guidance during the review — it really helped improve the quality of the changes! 🙏 |

Important
Fixes #<issue number>.Fixes #30544
Summary
This PR introduces a new environment variable
LOGSTORE_ENABLE_PUT_GRAPH_FIELD(default:"true")to control whether the full workflow
graphfield is written to Aliyun LogStore.Motivation:
graphfield contains the entire workflow configuration, which can be large and potentially sensitive.Changes:
self._enable_put_graph_fieldflag initialized fromLOGSTORE_ENABLE_PUT_GRAPH_FIELDinLogstoreWorkflowExecutionRepository.__init__._to_logstore_modelto writegraphonly if bothdomain_model.graphand_enable_put_graph_fieldare true.graphis written unlessLOGSTORE_ENABLE_PUT_GRAPH_FIELDis explicitly set to"false".Usage Example:
# disable graph field LOGSTORE_ENABLE_PUT_GRAPH_FIELD=falseWith this setting, the
graphfield stored in LogStore will be"{}", reducing storage size.No new dependencies were introduced.
Screenshots
graphJSON in every execution loggraphJSON is omitted (as{}) whenLOGSTORE_ENABLE_PUT_GRAPH_FIELD=falseChecklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods