Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ignore =
;This behaviour may raise E203 whitespace before ':' warnings in style guide enforcement tools like Flake8.
;Since E203 is not PEP 8 compliant, you should tell Flake8 to ignore these warnings.
E203,
C901
C901,
F405

max-line-length = 120
max-complexity = 25
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/engine_flake8_and_black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
jobs:
flake8_and_black:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
python-version: [3.6, 3.7]
python-version: [3.12.10]

steps:
- uses: actions/checkout@v2
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black
pip install flake8==6.1.0 black
- name: Lint with flake8
run: |
flake8 bamboo_engine/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/engine_python_package_poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.13
uses: JRubics/poetry-publish@v2.0
with:
python_version: "3.7"
poetry_version: "==1.2.1"
python_version: "3.12"
poetry_version: "==2.0.0"
ignore_dev_requirements: "yes"
repository_name: "bamboo-engine"
pypi_token: ${{ secrets.ENGINE_PYPI_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/engine_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
python-version: [3.6, 3.7]
python-version: [3.12.10]

steps:
- uses: actions/checkout@v2
Expand All @@ -24,8 +24,8 @@ jobs:
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
python -m pip install poetry==1.1.15
python -m pip install urllib3==1.26.9
python -m pip install poetry==2.0.0
python -m pip install urllib3==2.3.0

- name: Run tox targets for ${{ matrix.python-version }}
run: python -m tox
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pipeline_end_to_end_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
DB_DATABASE: pipeline_test
DB_USER: root
DB_PASSWORD: root
strategy:
matrix:
python-version: [3.6, 3.7]
django-version: [2.2, 3.0]
python-version: [3.12.10]
django-version: [4.2]

steps:

Expand Down Expand Up @@ -42,11 +42,11 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.9
poetry-version: 2.0.0

- name: Install urllib3
run: |
python -m pip install urllib3==1.26.9
python -m pip install urllib3==2.3.0

- name: Install dependency
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ name: PR check

on:
pull_request:
branches: [master, develop]
branches: [master, develop, python_upgrade_master]

jobs:
engine-lint:
uses: TencentBlueKing/bamboo-engine/.github/workflows/engine_flake8_and_black.yml@master
uses: TencentBlueKing/bamboo-engine/.github/workflows/engine_flake8_and_black.yml@python_upgrade_master

pipeline-lint:
uses: TencentBlueKing/bamboo-engine/.github/workflows/runtime_pipeline_flake8_and_black.yml@master
uses: TencentBlueKing/bamboo-engine/.github/workflows/runtime_pipeline_flake8_and_black.yml@python_upgrade_master

engine-unittest:
needs: engine-lint
uses: TencentBlueKing/bamboo-engine/.github/workflows/engine_unittest.yml@master
uses: TencentBlueKing/bamboo-engine/.github/workflows/engine_unittest.yml@python_upgrade_master

pipeline-unittest:
needs: pipeline-lint
uses: TencentBlueKing/bamboo-engine/.github/workflows/runtime_pipeline_unittest.yml@master
uses: TencentBlueKing/bamboo-engine/.github/workflows/runtime_pipeline_unittest.yml@python_upgrade_master

runtime-pipeline-intergration-test:
needs: [engine-unittest, pipeline-unittest]
uses: TencentBlueKing/bamboo-engine/.github/workflows/runtime_pipeline_end_to_end_test.yml@master
uses: TencentBlueKing/bamboo-engine/.github/workflows/runtime_pipeline_end_to_end_test.yml@python_upgrade_master

pipeline-intergration-test:
needs: pipeline-unittest
uses: TencentBlueKing/bamboo-engine/.github/workflows/pipeline_end_to_end_test.yml@master
uses: TencentBlueKing/bamboo-engine/.github/workflows/pipeline_end_to_end_test.yml@python_upgrade_master
10 changes: 5 additions & 5 deletions .github/workflows/runtime_pipeline_end_to_end_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
DB_DATABASE: pipeline_test
DB_USER: root
DB_PASSWORD: root
strategy:
matrix:
python-version: [3.6, 3.7]
django-version: [2.2, 3.0]
python-version: [3.12.10]
django-version: [4.2]

steps:

Expand Down Expand Up @@ -42,11 +42,11 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.9
poetry-version: 2.0.0

- name: Install urllib3
run: |
python -m pip install urllib3==1.26.9
python -m pip install urllib3==2.3.0

- name: Install dependency
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/runtime_pipeline_flake8_and_black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
jobs:
flake8_and_black:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
python-version: [3.6, 3.7]
python-version: [3.12.10]

steps:
- uses: actions/checkout@v2
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black
pip install flake8==6.1.0 black
- name: Lint with flake8
run: |
cd runtime/bamboo-pipeline
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/runtime_pipeline_python_package_poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.12.10

- name: Set up Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.2.1
poetry-version: 2.0.0

- name: Remove Test Code
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/runtime_pipeline_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
DB_DATABASE: pipeline_test
DB_USER: root
DB_PASSWORD: root
strategy:
matrix:
python-version: [3.6, 3.7]
django-version: [2.2, 3.0]
python-version: [3.12.10]
django-version: [4.2]

steps:

Expand All @@ -32,11 +32,11 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.9
poetry-version: 2.0.0

- name: Install urllib3
run: |
python -m pip install urllib3==1.26.9
python -m pip install urllib3==2.3.0

- name: Install Dependencies
run: |
Expand Down
39 changes: 31 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
default_stages: [ commit ]
default_stages: [ pre-commit ]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black
language_version: python3
language_version: python3.12.10
args: [
"--line-length=120"
]
- repo: https://github.com/pycqa/isort
rev: 5.6.4
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
name: isort-engine
files: ^(bamboo_engine/|tests/)
args: [
"--profile=black",
"--line-length=120",
"--project=bamboo_engine",
"--filter-files"
]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort-pipeline
files: runtime/
args: [
"--profile=black",
"--line-length=120",
"--project=pipeline",
"--thirdparty=bamboo_engine",
"--filter-files"
]
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.1.0
hooks:
- id: flake8
language_version: python3
language_version: python3.12.10
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v2.2.0
hooks:
- id: commitlint
stages: [ commit-msg ]
additional_dependencies: [ '@commitlint/config-conventional' ]
additional_dependencies: [ '@commitlint/config-conventional' ]
12 changes: 3 additions & 9 deletions bamboo_engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@
)
from .exceptions import InvalidOperationError, NotFoundError
from .handler import HandlerFactory
from .interrupt import (
ExecuteInterrupter,
ExecuteKeyPoint,
InterruptException,
ScheduleInterrupter,
ScheduleKeyPoint,
)
from .interrupt import ExecuteInterrupter, ExecuteKeyPoint, InterruptException, ScheduleInterrupter, ScheduleKeyPoint
from .local import CurrentNodeInfo, clear_node_info, set_node_info
from .metrics import (
ENGINE_EXECUTE_POST_PROCESS_DURATION,
Expand Down Expand Up @@ -95,7 +89,7 @@ def run_pipeline(
root_pipeline_data: Optional[dict] = None,
root_pipeline_context: Optional[dict] = None,
subprocess_context: Optional[dict] = None,
**options
**options,
):
"""
运行流程
Expand Down Expand Up @@ -671,7 +665,7 @@ def hook_dispatch(
service: Optional[Service] = None,
callback_data: Optional[CallbackData] = None,
*args,
**kwargs
**kwargs,
):
"""
Hook 分发
Expand Down
4 changes: 2 additions & 2 deletions bamboo_engine/eri/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __init__(
default_condition: DefaultCondition = None,
extra_info: dict = None,
*args,
**kwargs
**kwargs,
):
"""

Expand All @@ -195,7 +195,7 @@ def __init__(
default_condition: DefaultCondition = None,
extra_info: dict = None,
*args,
**kwargs
**kwargs,
):
"""

Expand Down
Loading