Skip to content

Commit 9d0b0c2

Browse files
committed
Merge branch '3.6.x'
2 parents 7e60596 + eb42a8d commit 9d0b0c2

File tree

8 files changed

+179
-9
lines changed

8 files changed

+179
-9
lines changed

.gitignore

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,55 @@ target/
1010
build/
1111

1212
# Claude Code local settings
13-
.claude/settings.local.json
13+
.claude/settings.local.json
14+
15+
# Python
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
*.so
20+
.Python
21+
env/
22+
venv/
23+
.venv/
24+
ENV/
25+
env.bak/
26+
venv.bak/
27+
*.egg
28+
*.egg-info/
29+
dist/
30+
eggs/
31+
.eggs/
32+
lib/
33+
lib64/
34+
parts/
35+
sdist/
36+
var/
37+
wheels/
38+
pip-wheel-metadata/
39+
share/python-wheels/
40+
*.manifest
41+
*.spec
42+
.pytest_cache/
43+
.coverage
44+
.coverage.*
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.hypothesis/
49+
*.log
50+
local_settings.py
51+
db.sqlite3
52+
db.sqlite3-journal
53+
instance/
54+
.webassets-cache
55+
.scrapy
56+
docs/_build/
57+
.pybuilder/
58+
.ipynb_checkpoints
59+
.pytype/
60+
.mypy_cache/
61+
.dmypy.json
62+
dmypy.json
63+
.pyre/
64+
.pyenv

AGENTS.en.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
This repo hosts the FIT framework and related engines.
6+
- `framework/` contains the core implementations (`framework/fit/java`, `framework/fit/python`, `framework/waterflow`, `framework/fel`).
7+
- `docs/` holds user guides, quick starts, and white papers.
8+
- `examples/` contains runnable samples for FIT and FEL.
9+
- `docker/` provides container build assets.
10+
- `build/` is the Maven build output (generated).
11+
12+
## Build, Test, and Development Commands
13+
14+
- `mvn clean install` (repo root): builds all modules and runs tests; outputs to `build/`.
15+
- `cd framework/fit/java && mvn clean install`: builds the Java FIT framework only.
16+
- `./build/bin/fit start`: starts the Java runtime (uses Node.js); default port `8080`.
17+
- `./.claude/run-test.sh`: full CI-like flow (build, start, health checks).
18+
19+
## Coding Style & Naming Conventions
20+
21+
- Java formatting uses the IntelliJ profile `CodeFormatterFromIdea.xml`.
22+
- Public/protected Java APIs require Javadoc with `@param`/`@return` tags.
23+
- Class headers must include `@author` and `@since yyyy-MM-dd`.
24+
- Branch naming follows module prefixes and intent, e.g. `fit-feature-xxx`, `waterflow-bugfix-yyy`.
25+
26+
## Testing Guidelines
27+
28+
- Java tests run via Maven (Surefire); `mvn clean install` is the baseline.
29+
- Run targeted module tests from their module directory when iterating.
30+
- Keep tests close to source modules; name tests with `*Test` where applicable.
31+
32+
## Commit & Pull Request Guidelines
33+
34+
- Commit messages use a module tag in brackets and a short Chinese summary, e.g. `[fit] 修复某问题`.
35+
- Keep commit subjects concise (around 20 characters); add details in the body if needed.
36+
- PRs should be based on the correct module/version branch and normally include a single commit.
37+
38+
## Security & Configuration Tips
39+
40+
- Do not report vulnerabilities via public issues; follow `SECURITY.md`.
41+
- Ensure git hooks are enabled for encoding checks (`git-hooks/check-utf8-encoding.sh`).

AGENTS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# 仓库指南
2+
3+
## 项目结构与模块划分
4+
5+
本仓库包含 FIT 框架及相关引擎。
6+
- `framework/` 为核心实现目录(`framework/fit/java``framework/fit/python``framework/waterflow``framework/fel`)。
7+
- `docs/` 存放用户指南、快速入门与白皮书。
8+
- `examples/` 包含 FIT/FEL 可运行示例。
9+
- `docker/` 提供容器构建资源。
10+
- `build/` 为 Maven 构建产物输出目录(自动生成)。
11+
12+
## 构建、测试与开发命令
13+
14+
- `mvn clean install`(仓库根目录):构建全部模块并运行测试,产物输出到 `build/`
15+
- `cd framework/fit/java && mvn clean install`:仅构建 Java FIT 框架。
16+
- `./build/bin/fit start`:启动 Java 运行时(依赖 Node.js);默认端口 `8080`
17+
- `./.claude/run-test.sh`:完整验证流程(构建、启动、健康检查)。
18+
19+
## 编码风格与命名规范
20+
21+
- Java 格式化使用 IntelliJ 配置 `CodeFormatterFromIdea.xml`
22+
- 公共/受保护的 Java API 需要 Javadoc,并包含 `@param`/`@return`
23+
- 类头需包含 `@author``@since yyyy-MM-dd`
24+
- 分支命名使用模块前缀与意图,例如 `fit-feature-xxx``waterflow-bugfix-yyy`
25+
26+
## 测试规范
27+
28+
- Java 测试通过 Maven(Surefire)执行,`mvn clean install` 为基线命令。
29+
- 迭代时可在模块目录运行定向测试。
30+
- 测试与源码同模块放置,命名优先使用 `*Test`
31+
32+
## 提交与 PR 规范
33+
34+
- 提交信息以模块标签开头,中文简述,例如 `[fit] 修复某问题`
35+
- 标题建议 20 字左右,必要时在正文补充细节。
36+
- PR 基于正确的模块/版本分支,通常仅包含一次提交。
37+
38+
## 安全与配置提示
39+
40+
- 安全问题请勿在公共 Issue 报告,按 `SECURITY.md` 指引私下提交。
41+
- 请启用 git hooks 进行编码检查(`git-hooks/check-utf8-encoding.sh`)。

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ exec git-hooks/check-utf8-encoding.sh
8686
8787
### 提交信息格式
8888

89-
- 以中括号开头,然后加上模块名,例如 `[fit]`
9089
- 用简短的语句描述提交的主要内容,不要太长,建议 20 个字以内,需要使用中文,结尾不需要句号。
9190
- 如有必要,在简短的描述后添加一个空行,然后补充详细说明,可以使用多行来描述。
9291
- 说明中可以包括问题的原因、解决方法和影响范围等。
93-
- 样例:`[fit] 修复某问题`
92+
- 样例:`修复某问题`
9493

9594
## 代码审查
9695

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ build/
101101
**启动命令**
102102

103103
```
104-
mkdir dynamic-plugins
105-
cd dynamic-plugins
106-
../build/bin/fit start
104+
./build/bin/fit start
107105
```
108106

109107
> 以上编译构建出的 `fit` 命令可以通过系统操作(别名或添加系统路径)来简化输入。

framework/fit/java/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ FIT 函数平台是一套支持多语言融合编程、插件化开发、聚散
1717
* Maven,推荐版本 Maven 3.8.8+
1818
* 对 fitframework 构建:在 framework/fit/java 目录下使用 Maven 对框架进行编译:`mvn clean install`
1919
* 对 您的项目 构建:在您的项目下进行编译:`mvn clean install`
20+
* 内存版注册中心启动:参考 `../registry-center.md`
2021

2122
#### 0. 依赖
2223
在系统生成的 pom 文件中,添加 Web 相关的依赖,如下所示:
@@ -118,4 +119,4 @@ public class Controller {
118119
- [配置架构设计](fit-conf/README.md)
119120
- [插件架构设计](fit-plugin/README.md)
120121
- [运行时设计](fit-runtime/README.md)
121-
- [启动程序设计](fit-launcher/README.md)
122+
- [启动程序设计](fit-launcher/README.md)

framework/fit/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ FIT for Python 是基于 FIT Framework 的 Python 运行时与插件开发套件
2727
## 配置说明
2828

2929
- 默认配置位于 `conf/`,包括 `application.yml``fit.yml``fit_startup.yml` 等。
30-
- 注册中心:`conf/application.yml``registry-center` 配置为框架发现和加载插件的前置条件,需保证注册中心已启动(可参考 Java 框架的本地注册中心启动方式),并与 `server.addresses` 等参数保持一致。
30+
- 注册中心:`conf/application.yml``registry-center` 配置为框架发现和加载插件的前置条件,需保证注册中心已启动并与 `server.addresses` 等参数保持一致。推荐先启动 Java 内存版注册中心,参考 `../registry-center.md`
3131
- 如使用直连内存注册中心,默认 `mode: DIRECT`,地址示例 `localhost:8080`;如使用代理/Nacos,请按实际环境调整 `mode``addresses``protocol` 等字段。
3232
- 启动前请根据本地环境核对端口、协议及上下文路径,必要时同步修改插件侧的配置文件。
3333

@@ -103,4 +103,4 @@ curl --request GET \
103103
- 启动报端口占用:调整 `conf/fit_startup.yml``application.yml` 中的端口后重启。
104104
- 注册中心连通性:确认 `registry-center.addresses` 可达,必要时先用 curl/ping 验证。
105105
- 重新安装依赖:在已激活虚拟环境中执行 `pip install -r requirements.txt --force-reinstall`
106-
- 停止服务:直接中断前台进程(Ctrl+C),或关闭终端会话。
106+
- 停止服务:直接中断前台进程(Ctrl+C),或关闭终端会话。

framework/fit/registry-center.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# FIT 注册中心(Java 内存版)
2+
3+
本文说明如何启动 FIT Framework 自带的 Java 内存注册中心,用于本地开发或与 Python 运行时联调。该注册中心随 Java 侧构建产物一起生成,无需额外安装服务。
4+
5+
## 前置要求
6+
7+
- Java 17+
8+
- Maven 3.8.8+
9+
- Node.js 12+(`fit` 启动脚本依赖 Node.js)
10+
11+
## 启动步骤(最简)
12+
13+
1. 编译 Java 侧框架:
14+
```bash
15+
cd framework/fit/java
16+
mvn clean install
17+
```
18+
产物会输出到仓库根目录 `build/`,其中包含:
19+
- `build/bin/fit` 启动脚本
20+
- `build/plugins/fit-service-coordination-simple-*.jar` 内存注册中心插件
21+
22+
2. 启动 FIT 服务(默认启用内存注册中心):
23+
```bash
24+
./build/bin/fit start
25+
```
26+
可选:如果希望把当前目录作为动态插件目录,可直接在该目录执行;如需隔离插件,可自行进入其他空目录再执行。
27+
28+
3. 验证服务:
29+
```bash
30+
curl http://localhost:8080/actuator/plugins
31+
```
32+
33+
## 常见说明
34+
35+
- 默认端口为 `8080`,若冲突可在启动命令中覆盖,例如:
36+
```bash
37+
./build/bin/fit start server.http.port=8081
38+
```
39+
- 内存注册中心适用于单机或测试场景;需要 Nacos 时,请改用对应的 Nacos 插件和配置。

0 commit comments

Comments
 (0)