Skip to content

Commit 1097bf3

Browse files
committed
Merge branch 'plugins/beta' into dev/plugin-deploy
2 parents 4920821 + beebba0 commit 1097bf3

File tree

368 files changed

+5103
-3438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+5103
-3438
lines changed

.github/actions/setup-poetry/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
poetry-version:
99
description: Poetry version to set up
1010
required: true
11-
default: '1.8.4'
11+
default: '2.0.1'
1212
poetry-lockfile:
1313
description: Path to the Poetry lockfile to restore cache from
1414
required: true

.github/workflows/api-tests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,17 @@ jobs:
4343
run: poetry install -C api --with dev
4444

4545
- name: Check dependencies in pyproject.toml
46-
run: poetry run -C api bash dev/pytest/pytest_artifacts.sh
46+
run: poetry run -P api bash dev/pytest/pytest_artifacts.sh
4747

4848
- name: Run Unit tests
49-
run: poetry run -C api bash dev/pytest/pytest_unit_tests.sh
49+
run: poetry run -P api bash dev/pytest/pytest_unit_tests.sh
5050

5151
- name: Run dify config tests
52-
run: poetry run -C api python dev/pytest/pytest_config_tests.py
52+
run: poetry run -P api python dev/pytest/pytest_config_tests.py
5353

5454
- name: Run mypy
5555
run: |
56-
pushd api
57-
poetry run python -m mypy --install-types --non-interactive .
58-
popd
56+
poetry run -C api python -m mypy --install-types --non-interactive .
5957
6058
- name: Set up dotenvs
6159
run: |
@@ -75,4 +73,4 @@ jobs:
7573
ssrf_proxy
7674
7775
- name: Run Workflow
78-
run: poetry run -C api bash dev/pytest/pytest_workflow.sh
76+
run: poetry run -P api bash dev/pytest/pytest_workflow.sh

.github/workflows/style.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ jobs:
3939
if: steps.changed-files.outputs.any_changed == 'true'
4040
run: |
4141
poetry run -C api ruff --version
42-
poetry run -C api ruff check ./api
43-
poetry run -C api ruff format --check ./api
42+
poetry run -C api ruff check ./
43+
poetry run -C api ruff format --check ./
4444
4545
- name: Dotenv check
4646
if: steps.changed-files.outputs.any_changed == 'true'
47-
run: poetry run -C api dotenv-linter ./api/.env.example ./web/.env.example
47+
run: poetry run -P api dotenv-linter ./api/.env.example ./web/.env.example
4848

4949
- name: Lint hints
5050
if: failure()
@@ -87,7 +87,35 @@ jobs:
8787

8888
- name: Web style check
8989
if: steps.changed-files.outputs.any_changed == 'true'
90-
run: echo "${{ steps.changed-files.outputs.all_changed_files }}" | sed 's|web/||g' | xargs pnpm eslint # wait for next lint support eslint v9
90+
run: yarn run lint
91+
92+
docker-compose-template:
93+
name: Docker Compose Template
94+
runs-on: ubuntu-latest
95+
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
100+
- name: Check changed files
101+
id: changed-files
102+
uses: tj-actions/changed-files@v45
103+
with:
104+
files: |
105+
docker/generate_docker_compose
106+
docker/.env.example
107+
docker/docker-compose-template.yaml
108+
docker/docker-compose.yaml
109+
110+
- name: Generate Docker Compose
111+
if: steps.changed-files.outputs.any_changed == 'true'
112+
run: |
113+
cd docker
114+
./generate_docker_compose
115+
116+
- name: Check for changes
117+
if: steps.changed-files.outputs.any_changed == 'true'
118+
run: git diff --exit-code
91119

92120

93121
docker-compose-template:

.github/workflows/vdb-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ jobs:
7070
tidb
7171
7272
- name: Test Vector Stores
73-
run: poetry run -C api bash dev/pytest/pytest_vdb.sh
73+
run: poetry run -P api bash dev/pytest/pytest_vdb.sh

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,6 @@ api/.vscode
197197

198198
# pnpm
199199
/.pnpm-store
200+
201+
# plugin migrate
202+
plugins.jsonl

api/.env.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,7 @@ POSITION_PROVIDER_INCLUDES=
422422
POSITION_PROVIDER_EXCLUDES=
423423

424424
# Plugin configuration
425-
PLUGIN_API_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
426-
PLUGIN_API_URL=http://127.0.0.1:5002
425+
PLUGIN_DAEMON_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
427426
PLUGIN_DAEMON_URL=http://127.0.0.1:5002
428427
PLUGIN_REMOTE_INSTALL_PORT=5003
429428
PLUGIN_REMOTE_INSTALL_HOST=localhost
@@ -436,7 +435,7 @@ MARKETPLACE_ENABLED=true
436435
MARKETPLACE_API_URL=https://marketplace.dify.ai
437436

438437
# Endpoint configuration
439-
ENDPOINT_URL_TEMPLATE=http://localhost/e/{hook_id}
438+
ENDPOINT_URL_TEMPLATE=http://localhost:5002/e/{hook_id}
440439

441440
# Reset password token expiry minutes
442441
RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5

api/.ruff.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ ignore = [
5353
"FURB152", # math-constant
5454
"UP007", # non-pep604-annotation
5555
"UP032", # f-string
56+
"UP045", # non-pep604-annotation-optional
5657
"B005", # strip-with-multi-characters
5758
"B006", # mutable-argument-default
5859
"B007", # unused-loop-control-variable
5960
"B026", # star-arg-unpacking-after-keyword-arg
61+
"B903", # class-as-data-structure
6062
"B904", # raise-without-from-inside-except
6163
"B905", # zip-without-explicit-strict
6264
"N806", # non-lowercase-variable-in-function

api/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM python:3.12-slim-bookworm AS base
44
WORKDIR /app/api
55

66
# Install Poetry
7-
ENV POETRY_VERSION=1.8.4
7+
ENV POETRY_VERSION=2.0.1
88

99
# if you located in China, you can use aliyun mirror to speed up
1010
# RUN pip install --no-cache-dir poetry==${POETRY_VERSION} -i https://mirrors.aliyun.com/pypi/simple/
@@ -55,6 +55,7 @@ RUN apt-get update \
5555
&& echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list \
5656
&& apt-get update \
5757
# For Security
58+
# && apt-get install -y --no-install-recommends expat=2.6.4-1 libldap-2.5-0=2.5.19+dfsg-1 perl=5.40.0-8 libsqlite3-0=3.46.1-1 zlib1g=1:1.3.dfsg+really1.3.1-1+b1 \
5859
# install a chinese font to support the use of tools like matplotlib
5960
&& apt-get install -y fonts-noto-cjk \
6061
&& apt-get autoremove -y \

api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@
7979
2. Run the tests locally with mocked system environment variables in `tool.pytest_env` section in `pyproject.toml`
8080

8181
```bash
82-
poetry run -C api bash dev/pytest/pytest_all_tests.sh
82+
poetry run -P api bash dev/pytest/pytest_all_tests.sh
8383
```

api/configs/feature/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ class PluginConfig(BaseSettings):
141141

142142
PLUGIN_DAEMON_URL: HttpUrl = Field(
143143
description="Plugin API URL",
144-
default="http://plugin:5002",
144+
default="http://localhost:5002",
145145
)
146146

147-
PLUGIN_API_KEY: str = Field(
147+
PLUGIN_DAEMON_KEY: str = Field(
148148
description="Plugin API key",
149149
default="plugin-api-key",
150150
)
@@ -200,7 +200,7 @@ class EndpointConfig(BaseSettings):
200200
)
201201

202202
CONSOLE_WEB_URL: str = Field(
203-
description="Base URL for the console web interface," "used for frontend references and CORS configuration",
203+
description="Base URL for the console web interface,used for frontend references and CORS configuration",
204204
default="",
205205
)
206206

0 commit comments

Comments
 (0)