-
Notifications
You must be signed in to change notification settings - Fork 18
feat: pipeline tree 协议转换基础实现 #589
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
base: master
Are you sure you want to change the base?
feat: pipeline tree 协议转换基础实现 #589
Conversation
* feat: pipeline tree 协议转换基础实现 # Reviewed, transaction id: 39164 * feat: workflow config update #ignore
…BlueKing#195) * feat: 数据转换 DataModel 到 PipelineTree 初步实现 # 184 # Reviewed, transaction id: 40085 * fix: add unit test for data_model to pipeline_tree TencentBlueKing#184 # Reviewed, transaction id: 40179
# Reviewed, transaction id: 40263 (cherry picked from commit 7e5faef)
…#199) * feat: pipeline converters 目录结构调整 TencentBlueKing#184 # Reviewed, transaction id: 40345 * feat: pipeline converters 目录结构调整 TencentBlueKing#184 # Reviewed, transaction id: 40346
* feat: gateway协议转换基本实现 TencentBlueKing#184 # Reviewed, transaction id: 40354 * fix: 协议调整优化及问题修复 TencentBlueKing#184 # Reviewed, transaction id: 40538 * fix: gateway协议改造reviewed修改 TencentBlueKing#184 # Reviewed, transaction id: 40601
…#204) * feat: pipeline converters 目录结构调整 TencentBlueKing#184 # Reviewed, transaction id: 40345 * feat: pipeline converters 目录结构调整 TencentBlueKing#184 # Reviewed, transaction id: 40346 * feat: 支持 json to data model 数据转换 TencentBlueKing#184 # Reviewed, transaction id: 40711 * feat: 集成 CI 配置调整 TencentBlueKing#184 * fix: fix flake8 TencentBlueKing#184 # Reviewed, transaction id: 40718
…ing#206) * feat: 实现gateway协议json到data_model的转换 TencentBlueKing#184 # Reviewed, transaction id: 40866 * fix: 修改converters模块为惰性加载 TencentBlueKing#184 # Reviewed, transaction id: 40909 * fix: 修改converters模块加载方式 TencentBlueKing#184 # Reviewed, transaction id: 40971 * fix: 修复循环引用报错问题 TencentBlueKing#184 # Reviewed, transaction id: 40993
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.
代码审查总结
本次 PR 新增了流程导入功能,整体架构清晰。发现以下需关注的问题:
🚨 严重问题
- 文件上传安全 (bkflow/template/views.py:838): 缺少文件大小限制,存在 DoS 风险
- 异常处理过宽 (bkflow/template/views.py:848): 捕获所有异常可能掩盖真实问题,难以排查
⚡ 性能与设计
- 通配符导入 (bkflow/pipeline_converter/converters/init.py:3-4):
from .xxx import *可能导致命名空间污染
⚠️ 代码质量
- 常量定义不当 (bkflow/pipeline_converter/constants.py:14-18): 类属性 GATEWAYS 应移至类外作为模块常量
- TODO 标记 (bkflow/pipeline_converter/converters/data_model_to_web_pipeline/component.py:17): 生产代码包含未完成功能
✨ 建议
- 添加文件大小限制 (如 10MB) 和内容校验
- 细化异常类型,分别处理解析错误、转换错误等
- 移除通配符导入,明确列出导出项
- 完成或移除 TODO 标记的功能
共标注 5 处关键点,优先处理安全相关问题。
📍 关键问题标注🚨 严重 - 文件上传安全 (bkflow/template/views.py:838)缺少文件大小限制,攻击者可上传超大文件导致服务 DoS。 🚨 严重 - 异常处理过宽 (bkflow/template/views.py:848)
except (ValidationError, ParseError) as e:
logger.error(f"Parse failed: {e}")
except ConversionError as e:
logger.error(f"Conversion failed: {e}")⚡ 性能 - 通配符导入 (bkflow/pipeline_converter/converters/init.py:3-4)
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #589 +/- ##
=========================================
Coverage ? 79.48%
=========================================
Files ? 255
Lines ? 13627
Branches ? 0
=========================================
Hits ? 10832
Misses ? 2795
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.