Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fea6a77
feat: 新增接口响应封装 && pre-commit规范文件
Dec 29, 2025
c6c47b0
feat: 新增@extend_schema装饰器声明接口以支持自动接入蓝鲸API网关
Dec 30, 2025
da9f146
feat: 蓝鲸插件框架集成可编程网关实现部署即发布网关
Jan 6, 2026
9a2ac10
fix: 修复第三方模块和本地模块在同一代码块的bug
Jan 6, 2026
3d906e3
fix: 修复第三方模块和本地模块在同一代码块的bug
Jan 6, 2026
06bdc38
delete: 删除runtime中多余的用户认证配置
Jan 6, 2026
80c9161
feat: 恢复app_desc.yml文件的环境变量
Jan 7, 2026
5fa1e6f
revert: 恢复app_desc.yaml的修改
Jan 7, 2026
fb3b245
fix: 恢复requirements.txt文件
Jan 7, 2026
71b4b14
fix: 恢复app_desc.yaml环境变量配置
Jan 7, 2026
8a00f40
feat: 新增bk_plugin模块下的apis通用视图接口
Jan 8, 2026
4a99834
feat: 新增通过对比resource.yaml文件hash值的方式实现网关部署优化
Jan 8, 2026
fb12e40
fix: 追加plugin_api的信息到resources.yaml文件中解决method为ANY的问题
Jan 8, 2026
915db1c
fix: 屏蔽schedule接口信息同步到网关apigw
Jan 8, 2026
6b503a4
fix: 修改接口描述不规范问题
Jan 9, 2026
b9f44c0
fix: 修改 resources.yaml的获取路径方式与 apigw 保持一致
Jan 9, 2026
cb88b1c
fix: 删除Schedule视图接口多余的参数声明
Jan 9, 2026
0ceb80e
minor: runtime release V2.1.3
dengyh Jan 9, 2026
2cd6c8f
feat: 新增pre-commit规范检查工具 --story=130029401
Jan 16, 2026
2353f20
fix: 添加#noqa注释解决__init__.py文件的F401错误 --story=130029401
Jan 16, 2026
51de7b7
fix: 调整蓝鲸插件接口信息同步到网关的逻辑 && 蓝鲸插件部署优化 --story=130029401
Jan 19, 2026
79c9947
fix: 修改bk_plugin_framework的pyproject.toml文件 --story=130029401
Jan 19, 2026
71d8d2c
fix: 修改bk_plugin_runtime的 pyproject.toml相关依赖 --story=130029401
Jan 19, 2026
57313a6
fix: 增加drf_spectacular第三方依赖包支持可编程网关 --story=130029401
Jan 19, 2026
762b10f
fix: 修改bk-plugin-framework 的 tag 版本 --story=130029401
Jan 19, 2026
fb6fe0e
fix: 移除django-environ 导入
Jan 19, 2026
5d64706
fix: 修改 runtime 的pyproject.toml文件 --story=130029401
Jan 19, 2026
2e57614
minor: framework release 2.3.4rc3
Jan 19, 2026
de28d3b
fix: 修改插件框架中的bk-plugin-framework版本 --story=130029401
Jan 19, 2026
c5947ff
fix: pre-commit 调试代码格式规范 --story=130029401
Jan 19, 2026
18cb566
fix: bk-plugin-framework 的 poetry.lock更新
Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[flake8]
ignore = F405, W503, E203
exclude =
*migrations*,
# python related
*.pyc,
.git,
__pycache__,
*/node_modules/*
./static/*
./blueking/*
*/blueking/*
./blueapps/*
*/blueapps/*
./pipeline/*
./sites/*
./config/default.py
./scripts_tools/*
./support-files/*
./upgrade.py
./iam/*


max-line-length=120
max-complexity=26
format=pylint
show_source=False
statistics=True
count=True
4 changes: 4 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
profile = black
known_first_party = bk_plugin_framework,bk_plugin_runtime
line_length = 120
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
default_stages: [pre-commit]
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict

- repo: https://github.com/psf/black
rev: 25.12.0
hooks:
- id: black
language_version: python3.10
args:
- "--line-length=120"

- repo: https://github.com/pycqa/isort
rev: 7.0.0
hooks:
- id: isort

- repo: https://github.com/pycqa/flake8
rev: 7.3.0
hooks:
- id: flake8
args:
- "--config"
- ".flake8"
23 changes: 0 additions & 23 deletions bk-plugin-framework/.flake8

This file was deleted.

1 change: 0 additions & 1 deletion bk-plugin-framework/bk_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
1 change: 0 additions & 1 deletion bk-plugin-framework/bk_plugin/versions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
1 change: 0 additions & 1 deletion bk-plugin-framework/bk_plugin_framework/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
1 change: 0 additions & 1 deletion bk-plugin-framework/bk_plugin_framework/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion bk-plugin-framework/bk_plugin_framework/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -9,6 +8,7 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""

from enum import Enum


Expand Down
5 changes: 3 additions & 2 deletions bk-plugin-framework/bk_plugin_framework/envs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -9,15 +8,17 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
import os

import base64
import hashlib
import logging
import os

try:
from pydantic.v1 import BaseSettings
except ImportError:
from pydantic import BaseSettings

from django.conf import settings as default_settings

logger = logging.getLogger("bk_plugin")
Expand Down
4 changes: 2 additions & 2 deletions bk-plugin-framework/bk_plugin_framework/hub/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -10,9 +9,10 @@
specific language governing permissions and limitations under the License.
"""

import logging
import os
import typing
import logging

from bk_plugin_framework.utils.module_load import load_form_module_path

logger = logging.getLogger("bk-plugin-framework")
Expand Down
12 changes: 6 additions & 6 deletions bk-plugin-framework/bk_plugin_framework/kit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -14,13 +13,14 @@
from pydantic.v1 import Field
except ImportError:
from pydantic import Field # noqa

from bk_plugin_framework.kit.plugin import ( # noqa
Plugin,
InputsModel,
Callback,
Context,
OutputsModel,
ContextRequire,
State,
Callback,
FormModel,
InputsModel,
OutputsModel,
Plugin,
State,
)
12 changes: 6 additions & 6 deletions bk-plugin-framework/bk_plugin_framework/kit/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -9,18 +8,19 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""

import json

from django.utils.decorators import method_decorator
from apigw_manager.apigw.decorators import apigw_require
from bkoauth import get_app_access_token
from django.conf import settings as default_settings
from rest_framework.views import APIView
from django.utils.decorators import method_decorator
from rest_framework.request import Request
from bkoauth import get_app_access_token
from apigw_manager.apigw.decorators import apigw_require
from rest_framework.views import APIView

from bk_plugin_framework.envs import settings
from bk_plugin_framework.kit.decorators import login_exempt, inject_user_token
from bk_plugin_framework.kit.authentication import CsrfExemptSessionAuthentication
from bk_plugin_framework.kit.decorators import inject_user_token, login_exempt

custom_authentication_classes = (
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -9,6 +8,7 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""

from rest_framework.authentication import SessionAuthentication


Expand Down
2 changes: 1 addition & 1 deletion bk-plugin-framework/bk_plugin_framework/kit/decorators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -9,6 +8,7 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""

from functools import wraps

from bk_plugin_framework.envs import settings
Expand Down
12 changes: 7 additions & 5 deletions bk-plugin-framework/bk_plugin_framework/kit/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -10,18 +9,21 @@
specific language governing permissions and limitations under the License.
"""

import inspect
import re
import typing
import inspect

try:
from pydantic.v1 import BaseModel
except ImportError:
from pydantic import BaseModel

from bk_plugin_framework.hub import VersionHub
from bk_plugin_framework.constants import State
from bk_plugin_framework.runtime.callback.api import prepare_callback, CallbackPreparation
from bk_plugin_framework.hub import VersionHub
from bk_plugin_framework.runtime.callback.api import (
CallbackPreparation,
prepare_callback,
)

VALID_VERSION_PATTERN = re.compile(r"^[0-9]+\.[0-9]+\.[0-9][a-z0-9]*$")

Expand Down Expand Up @@ -50,7 +52,7 @@ class ContextRequire(BaseModel):
pass


class Callback(object):
class Callback:
def __init__(self, callback_id: str = "", callback_data: dict = {}):
self.id = callback_id
self.data = callback_data
Expand Down
13 changes: 7 additions & 6 deletions bk-plugin-framework/bk_plugin_framework/metrics.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
import os
import socket
import time
from functools import wraps

from prometheus_client import Counter, Histogram, Gauge
from prometheus_client import Counter, Gauge, Histogram


def get_hostname():
Expand Down Expand Up @@ -129,14 +128,16 @@ def _wrapper(*args, **kwargs):

# 正在执行的 EXECUTE 数量
BK_PLUGIN_EXECUTE_RUNNING_PROCESSES = Gauge(
name="bk_plugin_execute_running_processes", documentation="count running state processes",
labelnames=["hostname", "version"]
name="bk_plugin_execute_running_processes",
documentation="count running state processes",
labelnames=["hostname", "version"],
)

# 正在执行的 SCHEDULE 数量
BK_PLUGIN_SCHEDULE_RUNNING_PROCESSES = Gauge(
name="bk_plugin_schedule_running_processes", documentation="count running state schedules",
labelnames=["hostname", "version"]
name="bk_plugin_schedule_running_processes",
documentation="count running state schedules",
labelnames=["hostname", "version"],
)

# CALLBACK 异常次数
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
12 changes: 6 additions & 6 deletions bk-plugin-framework/bk_plugin_framework/runtime/callback/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand All @@ -9,23 +8,24 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
import uuid
import time

import json
import logging
import time
import uuid

from django.conf import settings as default_settings
from celery import current_app
from cryptography.fernet import Fernet
from django.conf import settings as default_settings

from bk_plugin_framework.constants import State
from bk_plugin_framework.envs import settings
from bk_plugin_framework.runtime.schedule.models import Schedule
from bk_plugin_framework.constants import State

logger = logging.getLogger("bk_plugin")


class CallbackPreparation(object):
class CallbackPreparation:
def __init__(self, callback_id: str, callback_url: str):
self.id = callback_id
self.url = callback_url
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云 - PaaS平台 (BlueKing - PaaS System) available.
Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down
Loading