Skip to content

Commit 2ffe5d5

Browse files
committed
feat: migrate memu-server with comprehensive quality automation
Major changes: - Complete project migration from original repository - Python 3.13 environment with uv package manager - FastAPI + SQLModel + PostgreSQL 16 + pgvector - Temporal workflow engine integration - Comprehensive pre-commit hooks (20 checks) * Code formatting: ruff format * Linting: ruff, pylint (9.84/10) * Security: bandit * Custom validators: credentials, migrations, makefile, markdown - Test coverage: 41% with automated checks - GitHub Actions CI/CD pipeline - Environment variable validation at startup - All security best practices enforced - Complete English documentation
1 parent 32bf4f4 commit 2ffe5d5

34 files changed

Lines changed: 1879 additions & 279 deletions

.env.example

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# ===================================
2+
# Database Configuration
3+
# ===================================
4+
# For docker-compose
5+
POSTGRES_USER=memu_user
6+
POSTGRES_PASSWORD=memu_pass
7+
POSTGRES_DB=memu_db
8+
9+
# For application
10+
DATABASE_HOST=localhost
11+
DATABASE_PORT=54320
12+
DATABASE_USER=memu_user
13+
DATABASE_PASSWORD=memu_pass
14+
DATABASE_NAME=memu_db
15+
16+
# ===================================
17+
# Temporal Configuration
18+
# ===================================
19+
TEMPORAL_HOST=localhost
20+
TEMPORAL_PORT=17233
21+
TEMPORAL_NAMESPACE=default
22+
23+
# ===================================
24+
# LLM Configuration
25+
# ===================================
26+
OPENAI_API_KEY=your_openai_api_key_here
27+
OPENAI_BASE_URL=https://api.openai.com/v1
28+
DEFAULT_LLM_MODEL=gpt-4o-mini
29+
30+
# ===================================
31+
# Embedding Configuration
32+
# ===================================
33+
EMBEDDING_API_KEY=your_embedding_api_key_here
34+
EMBEDDING_BASE_URL=https://api.voyageai.com/v1
35+
EMBEDDING_MODEL=voyage-3.5-lite
36+
37+
# ===================================
38+
# Storage Configuration
39+
# ===================================
40+
STORAGE_PATH=/var/data/memu-server

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for taking the time to report a bug! Please fill out the form below.
10-
10+
1111
- type: textarea
1212
id: description
1313
attributes:
@@ -16,7 +16,7 @@ body:
1616
placeholder: Describe the bug...
1717
validations:
1818
required: true
19-
19+
2020
- type: textarea
2121
id: reproduction
2222
attributes:
@@ -28,7 +28,7 @@ body:
2828
3. See error
2929
validations:
3030
required: true
31-
31+
3232
- type: textarea
3333
id: expected
3434
attributes:
@@ -37,7 +37,7 @@ body:
3737
placeholder: What should happen?
3838
validations:
3939
required: true
40-
40+
4141
- type: textarea
4242
id: actual
4343
attributes:
@@ -46,7 +46,7 @@ body:
4646
placeholder: What actually happened?
4747
validations:
4848
required: true
49-
49+
5050
- type: textarea
5151
id: environment
5252
attributes:
@@ -58,7 +58,7 @@ body:
5858
- memU-server Version: [e.g. 1.0.0]
5959
validations:
6060
required: false
61-
61+
6262
- type: textarea
6363
id: logs
6464
attributes:
@@ -67,7 +67,7 @@ body:
6767
render: shell
6868
validations:
6969
required: false
70-
70+
7171
- type: textarea
7272
id: additional
7373
attributes:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for suggesting a new feature! Please fill out the form below.
10-
10+
1111
- type: textarea
1212
id: problem
1313
attributes:
@@ -16,7 +16,7 @@ body:
1616
placeholder: I'm always frustrated when...
1717
validations:
1818
required: true
19-
19+
2020
- type: textarea
2121
id: solution
2222
attributes:
@@ -25,7 +25,7 @@ body:
2525
placeholder: I would like to have...
2626
validations:
2727
required: true
28-
28+
2929
- type: textarea
3030
id: alternatives
3131
attributes:
@@ -34,7 +34,7 @@ body:
3434
placeholder: Alternative approaches could be...
3535
validations:
3636
required: false
37-
37+
3838
- type: textarea
3939
id: benefits
4040
attributes:
@@ -43,7 +43,7 @@ body:
4343
placeholder: This feature would help users...
4444
validations:
4545
required: false
46-
46+
4747
- type: textarea
4848
id: additional
4949
attributes:

.github/ISSUE_TEMPLATE/improvement_suggestion.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for suggesting an improvement! Please fill out the form below.
10-
10+
1111
- type: textarea
1212
id: current
1313
attributes:
@@ -16,7 +16,7 @@ body:
1616
placeholder: Currently, the system...
1717
validations:
1818
required: true
19-
19+
2020
- type: textarea
2121
id: suggested
2222
attributes:
@@ -25,7 +25,7 @@ body:
2525
placeholder: It would be better if...
2626
validations:
2727
required: true
28-
28+
2929
- type: textarea
3030
id: rationale
3131
attributes:
@@ -34,7 +34,7 @@ body:
3434
placeholder: This would improve...
3535
validations:
3636
required: true
37-
37+
3838
- type: textarea
3939
id: impact
4040
attributes:
@@ -43,7 +43,7 @@ body:
4343
placeholder: This would affect...
4444
validations:
4545
required: false
46-
46+
4747
- type: textarea
4848
id: implementation
4949
attributes:
@@ -52,7 +52,7 @@ body:
5252
placeholder: This could be implemented by...
5353
validations:
5454
required: false
55-
55+
5656
- type: textarea
5757
id: additional
5858
attributes:

.github/workflows/code-quality.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, develop, 'feature/**' ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
quality-check:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install uv
25+
run: |
26+
curl -LsSf https://astral.sh/uv/install.sh | sh
27+
echo "$HOME/.local/bin" >> $GITHUB_PATH
28+
29+
- name: Install dependencies
30+
run: |
31+
uv venv
32+
uv sync
33+
34+
- name: Check code formatting
35+
run: |
36+
uv run ruff format --check .
37+
38+
- name: Lint code
39+
run: |
40+
uv run ruff check .
41+
42+
- name: Run tests
43+
env:
44+
OPENAI_API_KEY: "test-openai-key"
45+
DATABASE_URL: "sqlite:///:memory:"
46+
run: |
47+
uv run pytest -v --cov=app --cov-report=xml --cov-report=term
48+
49+
- name: Upload coverage reports
50+
if: matrix.python-version == '3.13'
51+
uses: codecov/codecov-action@v4
52+
with:
53+
file: ./coverage.xml
54+
fail_ci_if_error: false
55+
env:
56+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)