Skip to content

Commit

Permalink
refactor(backend): 修改gtm配置,默认开发分支为1.4.0 TencentBlueKing#3375
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud authored and zhangzhw8 committed Feb 28, 2024
1 parent 9bc3629 commit 267cce2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gtmproject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ project:
# 主分支
default_branch: "master"
# 默认目标分支
default_target_branch: "v1.3.0"
default_target_branch: "v1.4.0"
# 默认单据来源
default_source: "github"
# 默认事件类型
Expand Down
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_services/dbpermission/db_authorize/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
PreCheckExcelAuthorizeRulesResponseSerializer,
PreCheckExcelAuthorizeRulesSerializer,
)
from backend.iam_app.handlers.drf_perm import DBManageIAMPermission
from backend.iam_app.handlers.drf_perm.base import DBManagePermission

SWAGGER_TAG = "db_services/permission/authorize"

Expand All @@ -41,7 +41,7 @@ class DBAuthorizeViewSet(viewsets.SystemViewSet):
excel_authorize_meta = ExcelAuthorizeMeta

def _get_custom_permissions(self):
return [DBManageIAMPermission()]
return [DBManagePermission()]

def _view_common_handler(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"""

from backend.db_services.dbpermission.db_account.views import BaseDBAccountViewSet
from backend.iam_app.handlers.drf_perm import DBManageIAMPermission
from backend.iam_app.handlers.drf_perm.base import DBManagePermission


class DBAccountViewSet(BaseDBAccountViewSet):
def _get_custom_permissions(self):
return [DBManageIAMPermission()]
return [DBManagePermission()]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
MongoDBPreCheckAuthorizeRulesResponseSerializer,
MongoDBPreCheckAuthorizeRulesSerializer,
)
from backend.iam_app.handlers.drf_perm import DBManageIAMPermission
from backend.iam_app.handlers.drf_perm.base import DBManagePermission

SWAGGER_TAG = "db_services/permission/authorize"

Expand All @@ -36,7 +36,7 @@ class DBAuthorizeViewSet(BaseDBAuthorizeViewSet):
excel_authorize_meta = MongoDBExcelAuthorizeMeta

def _get_custom_permissions(self):
return [DBManageIAMPermission()]
return [DBManagePermission()]

@common_swagger_auto_schema(
operation_summary=_("规则前置检查"),
Expand Down
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_services/mongodb/restore/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
from backend.db_services.mongodb.restore.constants import BACKUP_LOG_RANGE_DAYS
from backend.db_services.mongodb.restore.handlers import MongoDBRestoreHandler
from backend.db_services.mongodb.restore.serializers import BackupLogRollbackTimeSerializer
from backend.iam_app.handlers.drf_perm import DBManageIAMPermission
from backend.iam_app.handlers.drf_perm.base import DBManagePermission

SWAGGER_TAG = "db_services/mongodb/restore"


class MongoDBRestoreViewSet(viewsets.SystemViewSet):
def _get_custom_permissions(self):
return [DBManageIAMPermission()]
return [DBManagePermission()]

@common_swagger_auto_schema(
operation_summary=_("通过日志平台获取集群单据备份记录"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Dict, List

from django.db import transaction
from django.utils.translation import ugettext as _
from pipeline.component_framework.component import Component
from pipeline.core.flow.activity import Service

Expand Down Expand Up @@ -47,7 +48,7 @@ def decommission_proxies(self, cluster: Cluster, proxies: List[Dict]):
proxy_objs = common.filter_out_instance_obj(proxies, cluster.proxyinstance_set.all())
_t = common.not_exists(proxies, proxy_objs)
if _t:
raise Exception("{} 存在不是本集群的实例下架列表".format(_t))
raise Exception(_("{} 存在不是本集群的实例下架列表").format(_t))

machine_obj, cc_manage = defaultdict(dict), CcManage(cluster.bk_biz_id)
cc_manage.delete_service_instance(bk_instance_ids=[obj.bk_instance_id for obj in proxy_objs])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pytest
from openpyxl.writer.excel import save_virtual_workbook

from backend.db_meta.enums import ClusterType
from backend.db_services.mysql.permission.authorize.dataclass import MySQLAuthorizeMeta, MySQLExcelAuthorizeMeta
from backend.db_services.mysql.permission.authorize.handlers import MySQLAuthorizeHandler
from backend.db_services.mysql.permission.constants import AUTHORIZE_EXCEL_HEADER
Expand Down Expand Up @@ -52,7 +53,7 @@ def test_pre_check_excel_rules(self, query_fixture):
excel = io.BytesIO(excel_bytes)

excel_obj = namedtuple("ExcelObj", ["file"])(file=excel)
excel_authorize = MySQLExcelAuthorizeMeta(authorize_file=excel_obj)
excel_authorize = MySQLExcelAuthorizeMeta(authorize_file=excel_obj, cluster_type=ClusterType.TenDBHA)
excel_authorize.authorize_excel_data = ExcelHandler.paser(excel_authorize.authorize_file.file)

authorize_data_list = self.handler.pre_check_excel_rules(excel_authorize)
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/backend/tests/ticket/test_ticket_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class TestTicketFlow:
@patch("backend.db_services.cmdb.biz.CCApi", CCApiMock())
@patch("backend.db_services.cmdb.biz.Permission", PermissionMock)
@patch(
"backend.db_services.mysql.permission.db_account.handlers.MySQLPrivManagerApi.list_account_rules",
"backend.db_services.dbpermission.db_account.handlers.DBPrivManagerApi.list_account_rules",
return_value=MYSQL_PERMISSION_ACCOUNT,
)
def test_authorize_ticket_flow(
Expand Down

0 comments on commit 267cce2

Please sign in to comment.