Skip to content

Commit 8f99204

Browse files
authored
bump to 1.8.0 (#41)
* feat: bump to 1.8.0 * fix: table schema * fix: table schema
1 parent d2d3d93 commit 8f99204

File tree

1,637 files changed

+83805
-15758
lines changed

Some content is hidden

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

1,637 files changed

+83805
-15758
lines changed

.devcontainer/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
# Development with devcontainer
2+
23
This project includes a devcontainer configuration that allows you to open the project in a container with a fully configured development environment.
34
Both frontend and backend environments are initialized when the container is started.
5+
46
## GitHub Codespaces
7+
58
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/langgenius/dify)
69

710
you can simply click the button above to open this project in GitHub Codespaces.
811

912
For more info, check out the [GitHub documentation](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace#creating-a-codespace).
1013

11-
1214
## VS Code Dev Containers
15+
1316
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/langgenius/dify)
1417

1518
if you have VS Code installed, you can click the button above to open this project in VS Code Dev Containers.
1619

1720
You can learn more in the [Dev Containers documentation](https://code.visualstudio.com/docs/devcontainers/containers).
1821

19-
2022
## Pros of Devcontainer
23+
2124
Unified Development Environment: By using devcontainers, you can ensure that all developers are developing in the same environment, reducing the occurrence of "it works on my machine" type of issues.
2225

2326
Quick Start: New developers can set up their development environment in a few simple steps, without spending a lot of time on environment configuration.
2427

2528
Isolation: Devcontainers isolate your project from your host operating system, reducing the chance of OS updates or other application installations impacting the development environment.
2629

2730
## Cons of Devcontainer
31+
2832
Learning Curve: For developers unfamiliar with Docker and VS Code, using devcontainers may be somewhat complex.
2933

3034
Performance Impact: While usually minimal, programs running inside a devcontainer may be slightly slower than those running directly on the host.
3135

3236
## Troubleshooting
37+
3338
if you see such error message when you open this project in codespaces:
3439
![Alt text](troubleshooting.png)
3540

.devcontainer/post_create_command.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
npm add -g pnpm@10.13.1
3+
npm add -g pnpm@10.15.0
44
cd web && pnpm install
55
pipx install uv
66

77
echo 'alias start-api="cd /workspaces/dify/api && uv run python -m flask run --host 0.0.0.0 --port=5001 --debug"' >> ~/.bashrc
8-
echo 'alias start-worker="cd /workspaces/dify/api && uv run python -m celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail,ops_trace,app_deletion"' >> ~/.bashrc
8+
echo 'alias start-worker="cd /workspaces/dify/api && uv run python -m celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail,ops_trace,app_deletion,plugin,workflow_storage"' >> ~/.bashrc
99
echo 'alias start-web="cd /workspaces/dify/web && pnpm dev"' >> ~/.bashrc
1010
echo 'alias start-web-prod="cd /workspaces/dify/web && pnpm build && pnpm start"' >> ~/.bashrc
1111
echo 'alias start-containers="cd /workspaces/dify/docker && docker-compose -f docker-compose.middleware.yaml -p dify --env-file middleware.env up -d"' >> ~/.bashrc

.github/CODE_OF_CONDUCT.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,25 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Language Policy
4040

4141
To facilitate clear and effective communication, all discussions, comments, documentation, and pull requests in this project should be conducted in English. This ensures that all contributors can participate and collaborate effectively.
42-
43-
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "✨ Refactor"
2+
description: Refactor existing code for improved readability and maintainability.
3+
title: "[Chore/Refactor] "
4+
labels:
5+
- refactor
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Self Checks
10+
description: "To make sure we get to you in time, please check the following :)"
11+
options:
12+
- label: I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
13+
required: true
14+
- label: This is only for refactoring, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
15+
required: true
16+
- label: I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
17+
required: true
18+
- label: I confirm that I am using English to submit this report, otherwise it will be closed.
19+
required: true
20+
- label: 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
21+
required: true
22+
- label: "Please do not modify this template :) and fill in all the required fields."
23+
required: true
24+
- type: textarea
25+
id: description
26+
attributes:
27+
label: Description
28+
placeholder: "Describe the refactor you are proposing."
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: motivation
33+
attributes:
34+
label: Motivation
35+
placeholder: "Explain why this refactor is necessary."
36+
validations:
37+
required: false
38+
- type: textarea
39+
id: additional-context
40+
attributes:
41+
label: Additional Context
42+
placeholder: "Add any other context or screenshots about the request here."
43+
validations:
44+
required: false

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

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
> [!IMPORTANT]
22
>
33
> 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md)
4-
> 2. Ensure there is an associated issue and you have been assigned to it
5-
> 3. Use the correct syntax to link this PR: `Fixes #<issue number>`.
4+
> 1. Ensure there is an associated issue and you have been assigned to it
5+
> 1. Use the correct syntax to link this PR: `Fixes #<issue number>`.
66
77
## Summary
88

@@ -12,7 +12,7 @@
1212

1313
| Before | After |
1414
|--------|-------|
15-
| ... | ... |
15+
| ... | ... |
1616

1717
## Checklist
1818

.github/workflows/api-tests.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ jobs:
3333
persist-credentials: false
3434

3535
- name: Setup UV and Python
36-
uses: ./.github/actions/setup-uv
36+
uses: astral-sh/setup-uv@v6
3737
with:
38+
enable-cache: true
3839
python-version: ${{ matrix.python-version }}
39-
uv-lockfile: api/uv.lock
40+
cache-dependency-glob: api/uv.lock
4041

4142
- name: Check UV lockfile
4243
run: uv lock --project api --check
@@ -47,7 +48,16 @@ jobs:
4748
- name: Run Unit tests
4849
run: |
4950
uv run --project api bash dev/pytest/pytest_unit_tests.sh
50-
51+
- name: Run ty check
52+
run: |
53+
cd api
54+
uv add --dev ty
55+
uv run ty check || true
56+
- name: Run pyrefly check
57+
run: |
58+
cd api
59+
uv add --dev pyrefly
60+
uv run pyrefly check || true
5161
- name: Coverage Summary
5262
run: |
5363
set -x
@@ -99,3 +109,6 @@ jobs:
99109

100110
- name: Run Tool
101111
run: uv run --project api bash dev/pytest/pytest_tools.sh
112+
113+
- name: Run TestContainers
114+
run: uv run --project api bash dev/pytest/pytest_testcontainers.sh

.github/workflows/autofix.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: autofix.ci
2+
on:
3+
workflow_call:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "main" ]
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
autofix:
13+
if: github.repository == 'langgenius/dify'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
# Use uv to ensure we have the same ruff version in CI and locally.
19+
- uses: astral-sh/setup-uv@v6
20+
with:
21+
python-version: "3.12"
22+
- run: |
23+
cd api
24+
uv sync --dev
25+
# Fix lint errors
26+
uv run ruff check --fix-only .
27+
# Format code
28+
uv run ruff format .
29+
- name: ast-grep
30+
run: |
31+
uvx --from ast-grep-cli sg --pattern 'db.session.query($WHATEVER).filter($HERE)' --rewrite 'db.session.query($WHATEVER).where($HERE)' -l py --update-all
32+
- name: mdformat
33+
run: |
34+
uvx mdformat .
35+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

.github/workflows/build-push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- "deploy/dev"
88
- "deploy/enterprise"
99
- "build/**"
10+
- "release/e-*"
1011
tags:
1112
- "*"
1213

.github/workflows/db-migration-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525
persist-credentials: false
2626

2727
- name: Setup UV and Python
28-
uses: ./.github/actions/setup-uv
28+
uses: astral-sh/setup-uv@v6
2929
with:
30-
uv-lockfile: api/uv.lock
30+
enable-cache: true
31+
python-version: "3.12"
32+
cache-dependency-glob: api/uv.lock
3133

3234
- name: Install dependencies
3335
run: uv sync --project api

0 commit comments

Comments
 (0)