-
Notifications
You must be signed in to change notification settings - Fork 20
feat: 新增蓝鲸插件框架集成蓝鲸可编程网关 && 插件部署优化功能 #111
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
Conversation
|
Xinkai Yi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
=========================================
Coverage ? 90.97%
=========================================
Files ? 38
Lines ? 1330
Branches ? 0
=========================================
Hits ? 1210
Misses ? 120
Partials ? 0
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
|
||
| from drf_yasg.utils import swagger_auto_schema | ||
| from apigw_manager.apigw.decorators import apigw_require | ||
| from bk_plugin_framework.runtime.callback.api import callback, parse_callback_token |
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.
这里bk_plugin_framework是本地模块吧,其他都是第三方依赖,应该分开的
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.
其他应该也有类似的问题
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.
已修复这个问题
| # DO NOT DELETE ANY PACKAGE IN base SECTION !!! | ||
| bk-plugin-framework==2.2.9 | ||
| # opentelemetry | ||
| amqp==2.6.1 |
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.
本地用于测试增加的依赖包不应该放上来,正常安装runtime和framework就够了
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.
已修改
| description: pip version control | ||
| - name: BK_APIGW_MANAGER_MAINTAINERS | ||
| value: {{cookiecutter.init_apigw_maintainer}} | ||
| value: simonyi |
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.
这里有名字
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.
已修改还原
| procCommand: celery-prometheus-exporter --broker amqp://$RABBITMQ_USER:$RABBITMQ_PASSWORD@$RABBITMQ_HOST:$RABBITMQ_PORT/$RABBITMQ_VHOST --addr 0.0.0.0:5001 --queue-list plugin_schedule plugin_callback schedule_delete | ||
| configuration: | ||
| env: | ||
| - name: PYTHONPATH |
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.
这个文件的环境变量不应该改吧
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.
已修改回复为模板样例
| from rest_framework import serializers | ||
|
|
||
|
|
||
| def enveloper(serializer_class, many: bool = False): |
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.
最好有比较明确的含义,比如StandardResponse类似的
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.
已经修改为standard_response_enveloper
| operation_summary="Get plugin execution log with trace_id", | ||
| responses={200: LogsResponseSerializer}, | ||
| @extend_schema( | ||
| summary="Get plugin execution log with trace_id", |
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.
这里需要确认下operation_id是否必填的,还有几个其他接口也有类似的
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.
非必需的,不填 apigw 会自动命名为视图类名加上操作类型,类似 plugin_get、plugin_post 这种
| user_verified_required=True, | ||
| app_verified_required=True, | ||
| resource_permission_required=True, | ||
| description_en="插件调用", |
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.
描述不太准确吧,其他也有不准确的,一起看下
|
|
||
| def _append_plugin_api_resource(self): | ||
| """在 resources.yaml 的 paths 节点下追加 plugin_api 资源配置""" | ||
| filepath = "/app/bk_plugin_runtime/resources.yaml" |
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.
最好用相对路径,这路是蓝鲸内部署的路径,如果paas构建环境换了,那这里就有问题了
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.
已修改为与 apigw 生成 resources.yaml 的路径保持一致
| responses={200: ScheduleResponseSerializer}, | ||
| @extend_schema( | ||
| summary="获取插件调度详情", | ||
| request=ScheduleParamsSerializer, |
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.
可编程网关的文档用的是parameters,可能需要确认下是不是get请求的旧用parameters,post请求的才用request
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.
是的,我修改一下
feat: 新增蓝鲸插件框架集成蓝鲸可编程网关 && 插件部署优化功能