Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
89 changes: 89 additions & 0 deletions .github/scripts/docker-pr-comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Generate or update PR comment with Docker build info
*/
module.exports = async ({
github,
context,
dockerMetaJson,
image,
version,
dockerhubUrl,
platforms,
}) => {
const COMMENT_IDENTIFIER = '<!-- DOCKER-BUILD-COMMENT -->';

const parseTags = () => {
try {
if (dockerMetaJson) {
const parsed = JSON.parse(dockerMetaJson);
if (Array.isArray(parsed.tags) && parsed.tags.length > 0) {
return parsed.tags;
}
}
} catch (e) {
// ignore parsing error, fallback below
}
if (image && version) {
return [`${image}:${version}`];
}
return [];
};

const generateCommentBody = () => {
const tags = parseTags();
const buildTime = new Date().toISOString();

// Use the first tag as the main version
const mainTag = tags.length > 0 ? tags[0] : `${image}:${version}`;
const tagVersion = mainTag.includes(':') ? mainTag.split(':')[1] : version;

return [
COMMENT_IDENTIFIER,
'',
'### 🐳 Database Docker Build Completed!',
`**Version**: \`${tagVersion || 'N/A'}\``,
`**Build Time**: \`${buildTime}\``,
'',
dockerhubUrl ? `🔗 View all tags on Docker Hub: ${dockerhubUrl}` : '',
'',
'### Pull Image',
'Download the Docker image to your local machine:',
'',
'```bash',
`docker pull ${mainTag}`,
'```',
'> [!IMPORTANT]',
'> This build is for testing and validation purposes.',
]
.filter(Boolean)
.join('\n');
};

const body = generateCommentBody();

// List comments on the PR
const { data: comments } = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});

const existing = comments.find((c) => c.body && c.body.includes(COMMENT_IDENTIFIER));
if (existing) {
await github.rest.issues.updateComment({
comment_id: existing.id,
owner: context.repo.owner,
repo: context.repo.repo,
body,
});
return { updated: true, id: existing.id };
}

const result = await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
});
return { updated: false, id: result.data.id };
};
21 changes: 21 additions & 0 deletions .github/workflows/docker-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,24 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}


- name: Comment on PR with Docker build info
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prComment = require('${{ github.workspace }}/.github/scripts/docker-pr-comment.js');
const result = await prComment({
github,
context,
dockerMetaJson: ${{ toJSON(steps.meta.outputs.json) }},
image: "${{ env.REGISTRY_IMAGE }}",
version: "${{ steps.meta.outputs.version }}",
dockerhubUrl: "https://hub.docker.com/r/${{ env.REGISTRY_IMAGE }}/tags",
platforms: "linux/amd64, linux/arm64",
});
core.info(`Status: ${result.updated ? 'Updated' : 'Created'}, ID: ${result.id}`);


12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

services:
postgres:
image: pgvector/pgvector:pg17
image: paradedb/paradedb:latest
env:
POSTGRES_PASSWORD: postgres
options: >-
Expand All @@ -38,8 +38,10 @@ jobs:
- name: Lint
run: bun run lint

- name: Test Server Coverage
run: bun run test-server:coverage
- uses: pnpm/action-setup@v4

- name: Test Database Coverage
run: pnpm --filter @lobechat/database test
env:
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
DATABASE_DRIVER: node
Expand All @@ -48,8 +50,8 @@ jobs:
S3_PUBLIC_DOMAIN: https://example.com
APP_URL: https://home.com

- name: Test App Coverage
run: bun run test-app:coverage
- name: Test App
run: bun run test-app

- name: Release
run: bun run release
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package: [file-loaders, prompts, model-runtime, web-crawler, electron-server-ipc]
package: [file-loaders, prompts, model-runtime, web-crawler, electron-server-ipc, utils]

name: Test package ${{ matrix.package }}

Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
files: ./coverage/app/lcov.info
flags: app

test-server:
test-databsae:
name: Test Database

runs-on: ubuntu-latest
Expand Down Expand Up @@ -109,8 +109,10 @@ jobs:
- name: Lint
run: bun run lint

- name: Test Server Coverage
run: bun run test-server:coverage
- uses: pnpm/action-setup@v4

- name: Test Coverage
run: pnpm --filter @lobechat/database test:coverage
env:
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
DATABASE_DRIVER: node
Expand All @@ -119,9 +121,9 @@ jobs:
S3_PUBLIC_DOMAIN: https://example.com
APP_URL: https://home.com

- name: Upload Server coverage to Codecov
- name: Upload Database coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/server/lcov.info
flags: server
files: ./packages/database/coverage/lcov.info
flags: database
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@

# Changelog

### [Version 1.114.5](https://github.com/lobehub/lobe-chat/compare/v1.114.4...v1.114.5)

<sup>Released on **2025-08-22**</sup>

#### 💄 Styles

- **misc**: Update mistral model vision ability.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

- **misc**: Update mistral model vision ability, closes [#8885](https://github.com/lobehub/lobe-chat/issues/8885) ([915c0ff](https://github.com/lobehub/lobe-chat/commit/915c0ff))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.114.4](https://github.com/lobehub/lobe-chat/compare/v1.114.3...v1.114.4)

<sup>Released on **2025-08-22**</sup>

#### ♻ Code Refactoring

- **misc**: Move database to packages.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

- **misc**: Move database to packages, closes [#8874](https://github.com/lobehub/lobe-chat/issues/8874) ([af1f715](https://github.com/lobehub/lobe-chat/commit/af1f715))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.114.3](https://github.com/lobehub/lobe-chat/compare/v1.114.2...v1.114.3)

<sup>Released on **2025-08-21**</sup>
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ COPY --from=base /distroless/ /
COPY --from=builder /app/.next/standalone /app/

# Copy database migrations
COPY --from=builder /app/src/database/migrations /app/migrations
COPY --from=builder /app/packages/database/migrations /app/migrations
COPY --from=builder /app/scripts/migrateServerDB/docker.cjs /app/docker.cjs
COPY --from=builder /app/scripts/migrateServerDB/errorHint.js /app/errorHint.js

Expand Down
14 changes: 14 additions & 0 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
[
{
"children": {
"improvements": ["Update mistral model vision ability."]
},
"date": "2025-08-22",
"version": "1.114.5"
},
{
"children": {
"improvements": ["Move database to packages."]
},
"date": "2025-08-22",
"version": "1.114.4"
},
{
"children": {},
"date": "2025-08-21",
Expand Down
32 changes: 30 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
component_management:
individual_components:
# App architecture layers
- component_id: app_store
name: "Store"
paths:
- src/store/**
- component_id: app_services
name: "Services"
paths:
- src/services/**
- component_id: app_server
name: "Server"
paths:
- src/server/**
- component_id: app_libs
name: "Libs"
paths:
- src/libs/**
- component_id: app_utils
name: "Utils"
paths:
- src/utils/**

coverage:
status:
project:
default: off
server:
database:
flags:
- server
- database
app:
flags:
- app
patch: off


comment:
layout: "header, diff, flags, components" # show component info in the PR comment
14 changes: 14 additions & 0 deletions docs/development/database-schema.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ table ai_providers {
}
}

table api_keys {
id integer [pk, not null]
name varchar(256) [not null]
key varchar(256) [not null, unique]
enabled boolean [default: true]
expires_at "timestamp with time zone"
last_used_at "timestamp with time zone"
user_id text [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
}

table async_tasks {
id uuid [pk, not null, default: `gen_random_uuid()`]
type text
Expand Down Expand Up @@ -702,6 +715,7 @@ table rbac_roles {
description text
is_system boolean [not null, default: false]
is_active boolean [not null, default: true]
metadata jsonb [default: `{}`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
Expand Down
4 changes: 2 additions & 2 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default {
url: connectionString,
},
dialect: 'postgresql',
out: './src/database/migrations',
out: './packages/database/migrations',

schema: './src/database/schemas',
schema: './packages/database/src/schemas',
strict: true,
} satisfies Config;
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.114.3",
"version": "1.114.5",
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
Expand Down Expand Up @@ -73,8 +73,6 @@
"test": "npm run test-app && npm run test-server",
"test-app": "vitest run --config vitest.config.ts",
"test-app:coverage": "vitest run --config vitest.config.ts --coverage",
"test-server": "vitest run --config vitest.config.server.ts",
"test-server:coverage": "vitest run --config vitest.config.server.ts --coverage",
"test:update": "vitest -u",
"type-check": "tsgo --noEmit",
"webhook:ngrok": "ngrok http http://localhost:3011",
Expand Down Expand Up @@ -141,11 +139,14 @@
"@icons-pack/react-simple-icons": "9.6.0",
"@khmyznikov/pwa-install": "0.3.9",
"@langchain/community": "^0.3.50",
"@lobechat/const": "workspace:*",
"@lobechat/database": "workspace:*",
"@lobechat/electron-client-ipc": "workspace:*",
"@lobechat/electron-server-ipc": "workspace:*",
"@lobechat/file-loaders": "workspace:*",
"@lobechat/model-runtime": "workspace:*",
"@lobechat/prompts": "workspace:*",
"@lobechat/utils": "workspace:*",
"@lobechat/web-crawler": "workspace:*",
"@lobehub/analytics": "^1.6.0",
"@lobehub/charts": "^2.0.0",
Expand Down Expand Up @@ -361,8 +362,7 @@
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
"vite": "^5.4.19",
"vitest": "^3.2.4",
"vitest-canvas-mock": "^0.3.3"
"vitest": "^3.2.4"
},
"packageManager": "pnpm@10.14.0",
"publishConfig": {
Expand Down
Loading
Loading