From 0e1c39025df8bfdc83e0a6d83980b5eb7f7a56d4 Mon Sep 17 00:00:00 2001 From: pagezz Date: Wed, 3 Apr 2019 21:31:58 +0800 Subject: [PATCH 01/87] V3.3.8 (#29) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * improve: #25 readme 添加单元测试和测试覆盖率 badge * improve: #25 readme 文档优化 --- readme.md | 4 +++- readme_en.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 62edd45a5e..a0d1a90385 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,9 @@ ![](docs/resource/img/bk_sops.png) --- [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/Tencent/bk-sops/blob/master/LICENSE) -[![Release](https://img.shields.io/badge/release-3.1.32-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases) +[![Release](https://img.shields.io/badge/release-3.3.8-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases) +[![travis-ci](https://travis-ci.com/Tencent/bk-sops.svg?branch=master)](https://travis-ci.com/Tencent/bk-sops) +[![Coverage Status](https://codecov.io/gh/Tencent/bk-sops/branch/master/graph/badge.svg)](https://codecov.io/gh/Tencent/bk-sops) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/bk-sops/pulls) [(English Documents Available)](readme_en.md) diff --git a/readme_en.md b/readme_en.md index e282d57e6b..e36544129b 100644 --- a/readme_en.md +++ b/readme_en.md @@ -2,7 +2,9 @@ ![](docs/resource/img/bk_sops.png) --- [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/Tencent/bk-sops/blob/master/LICENSE) -[![Release](https://img.shields.io/badge/release-3.1.32-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases) +[![Release](https://img.shields.io/badge/release-3.3.8-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases) +[![travis-ci](https://travis-ci.com/Tencent/bk-sops.svg?branch=master)](https://travis-ci.com/Tencent/bk-sops) +[![Coverage Status](https://codecov.io/gh/Tencent/bk-sops/branch/master/graph/badge.svg)](https://codecov.io/gh/Tencent/bk-sops) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/bk-sops/pulls) Standard OPS is a product in the Tencent Blueking product system, designed to arrange task process and execution through a visual graphical interface. From a4a841bdc44a18518c6c53c04a02996ddc7da2be Mon Sep 17 00:00:00 2001 From: pagezz Date: Thu, 4 Apr 2019 21:51:46 +0800 Subject: [PATCH 02/87] V3.3.8 (#35) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * improve: #25 readme 添加单元测试和测试覆盖率 badge * improve: #25 readme 文档优化 * feature: django工程的静态资源提前收集到 static 目录 #30 (#31) --- config/default.py | 1 - static/account/login.js | 62 + static/admin/css/base.css | 978 ++ static/admin/css/changelists.css | 344 + static/admin/css/dashboard.css | 27 + static/admin/css/fonts.css | 20 + static/admin/css/forms.css | 515 + static/admin/css/login.css | 78 + static/admin/css/rtl.css | 264 + static/admin/css/widgets.css | 565 + static/admin/fonts/LICENSE.txt | 202 + static/admin/fonts/README.txt | 2 + static/admin/fonts/Roboto-Bold-webfont.woff | Bin 0 -> 82564 bytes static/admin/fonts/Roboto-Light-webfont.woff | Bin 0 -> 81348 bytes .../admin/fonts/Roboto-Regular-webfont.woff | Bin 0 -> 80304 bytes static/admin/img/LICENSE | 20 + static/admin/img/README.txt | 7 + static/admin/img/calendar-icons.svg | 14 + static/admin/img/gis/move_vertex_off.svg | 1 + static/admin/img/gis/move_vertex_on.svg | 1 + static/admin/img/icon-addlink.svg | 3 + static/admin/img/icon-alert.svg | 3 + static/admin/img/icon-calendar.svg | 9 + static/admin/img/icon-changelink.svg | 3 + static/admin/img/icon-clock.svg | 9 + static/admin/img/icon-deletelink.svg | 3 + static/admin/img/icon-no.svg | 3 + static/admin/img/icon-unknown-alt.svg | 3 + static/admin/img/icon-unknown.svg | 3 + static/admin/img/icon-yes.svg | 3 + static/admin/img/inline-delete.svg | 3 + static/admin/img/search.svg | 3 + static/admin/img/selector-icons.svg | 34 + static/admin/img/sorting-icons.svg | 19 + static/admin/img/tooltag-add.svg | 3 + static/admin/img/tooltag-arrowright.svg | 3 + static/admin/js/SelectBox.js | 144 + static/admin/js/SelectFilter2.js | 236 + static/admin/js/actions.js | 153 + static/admin/js/actions.min.js | 6 + static/admin/js/admin/DateTimeShortcuts.js | 431 + static/admin/js/admin/RelatedObjectLookups.js | 175 + static/admin/js/calendar.js | 208 + static/admin/js/cancel.js | 9 + static/admin/js/change_form.js | 20 + static/admin/js/collapse.js | 26 + static/admin/js/collapse.min.js | 2 + static/admin/js/core.js | 250 + static/admin/js/inlines.js | 295 + static/admin/js/inlines.min.js | 10 + static/admin/js/jquery.init.js | 8 + static/admin/js/popup_response.js | 16 + static/admin/js/prepopulate.js | 42 + static/admin/js/prepopulate.min.js | 1 + static/admin/js/prepopulate_init.js | 10 + static/admin/js/timeparse.js | 106 + static/admin/js/urlify.js | 179 + .../admin/js/vendor/jquery/LICENSE-JQUERY.txt | 26 + static/admin/js/vendor/jquery/jquery.js | 9842 +++++++++++++++++ static/admin/js/vendor/jquery/jquery.min.js | 4 + .../js/vendor/xregexp/LICENSE-XREGEXP.txt | 21 + static/admin/js/vendor/xregexp/xregexp.js | 2308 ++++ static/admin/js/vendor/xregexp/xregexp.min.js | 18 + static/components/atoms/bk/http.js | 76 + static/components/atoms/bk/notify.js | 107 + static/components/atoms/bk/pause.js | 11 + static/components/atoms/bk/timer.js | 42 + static/components/atoms/job/job.png | Bin 0 -> 1634 bytes .../atoms/job/job_fast_execute_script.js | 304 + .../atoms/job/job_fast_push_file.js | 113 + .../atoms/job/job_push_local_files.js | 68 + .../components/atoms/sites/open/bk/notify.js | 132 + static/components/atoms/sites/open/cc/cc.png | Bin 0 -> 3406 bytes .../sites/open/cc/cc_batch_delete_set.js | 30 + .../atoms/sites/open/cc/cc_create_set.js | 48 + .../atoms/sites/open/cc/cc_empty_set_hosts.js | 30 + .../sites/open/cc/cc_replace_fault_machine.js | 55 + .../sites/open/cc/cc_transfer_host_module.js | 62 + .../sites/open/cc/cc_transfer_to_idle.js | 25 + .../atoms/sites/open/cc/cc_update_host.js | 58 + .../atoms/sites/open/cc/cc_update_module.js | 63 + .../atoms/sites/open/cc/cc_update_set.js | 63 + .../open/cc/cc_update_set_service_status.js | 48 + .../atoms/sites/open/job/job_execute_task.js | 93 + static/components/icons/cc.png | Bin 0 -> 3406 bytes static/components/icons/job.png | Bin 0 -> 1634 bytes static/core/images/bk_sops.png | Bin 0 -> 15730 bytes static/core/js/paas_api.js | 20 + static/djcelery/style.css | 4 + static/guardian/img/icon-no.svg | 3 + static/guardian/img/icon-yes.svg | 3 + static/variables/password.js | 24 + static/variables/select.js | 72 + static/variables/select_meta.js | 75 + .../sites/open/var_cmdb_ip_selector.js | 32 + static/variables/sites/open/var_ip_picker.js | 245 + 96 files changed, 19659 insertions(+), 1 deletion(-) create mode 100644 static/account/login.js create mode 100644 static/admin/css/base.css create mode 100644 static/admin/css/changelists.css create mode 100644 static/admin/css/dashboard.css create mode 100644 static/admin/css/fonts.css create mode 100644 static/admin/css/forms.css create mode 100644 static/admin/css/login.css create mode 100644 static/admin/css/rtl.css create mode 100644 static/admin/css/widgets.css create mode 100644 static/admin/fonts/LICENSE.txt create mode 100644 static/admin/fonts/README.txt create mode 100644 static/admin/fonts/Roboto-Bold-webfont.woff create mode 100644 static/admin/fonts/Roboto-Light-webfont.woff create mode 100644 static/admin/fonts/Roboto-Regular-webfont.woff create mode 100644 static/admin/img/LICENSE create mode 100644 static/admin/img/README.txt create mode 100644 static/admin/img/calendar-icons.svg create mode 100644 static/admin/img/gis/move_vertex_off.svg create mode 100644 static/admin/img/gis/move_vertex_on.svg create mode 100644 static/admin/img/icon-addlink.svg create mode 100644 static/admin/img/icon-alert.svg create mode 100644 static/admin/img/icon-calendar.svg create mode 100644 static/admin/img/icon-changelink.svg create mode 100644 static/admin/img/icon-clock.svg create mode 100644 static/admin/img/icon-deletelink.svg create mode 100644 static/admin/img/icon-no.svg create mode 100644 static/admin/img/icon-unknown-alt.svg create mode 100644 static/admin/img/icon-unknown.svg create mode 100644 static/admin/img/icon-yes.svg create mode 100644 static/admin/img/inline-delete.svg create mode 100644 static/admin/img/search.svg create mode 100644 static/admin/img/selector-icons.svg create mode 100644 static/admin/img/sorting-icons.svg create mode 100644 static/admin/img/tooltag-add.svg create mode 100644 static/admin/img/tooltag-arrowright.svg create mode 100644 static/admin/js/SelectBox.js create mode 100644 static/admin/js/SelectFilter2.js create mode 100644 static/admin/js/actions.js create mode 100644 static/admin/js/actions.min.js create mode 100644 static/admin/js/admin/DateTimeShortcuts.js create mode 100644 static/admin/js/admin/RelatedObjectLookups.js create mode 100644 static/admin/js/calendar.js create mode 100644 static/admin/js/cancel.js create mode 100644 static/admin/js/change_form.js create mode 100644 static/admin/js/collapse.js create mode 100644 static/admin/js/collapse.min.js create mode 100644 static/admin/js/core.js create mode 100644 static/admin/js/inlines.js create mode 100644 static/admin/js/inlines.min.js create mode 100644 static/admin/js/jquery.init.js create mode 100644 static/admin/js/popup_response.js create mode 100644 static/admin/js/prepopulate.js create mode 100644 static/admin/js/prepopulate.min.js create mode 100644 static/admin/js/prepopulate_init.js create mode 100644 static/admin/js/timeparse.js create mode 100644 static/admin/js/urlify.js create mode 100644 static/admin/js/vendor/jquery/LICENSE-JQUERY.txt create mode 100644 static/admin/js/vendor/jquery/jquery.js create mode 100644 static/admin/js/vendor/jquery/jquery.min.js create mode 100644 static/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt create mode 100644 static/admin/js/vendor/xregexp/xregexp.js create mode 100644 static/admin/js/vendor/xregexp/xregexp.min.js create mode 100644 static/components/atoms/bk/http.js create mode 100644 static/components/atoms/bk/notify.js create mode 100644 static/components/atoms/bk/pause.js create mode 100644 static/components/atoms/bk/timer.js create mode 100644 static/components/atoms/job/job.png create mode 100644 static/components/atoms/job/job_fast_execute_script.js create mode 100644 static/components/atoms/job/job_fast_push_file.js create mode 100644 static/components/atoms/job/job_push_local_files.js create mode 100644 static/components/atoms/sites/open/bk/notify.js create mode 100644 static/components/atoms/sites/open/cc/cc.png create mode 100644 static/components/atoms/sites/open/cc/cc_batch_delete_set.js create mode 100644 static/components/atoms/sites/open/cc/cc_create_set.js create mode 100644 static/components/atoms/sites/open/cc/cc_empty_set_hosts.js create mode 100644 static/components/atoms/sites/open/cc/cc_replace_fault_machine.js create mode 100644 static/components/atoms/sites/open/cc/cc_transfer_host_module.js create mode 100644 static/components/atoms/sites/open/cc/cc_transfer_to_idle.js create mode 100644 static/components/atoms/sites/open/cc/cc_update_host.js create mode 100644 static/components/atoms/sites/open/cc/cc_update_module.js create mode 100644 static/components/atoms/sites/open/cc/cc_update_set.js create mode 100644 static/components/atoms/sites/open/cc/cc_update_set_service_status.js create mode 100644 static/components/atoms/sites/open/job/job_execute_task.js create mode 100644 static/components/icons/cc.png create mode 100644 static/components/icons/job.png create mode 100644 static/core/images/bk_sops.png create mode 100644 static/core/js/paas_api.js create mode 100644 static/djcelery/style.css create mode 100644 static/guardian/img/icon-no.svg create mode 100644 static/guardian/img/icon-yes.svg create mode 100644 static/variables/password.js create mode 100644 static/variables/select.js create mode 100644 static/variables/select_meta.js create mode 100644 static/variables/sites/open/var_cmdb_ip_selector.js create mode 100644 static/variables/sites/open/var_ip_picker.js diff --git a/config/default.py b/config/default.py index fcd02d8551..ba23cd3b05 100644 --- a/config/default.py +++ b/config/default.py @@ -52,7 +52,6 @@ 'gcloud.commons.template', 'gcloud.periodictask', 'pipeline', - 'pipeline.blueflow', 'pipeline.component_framework', 'pipeline.variables', 'pipeline.engine', diff --git a/static/account/login.js b/static/account/login.js new file mode 100644 index 0000000000..2ec304f315 --- /dev/null +++ b/static/account/login.js @@ -0,0 +1,62 @@ +/** +* Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. +* Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. +* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at +* http://opensource.org/licenses/MIT +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 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. +*/ +/** + * 登录相关 JS,其中 remote_static_url & static_url 来源于全局变量 + */ + +document.write(" - - + diff --git a/pipeline/blueflow/src/components/common/RenderForm/formMixins.js b/pipeline/blueflow/src/components/common/RenderForm/formMixins.js index be44e4dc78..41a6aaa9d2 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/formMixins.js +++ b/pipeline/blueflow/src/components/common/RenderForm/formMixins.js @@ -42,7 +42,8 @@ const COMMON_ATTRS = { default: true }, formMode: { - type: Boolean + type: Boolean, + default: true }, parentValue: { type: [String, Number, Boolean, Array, Object] diff --git a/pipeline/blueflow/src/pages/task/TaskExecute/ModifyParams.vue b/pipeline/blueflow/src/pages/task/TaskExecute/ModifyParams.vue index a67de82722..75d5e422b2 100644 --- a/pipeline/blueflow/src/pages/task/TaskExecute/ModifyParams.vue +++ b/pipeline/blueflow/src/pages/task/TaskExecute/ModifyParams.vue @@ -19,7 +19,8 @@ v-if="!isParamsEmpty" ref="TaskParamEdit" :constants="constants" - :editable="paramsCanBeModify"> + :editable="paramsCanBeModify" + @onChangeConfigLoading="onChangeConfigLoading"> @@ -45,7 +46,8 @@ export default { return { bkMessageInstance: null, constants: [], - loading: false, + cntLoading: true, // 全局变量加载 + configLoading: true, // 变量配置项加载 pending: false, // 提交修改中 i18n: { change_params: gettext("修改全局参数"), @@ -56,6 +58,9 @@ export default { computed: { isParamsEmpty () { return !Object.keys(this.constants).length + }, + loading () { + return this.isParamsEmpty ? this.cntLoading : (this.cntLoading || this.configLoading) } }, created () { @@ -67,7 +72,7 @@ export default { 'instanceModifyParams' ]), async getTaskData () { - this.loading = true + this.cntLoading = true try { const instanceData = await this.getTaskInstanceData(this.instance_id) const pipelineData = JSON.parse(instanceData.pipeline_tree) @@ -82,7 +87,7 @@ export default { } catch (e) { errorHandler(e, this) } finally { - this.loading = false + this.cntLoading = false } }, async onModifyParams () { @@ -121,6 +126,9 @@ export default { } finally { this.pending = false } + }, + onChangeConfigLoading (val) { + this.configLoading = val } } } diff --git a/pipeline/blueflow/src/pages/task/TaskParamEdit.vue b/pipeline/blueflow/src/pages/task/TaskParamEdit.vue index ecf0a13086..ce88fa3210 100644 --- a/pipeline/blueflow/src/pages/task/TaskParamEdit.vue +++ b/pipeline/blueflow/src/pages/task/TaskParamEdit.vue @@ -196,34 +196,6 @@ export default { @import '@/scss/config.scss'; .task-param-wrapper { /deep/ .render-form { - .rf-group-name { - margin-bottom: 12px; - h3 { - display: inline-block; - margin: 0; - margin-bottom: -1px; - padding: 5px 14px; - font-size: 14px; - font-weight: 600; - color: #313238; - } - &:before { - content: ''; - display: inline-block; - position: relative; - top: 4px; - width: 2px; - height: 20px; - background: #A3C5FD; - } - } - .rf-group-desc { - position: absolute; - right: 0; - top: 10px; - color: $yellowBg; - font-size: 14px; - } .form-item { margin-bottom: 20px; } diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue index c87557b0b6..98157ed2a1 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue @@ -406,13 +406,13 @@ export default { this.initData() }, mounted () { - window.addEventListener('click', this.handleNodeConfigPanelShow, false) + window.addEventListener('click', this.handleNodeConfigPanelShow, true) if (this.errorCouldBeIgnored) { this.isDisable = true } }, beforeDestroy (){ - window.removeEventListener('click', this.handleNodeConfigPanelShow, false) + window.removeEventListener('click', this.handleNodeConfigPanelShow, true) }, watch: { idOfNodeInConfigPanel (val) { @@ -706,7 +706,7 @@ export default { return false }, /** - * 处理节点配置面板和全局变量面板之外的点击时间 + * 处理节点配置面板和全局变量面板之外的点击事件 */ handleNodeConfigPanelShow (e) { if (!this.isNodeConfigPanelShow || this.isReuseVarDialogShow) { diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabLocalDraft.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabLocalDraft.vue index 600c264dd6..1ea74f9662 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabLocalDraft.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabLocalDraft.vue @@ -37,46 +37,42 @@ {{ errors.first('draftName') }}
-
- - {{ i18n.serialNumber }} - {{ i18n.draftMessage }} - {{ i18n.saveTime }} - -
-
    - -
  • + + + {{ i18n.serialNumber }} + {{ i18n.draftMessage }} + {{ i18n.saveTime }} + + + + + -
    - - {{index + 1}} - {{draft.data.description.message}} - {{draft.data.description.time}} - - - -
    -
  • -
    -
  • - -

    {{i18n.emptyDraftTip}}

    -
    -
  • -
+
{{ index + 1 }}
+ +
{{draft.data.description.message}}
+ +
{{draft.data.description.time}}
+ + + + + +

{{i18n.emptyDraftTip}}

+ + +
From c2a10d79ef1a94c24ed9d7dce2bbfff664164d16 Mon Sep 17 00:00:00 2001 From: homholueng Date: Thu, 11 Apr 2019 22:41:58 +0800 Subject: [PATCH 34/87] =?UTF-8?q?improvement:=20=E5=B0=86=20importer=20?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=B1=BB=E7=A7=BB=E5=8A=A8=E5=88=B0=20extern?= =?UTF-8?q?al=5Fplugins=20app=20=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline/contrib/external_plugins/apps.py | 6 +++++- pipeline/contrib/external_plugins/loader.py | 2 +- .../contrib/external_plugins/models/base.py | 2 -- .../contrib/external_plugins/models/source.py | 2 +- pipeline/contrib/external_plugins/tests/mock.py | 6 ++++++ .../external_plugins/tests/mock_settings.py | 17 +++++++++++++++++ .../external_plugins/tests/utils}/__init__.py | 0 .../tests}/utils/importer/__init__.py | 3 --- .../tests/utils/importer/test_base.py | 6 +++--- .../tests/utils/importer/test_git.py | 6 +++--- .../tests/utils/importer/test_utils.py | 8 ++++---- .../contrib/external_plugins/utils/__init__.py | 12 ++++++++++++ .../external_plugins/utils/importer/__init__.py | 15 +++++++++++++++ .../external_plugins}/utils/importer/base.py | 0 .../external_plugins}/utils/importer/git.py | 2 +- .../external_plugins}/utils/importer/utils.py | 0 pipeline/tests/mock.py | 6 ------ pipeline/tests/mock_settings.py | 15 --------------- 18 files changed, 68 insertions(+), 40 deletions(-) rename pipeline/{tests/utils/importer => contrib/external_plugins/tests/utils}/__init__.py (100%) rename pipeline/{ => contrib/external_plugins/tests}/utils/importer/__init__.py (84%) rename pipeline/{ => contrib/external_plugins}/tests/utils/importer/test_base.py (97%) rename pipeline/{ => contrib/external_plugins}/tests/utils/importer/test_git.py (97%) rename pipeline/{ => contrib/external_plugins}/tests/utils/importer/test_utils.py (90%) create mode 100644 pipeline/contrib/external_plugins/utils/__init__.py create mode 100644 pipeline/contrib/external_plugins/utils/importer/__init__.py rename pipeline/{ => contrib/external_plugins}/utils/importer/base.py (100%) rename pipeline/{ => contrib/external_plugins}/utils/importer/git.py (97%) rename pipeline/{ => contrib/external_plugins}/utils/importer/utils.py (100%) diff --git a/pipeline/contrib/external_plugins/apps.py b/pipeline/contrib/external_plugins/apps.py index 072ca43cf4..5e662c29eb 100644 --- a/pipeline/contrib/external_plugins/apps.py +++ b/pipeline/contrib/external_plugins/apps.py @@ -16,6 +16,7 @@ import traceback from django.apps import AppConfig +from django.conf import settings from django.db.utils import ProgrammingError from pipeline.conf import settings @@ -30,7 +31,10 @@ def ready(self): from pipeline.contrib.external_plugins import loader # noqa from pipeline.contrib.external_plugins.models import ExternalPackageSource # noqa - if not sys.argv[1:2] == ['test']: + triggers = getattr(settings, 'EXTERNAL_COMPONENTS_LOAD_TRIGGER', {'runserver', 'celery', 'worker'}) + command = sys.argv[1] + + if command in triggers: try: logger.info('Start to update package source from config file...') ExternalPackageSource.update_package_source_from_config(getattr(settings, diff --git a/pipeline/contrib/external_plugins/loader.py b/pipeline/contrib/external_plugins/loader.py index 4d718f0a3d..6e0aaacb62 100644 --- a/pipeline/contrib/external_plugins/loader.py +++ b/pipeline/contrib/external_plugins/loader.py @@ -15,8 +15,8 @@ import importlib import traceback -from pipeline.utils.importer import importer_context from pipeline.contrib.external_plugins.models import source_cls_factory +from pipeline.contrib.external_plugins.utils.importer import importer_context logger = logging.getLogger('root') diff --git a/pipeline/contrib/external_plugins/models/base.py b/pipeline/contrib/external_plugins/models/base.py index 81e2a1fb9c..002c58b3d4 100644 --- a/pipeline/contrib/external_plugins/models/base.py +++ b/pipeline/contrib/external_plugins/models/base.py @@ -11,14 +11,12 @@ specific language governing permissions and limitations under the License. """ -import importlib from copy import deepcopy from abc import abstractmethod from django.db import models from django.utils.translation import ugettext_lazy as _ -from pipeline.utils.importer.utils import importer_context from pipeline.contrib.external_plugins import exceptions from pipeline.contrib.external_plugins.models.fields import JSONTextField diff --git a/pipeline/contrib/external_plugins/models/source.py b/pipeline/contrib/external_plugins/models/source.py index 3ea206de0c..0d662db0ca 100644 --- a/pipeline/contrib/external_plugins/models/source.py +++ b/pipeline/contrib/external_plugins/models/source.py @@ -15,7 +15,7 @@ from django.conf import settings from django.utils.translation import ugettext_lazy as _ -from pipeline.utils.importer.git import GitRepoModuleImporter +from pipeline.contrib.external_plugins.utils.importer.git import GitRepoModuleImporter from pipeline.contrib.external_plugins.models.base import ( GIT, diff --git a/pipeline/contrib/external_plugins/tests/mock.py b/pipeline/contrib/external_plugins/tests/mock.py index 126429889f..d0f68d870f 100644 --- a/pipeline/contrib/external_plugins/tests/mock.py +++ b/pipeline/contrib/external_plugins/tests/mock.py @@ -20,6 +20,12 @@ class Object(object): pass +class MockResponse(object): + def __init__(self, **kwargs): + self.content = kwargs.get('content') + self.ok = kwargs.get('ok', True) + + class MockPackageSourceManager(object): def __init__(self, **kwargs): self.all = MagicMock(return_value=kwargs.get('all')) diff --git a/pipeline/contrib/external_plugins/tests/mock_settings.py b/pipeline/contrib/external_plugins/tests/mock_settings.py index 8e6cf45650..8aa5aff14c 100644 --- a/pipeline/contrib/external_plugins/tests/mock_settings.py +++ b/pipeline/contrib/external_plugins/tests/mock_settings.py @@ -11,6 +11,12 @@ specific language governing permissions and limitations under the License. """ +SYS_MODULES = 'sys.modules' +SYS_META_PATH = 'sys.meta_path' +IMP_ACQUIRE_LOCK = 'imp.acquire_lock' +IMP_RELEASE_LOCK = 'imp.release_lock' +REQUESTS_GET = 'requests.get' + IMPORTLIB_IMPORT_MODULE = 'importlib.import_module' MODELS_BASE_SOURCE_CLS_FACTORY = 'pipeline.contrib.external_plugins.models.base.source_cls_factory' @@ -19,3 +25,14 @@ LOADER_SOURCE_CLS_FACTORY = 'pipeline.contrib.external_plugins.loader.source_cls_factory' LOADER__IMPORT_MODULES_IN_SOURCE = 'pipeline.contrib.external_plugins.loader._import_modules_in_source' + +UTILS_IMPORTER_BASE_EXECUTE_SRC_CODE = \ + 'pipeline.contrib.external_plugins.utils.importer.base.NonstandardModuleImporter._execute_src_code' +UTILS_IMPORTER_GIT__FETCH_REPO_FILE = \ + 'pipeline.contrib.external_plugins.utils.importer.git.GitRepoModuleImporter._fetch_repo_file' +UTILS_IMPORTER_GIT__FILE_URL = 'pipeline.contrib.external_plugins.utils.importer.git.GitRepoModuleImporter._file_url' +UTILS_IMPORTER_GIT_GET_SOURCE = 'pipeline.contrib.external_plugins.utils.importer.git.GitRepoModuleImporter.get_source' +UTILS_IMPORTER_GIT_GET_FILE = 'pipeline.contrib.external_plugins.utils.importer.git.GitRepoModuleImporter.get_file' +UTILS_IMPORTER_GIT_IS_PACKAGE = 'pipeline.contrib.external_plugins.utils.importer.git.GitRepoModuleImporter.is_package' +UTILS_IMPORTER__SETUP_IMPORTER = 'pipeline.contrib.external_plugins.utils.importer.utils._setup_importer' +UTILS_IMPORTER__REMOVE_IMPORTER = 'pipeline.contrib.external_plugins.utils.importer.utils._remove_importer' diff --git a/pipeline/tests/utils/importer/__init__.py b/pipeline/contrib/external_plugins/tests/utils/__init__.py similarity index 100% rename from pipeline/tests/utils/importer/__init__.py rename to pipeline/contrib/external_plugins/tests/utils/__init__.py diff --git a/pipeline/utils/importer/__init__.py b/pipeline/contrib/external_plugins/tests/utils/importer/__init__.py similarity index 84% rename from pipeline/utils/importer/__init__.py rename to pipeline/contrib/external_plugins/tests/utils/importer/__init__.py index c4afa9b00e..90524bb0e7 100644 --- a/pipeline/utils/importer/__init__.py +++ b/pipeline/contrib/external_plugins/tests/utils/importer/__init__.py @@ -10,6 +10,3 @@ 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 pipeline.utils.importer.utils import importer_context # noqa -from pipeline.utils.importer.git import GitRepoModuleImporter # noqa diff --git a/pipeline/tests/utils/importer/test_base.py b/pipeline/contrib/external_plugins/tests/utils/importer/test_base.py similarity index 97% rename from pipeline/tests/utils/importer/test_base.py rename to pipeline/contrib/external_plugins/tests/utils/importer/test_base.py index af170a6289..94f7e20b42 100644 --- a/pipeline/tests/utils/importer/test_base.py +++ b/pipeline/contrib/external_plugins/tests/utils/importer/test_base.py @@ -16,9 +16,9 @@ from django.test import TestCase -from pipeline.tests.mock import * # noqa -from pipeline.tests.mock_settings import * # noqa -from pipeline.utils.importer.base import NonstandardModuleImporter +from pipeline.contrib.external_plugins.tests.mock import * # noqa +from pipeline.contrib.external_plugins.tests.mock_settings import * # noqa +from pipeline.contrib.external_plugins.utils.importer.base import NonstandardModuleImporter class DummyImporter(NonstandardModuleImporter): diff --git a/pipeline/tests/utils/importer/test_git.py b/pipeline/contrib/external_plugins/tests/utils/importer/test_git.py similarity index 97% rename from pipeline/tests/utils/importer/test_git.py rename to pipeline/contrib/external_plugins/tests/utils/importer/test_git.py index 95308eb380..bf7dcba7bb 100644 --- a/pipeline/tests/utils/importer/test_git.py +++ b/pipeline/contrib/external_plugins/tests/utils/importer/test_git.py @@ -13,9 +13,9 @@ from django.test import TestCase -from pipeline.tests.mock import * # noqa -from pipeline.tests.mock_settings import * # noqa -from pipeline.utils.importer.git import GitRepoModuleImporter +from pipeline.contrib.external_plugins.tests.mock import * # noqa +from pipeline.contrib.external_plugins.tests.mock_settings import * # noqa +from pipeline.contrib.external_plugins.utils.importer.git import GitRepoModuleImporter GET_FILE_RETURN = 'GET_FILE_RETURN' GET_SOURCE_RETURN = 'a=1' diff --git a/pipeline/tests/utils/importer/test_utils.py b/pipeline/contrib/external_plugins/tests/utils/importer/test_utils.py similarity index 90% rename from pipeline/tests/utils/importer/test_utils.py rename to pipeline/contrib/external_plugins/tests/utils/importer/test_utils.py index 0d4473d7e0..a921dc1f08 100644 --- a/pipeline/tests/utils/importer/test_utils.py +++ b/pipeline/contrib/external_plugins/tests/utils/importer/test_utils.py @@ -15,11 +15,11 @@ from django.test import TestCase -from pipeline.utils.importer import utils -from pipeline.utils.importer import GitRepoModuleImporter +from pipeline.contrib.external_plugins.utils.importer import utils +from pipeline.contrib.external_plugins.utils.importer import GitRepoModuleImporter -from pipeline.tests.mock import * # noqa -from pipeline.tests.mock_settings import * # noqa +from pipeline.contrib.external_plugins.tests.mock import * # noqa +from pipeline.contrib.external_plugins.tests.mock_settings import * # noqa class UtilsTestCase(TestCase): diff --git a/pipeline/contrib/external_plugins/utils/__init__.py b/pipeline/contrib/external_plugins/utils/__init__.py new file mode 100644 index 0000000000..90524bb0e7 --- /dev/null +++ b/pipeline/contrib/external_plugins/utils/__init__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +""" +Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community +Edition) available. +Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +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. +""" diff --git a/pipeline/contrib/external_plugins/utils/importer/__init__.py b/pipeline/contrib/external_plugins/utils/importer/__init__.py new file mode 100644 index 0000000000..6bebac0b21 --- /dev/null +++ b/pipeline/contrib/external_plugins/utils/importer/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +""" +Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community +Edition) available. +Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +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 pipeline.contrib.external_plugins.utils.importer.utils import importer_context # noqa +from pipeline.contrib.external_plugins.utils.importer.git import GitRepoModuleImporter # noqa diff --git a/pipeline/utils/importer/base.py b/pipeline/contrib/external_plugins/utils/importer/base.py similarity index 100% rename from pipeline/utils/importer/base.py rename to pipeline/contrib/external_plugins/utils/importer/base.py diff --git a/pipeline/utils/importer/git.py b/pipeline/contrib/external_plugins/utils/importer/git.py similarity index 97% rename from pipeline/utils/importer/git.py rename to pipeline/contrib/external_plugins/utils/importer/git.py index a144abc938..81305aee18 100644 --- a/pipeline/utils/importer/git.py +++ b/pipeline/contrib/external_plugins/utils/importer/git.py @@ -16,7 +16,7 @@ import urlparse import requests -from pipeline.utils.importer.base import NonstandardModuleImporter +from pipeline.contrib.external_plugins.utils.importer.base import NonstandardModuleImporter logger = logging.getLogger('root') diff --git a/pipeline/utils/importer/utils.py b/pipeline/contrib/external_plugins/utils/importer/utils.py similarity index 100% rename from pipeline/utils/importer/utils.py rename to pipeline/contrib/external_plugins/utils/importer/utils.py diff --git a/pipeline/tests/mock.py b/pipeline/tests/mock.py index 9c59d885bd..55489eebda 100644 --- a/pipeline/tests/mock.py +++ b/pipeline/tests/mock.py @@ -31,12 +31,6 @@ class Object(object): pass -class MockResponse(object): - def __init__(self, **kwargs): - self.content = kwargs.get('content') - self.ok = kwargs.get('ok', True) - - class ContextObject(object): def __init__(self, variables): self.variables = variables diff --git a/pipeline/tests/mock_settings.py b/pipeline/tests/mock_settings.py index 4aa97d534e..b18d85509f 100644 --- a/pipeline/tests/mock_settings.py +++ b/pipeline/tests/mock_settings.py @@ -11,12 +11,6 @@ specific language governing permissions and limitations under the License. """ -SYS_MODULES = 'sys.modules' -SYS_META_PATH = 'sys.meta_path' -IMP_ACQUIRE_LOCK = 'imp.acquire_lock' -IMP_RELEASE_LOCK = 'imp.release_lock' -REQUESTS_GET = 'requests.get' - PIPELINE_CORE_GATEWAY_DEFORMAT = 'pipeline.core.flow.gateway.deformat_constant_key' PIPELINE_CORE_CONSTANT_RESOLVE = 'pipeline.core.data.expression.ConstantTemplate.resolve_data' @@ -121,12 +115,3 @@ EXG_HYDRATE_DATA = 'pipeline.engine.core.handlers.exclusive_gateway.hydrate_data' CPG_HYDRATE_DATA = 'pipeline.engine.core.handlers.conditional_parallel.hydrate_data' - -UTILS_IMPORTER_BASE_EXECUTE_SRC_CODE = 'pipeline.utils.importer.base.NonstandardModuleImporter._execute_src_code' -UTILS_IMPORTER_GIT__FETCH_REPO_FILE = 'pipeline.utils.importer.git.GitRepoModuleImporter._fetch_repo_file' -UTILS_IMPORTER_GIT__FILE_URL = 'pipeline.utils.importer.git.GitRepoModuleImporter._file_url' -UTILS_IMPORTER_GIT_GET_SOURCE = 'pipeline.utils.importer.git.GitRepoModuleImporter.get_source' -UTILS_IMPORTER_GIT_GET_FILE = 'pipeline.utils.importer.git.GitRepoModuleImporter.get_file' -UTILS_IMPORTER_GIT_IS_PACKAGE = 'pipeline.utils.importer.git.GitRepoModuleImporter.is_package' -UTILS_IMPORTER__SETUP_IMPORTER = 'pipeline.utils.importer.utils._setup_importer' -UTILS_IMPORTER__REMOVE_IMPORTER = 'pipeline.utils.importer.utils._remove_importer' From 7fc65894d25d48472ba1a4cd9f934591424e0720 Mon Sep 17 00:00:00 2001 From: homholueng Date: Thu, 11 Apr 2019 23:10:06 +0800 Subject: [PATCH 35/87] minor: flake8 fix --- pipeline/conf/default_settings.py | 2 -- pipeline/contrib/external_plugins/apps.py | 4 +--- pipeline/contrib/external_plugins/models/base.py | 6 ++---- .../tests/models/base/test_external_package_source.py | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pipeline/conf/default_settings.py b/pipeline/conf/default_settings.py index 976135788a..f58bfeace2 100644 --- a/pipeline/conf/default_settings.py +++ b/pipeline/conf/default_settings.py @@ -51,5 +51,3 @@ PIPELINE_PARSER_CLASS = getattr(settings, 'PIPELINE_PARSER_CLASS', 'pipeline.parser.pipeline_parser.PipelineParser') ENABLE_EXAMPLE_COMPONENTS = getattr(settings, 'ENABLE_EXAMPLE_COMPONENTS', False) - -COMPONENTS_PACKAGE_SOURCES = getattr(settings, 'COMPONENTS_PACKAGE_SOURCES', {}) diff --git a/pipeline/contrib/external_plugins/apps.py b/pipeline/contrib/external_plugins/apps.py index 5e662c29eb..d9971413aa 100644 --- a/pipeline/contrib/external_plugins/apps.py +++ b/pipeline/contrib/external_plugins/apps.py @@ -19,8 +19,6 @@ from django.conf import settings from django.db.utils import ProgrammingError -from pipeline.conf import settings - logger = logging.getLogger('root') @@ -40,7 +38,7 @@ def ready(self): ExternalPackageSource.update_package_source_from_config(getattr(settings, 'COMPONENTS_PACKAGE_SOURCES', {})) - except ProgrammingError as e: + except ProgrammingError: logger.warning('update package source failed, maybe first migration? exception: %s' % traceback.format_exc()) # first migrate diff --git a/pipeline/contrib/external_plugins/models/base.py b/pipeline/contrib/external_plugins/models/base.py index 002c58b3d4..4666a0351f 100644 --- a/pipeline/contrib/external_plugins/models/base.py +++ b/pipeline/contrib/external_plugins/models/base.py @@ -30,9 +30,7 @@ FILE_SYSTEM }) -source_cls_factory = { - -} +source_cls_factory = {} def package_source(cls): @@ -102,7 +100,7 @@ def importer(self): def modules(self): modules = [] - for _, package_info in self.packages.items(): + for package_info in self.packages.values(): modules.extend(package_info['modules']) return modules diff --git a/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py b/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py index 3392dd72b8..4594deb3f7 100644 --- a/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py +++ b/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py @@ -174,7 +174,7 @@ def test_modules(self): source = GitRepoSource.objects.get(name=SOURCE_NAME) modules = [] - for _, package_info in PACKAGES.items(): + for package_info in PACKAGES.values(): modules.extend(package_info['modules']) self.assertEqual(source.modules, modules) From 6840f049ccdb5f0c430897be9c24976e761c6122 Mon Sep 17 00:00:00 2001 From: homholueng Date: Thu, 11 Apr 2019 23:26:53 +0800 Subject: [PATCH 36/87] minor: code review fix --- pipeline/contrib/external_plugins/models/base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pipeline/contrib/external_plugins/models/base.py b/pipeline/contrib/external_plugins/models/base.py index 4666a0351f..f65bd2f7bc 100644 --- a/pipeline/contrib/external_plugins/models/base.py +++ b/pipeline/contrib/external_plugins/models/base.py @@ -42,9 +42,7 @@ class SourceManager(models.Manager): def create_source(self, name, packages, from_config, **kwargs): create_kwargs = deepcopy(kwargs) - create_kwargs['name'] = name - create_kwargs['packages'] = packages - create_kwargs['from_config'] = from_config + create_kwargs.update({'name': name, 'packages': packages, 'from_config': from_config}) return self.create(**create_kwargs) def remove_source(self, source_id): From b8d0f8fc6f43c3fc0222691c09c3a6d7117559b3 Mon Sep 17 00:00:00 2001 From: homholueng Date: Fri, 12 Apr 2019 17:07:52 +0800 Subject: [PATCH 37/87] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=8C=85=E6=BA=90=E9=85=8D=E7=BD=AE=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=B8=AD=E7=9A=84=E9=85=8D=E7=BD=AE=E6=9C=AA=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline/contrib/external_plugins/models/base.py | 2 +- .../tests/models/base/test_external_package_source.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline/contrib/external_plugins/models/base.py b/pipeline/contrib/external_plugins/models/base.py index f65bd2f7bc..d4f140a7db 100644 --- a/pipeline/contrib/external_plugins/models/base.py +++ b/pipeline/contrib/external_plugins/models/base.py @@ -105,7 +105,7 @@ def modules(self): @staticmethod def update_package_source_from_config(source_configs): - classified_config = {} + classified_config = {source_type: [] for source_type in source_cls_factory.keys()} for config in source_configs: classified_config.setdefault(config.pop('type'), []).append(config) diff --git a/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py b/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py index 4594deb3f7..947f5768d4 100644 --- a/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py +++ b/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py @@ -183,7 +183,7 @@ def test_modules(self): def test_update_package_source_from_config__empty_configs(self): ExternalPackageSource.update_package_source_from_config([]) for source_model_cls in source_cls_factory.values(): - source_model_cls.objects.update_source_from_config.assert_not_called() + source_model_cls.objects.update_source_from_config.assert_called_with(configs=[]) @patch(MODELS_SOURCE_MANAGER_UPDATE_SOURCE_FROM_CONFIG, MagicMock()) def test_update_package_source_from_config__normal_case(self): From 710b016d0b8308dd131dcea703097b55d72124b3 Mon Sep 17 00:00:00 2001 From: homholueng Date: Fri, 12 Apr 2019 17:13:30 +0800 Subject: [PATCH 38/87] =?UTF-8?q?improvement:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=81=87=E5=88=B0=E4=B8=8D=E6=94=AF=E6=8C=81=E7=9A=84=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E6=97=B6=E6=8A=9B?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline/contrib/external_plugins/models/base.py | 5 ++++- .../tests/models/base/test_external_package_source.py | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pipeline/contrib/external_plugins/models/base.py b/pipeline/contrib/external_plugins/models/base.py index d4f140a7db..6243446a9c 100644 --- a/pipeline/contrib/external_plugins/models/base.py +++ b/pipeline/contrib/external_plugins/models/base.py @@ -111,5 +111,8 @@ def update_package_source_from_config(source_configs): classified_config.setdefault(config.pop('type'), []).append(config) for source_type, configs in classified_config.items(): - source_model_cls = source_cls_factory[source_type] + try: + source_model_cls = source_cls_factory[source_type] + except KeyError: + raise KeyError('Unsupported external source type: %s' % source_type) source_model_cls.objects.update_source_from_config(configs=configs) diff --git a/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py b/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py index 947f5768d4..744556da0a 100644 --- a/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py +++ b/pipeline/contrib/external_plugins/tests/models/base/test_external_package_source.py @@ -211,3 +211,12 @@ def test_update_package_source_from_config__normal_case(self): call(configs=[{'name': '1'}, {'name': '2'}]), call(configs=[{'name': '4'}]) ]) + + def test_update_package_source_from_config__unsupported_source_type(self): + source_configs = [ + { + 'name': '1', + 'type': 'wrong_type' + } + ] + self.assertRaises(KeyError, ExternalPackageSource.update_package_source_from_config, source_configs) From 2241f52c59d090a4c5a7ca15c47f1e2a48cf62f7 Mon Sep 17 00:00:00 2001 From: Luo Fan <44999219+fannluo@users.noreply.github.com> Date: Fri, 12 Apr 2019 17:53:30 +0800 Subject: [PATCH 39/87] =?UTF-8?q?improvement=EF=BC=9A=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE=E9=A1=B9=E6=9C=AA=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=AE=8C=E6=88=90=E4=B8=8D=E5=85=81=E8=AE=B8=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TemplateSetting/TabGlobalVariables.vue | 36 ++++++++++++------- .../TemplateSetting/VariableEdit.vue | 8 +++-- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue index 28f673f1bb..fcbfaf9600 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue @@ -39,16 +39,16 @@ {{ i18n.outputs }} -