-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: local data source import & export
- Loading branch information
Showing
158 changed files
with
8,563 additions
and
1,178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: bkuser_ci_check | ||
on: | ||
push: | ||
branches: [master, ft_tenant, ft_tenant_manage] | ||
branches: [master, ft_tenant] | ||
paths: | ||
- "src/bk-user/**" | ||
pull_request: | ||
branches: [master, ft_tenant, ft_tenant_manage] | ||
branches: [master, ft_tenant] | ||
paths: | ||
- "src/bk-user/**" | ||
jobs: | ||
|
@@ -35,28 +35,38 @@ jobs: | |
fail-fast: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Start MySQL Container | ||
uses: samin/[email protected] | ||
with: | ||
mysql version: "8.0" | ||
mysql database: bk-user | ||
mysql user: root | ||
mysql password: root_pwd | ||
mysql root password: root_pwd | ||
- name: Start Redis Container | ||
uses: supercharge/[email protected] | ||
with: | ||
redis-version: "3.2.0" | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Set up Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: "1.5.1" | ||
- name: Start Redis Container | ||
uses: supercharge/[email protected] | ||
with: | ||
redis-version: "3.2.0" | ||
- name: Install dependencies | ||
working-directory: src/bk-user | ||
run: poetry install | ||
- name: Run unittest | ||
working-directory: src/bk-user | ||
# TODO 使用更合适的方式解决“必须的”配置项问题 | ||
run: | | ||
export BK_APP_SECRET="" | ||
# random secret | ||
export BK_APP_SECRET="fod6MKVTVi_3M5HgGoj-qI7b3l0dgCzTBwGypnDz4vg=" | ||
export BK_USER_URL="" | ||
export BK_COMPONENT_API_URL="" | ||
export MYSQL_PASSWORD=root_pwd | ||
export MYSQL_HOST="127.0.0.1" | ||
export DJANGO_SETTINGS_MODULE=bkuser.settings | ||
poetry run pytest ./tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: ESLint | ||
|
||
on: | ||
push: | ||
branches: [ master, develop, pre_*, ft_* ] | ||
pull_request: | ||
branches: [ master, develop, pre_*, ft_* ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install modules | ||
run: | | ||
cd src/pages | ||
npm i | ||
- name: Run ESLint | ||
run: | | ||
cd src/pages | ||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,3 +215,5 @@ pre_commit_hooks | |
|
||
# local settings | ||
cliff.toml | ||
.codecc | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. | ||
Copyright (C) 2017-2021 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 bkuser.apis.web.mixins import CurrentUserTenantMixin | ||
from bkuser.apps.data_source.models import DataSource | ||
|
||
|
||
class CurrentUserTenantDataSourceMixin(CurrentUserTenantMixin): | ||
"""获取当前用户所在租户下属数据源""" | ||
|
||
lookup_url_kwarg = "id" | ||
|
||
def get_queryset(self): | ||
return DataSource.objects.filter(owner_tenant_id=self.get_current_tenant_id()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.