feat: 新增蓝鲸插件框架集成蓝鲸可编程网关 && 插件部署优化功能#111
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.
这里bk_plugin_framework是本地模块吧,其他都是第三方依赖,应该分开的
| # 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.
本地用于测试增加的依赖包不应该放上来,正常安装runtime和framework就够了
| description: pip version control | ||
| - name: BK_APIGW_MANAGER_MAINTAINERS | ||
| value: {{cookiecutter.init_apigw_maintainer}} | ||
| value: simonyi |
| 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 |
| from rest_framework import serializers | ||
|
|
||
|
|
||
| def enveloper(serializer_class, many: bool = False): |
There was a problem hiding this comment.
最好有比较明确的含义,比如StandardResponse类似的
There was a problem hiding this comment.
已经修改为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.
这里需要确认下operation_id是否必填的,还有几个其他接口也有类似的
There was a problem hiding this comment.
非必需的,不填 apigw 会自动命名为视图类名加上操作类型,类似 plugin_get、plugin_post 这种
| user_verified_required=True, | ||
| app_verified_required=True, | ||
| resource_permission_required=True, | ||
| description_en="插件调用", |
|
|
||
| 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.
最好用相对路径,这路是蓝鲸内部署的路径,如果paas构建环境换了,那这里就有问题了
There was a problem hiding this comment.
已修改为与 apigw 生成 resources.yaml 的路径保持一致
| responses={200: ScheduleResponseSerializer}, | ||
| @extend_schema( | ||
| summary="获取插件调度详情", | ||
| request=ScheduleParamsSerializer, |
There was a problem hiding this comment.
可编程网关的文档用的是parameters,可能需要确认下是不是get请求的旧用parameters,post请求的才用request
feat: 新增蓝鲸插件框架集成蓝鲸可编程网关 && 插件部署优化功能