Files
SnapOtter/apps/docs/zh-CN/guide/contributing.md
T
SnapOtterandGitHub d10d0f544f fix: release QA hardening across processing, media, security, and CI gates (#649)
A release-readiness QA pass over the whole product. The commits split into
defects a user would hit and gates that were reporting green while measuring
nothing.

## Fixes that change behaviour

Rate limiting was bypassable on every install: TRUST_PROXY defaulted to true, so
request.ip came from a client-set header and a forged X-Forwarded-For got past
the login limiter. The default is now a private-network trust list.

A transient Postgres outage stranded in-flight jobs, leaving finished output on
disk with no row pointing at it. A reconciler now resolves those rows and adopts
the bytes rather than dropping the work.

A Redis connection that moved to a new address wedged every read-blocked
consumer, so completions stopped signalling while health still answered 200.
Socket timeouts plus subscriber pings recover it.

Installing more than one AI bundle left the shared venv multi-versioned and
silently broke three tools. The installer now reconciles distributions to one
version each.

Converting an image to JXL at quality 1 through 4 returned a 500, because
libjxl 0.7 rejects the distance those values compute. The quality is floored at
what the encoder honours. A missing ffmpeg was also reported to the user as a
corrupt upload; it now says the engine is unavailable.

RAW uploads reached an unpatched LibRaw on arm64, so it is built from source at
0.22.2, and the release scan was split so it can fail on an unfixed critical
instead of hiding it behind ignore-unfixed.

## Gates that could not fail

Two mutation lanes ran zero mutants because Stryker crawled the gitignored docs
build; coverage discarded its whole report on any failing test; the lint gate
skipped root tests, scripts, and two workspaces; and several generated matrices
counted a host missing ffmpeg as a passing tool. Each now measures what it
claims.

Full evidence and the outstanding release items are tracked locally and are not
part of this branch.
2026-07-27 15:37:30 +08:00

6.1 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash, i18n_hash_version
description i18n_source_hash i18n_provenance i18n_output_hash i18n_hash_version
如何为 SnapOtter 做贡献。缺陷报告、功能请求、拉取请求以及 CLA 要求。 6c920a5f83e0 human 048997196c13 2

贡献指南

感谢你有意参与贡献。本指南介绍如何参与、我们接受哪些内容以及如何开始。

贡献方式

议题(无需搭建环境)

  • 缺陷报告 - 有东西坏了?请附上复现步骤,提交一份 bug report
  • 功能请求 - 有想法?请发起一个 discussion,让社区参与讨论并为其投票。
  • 翻译问题 - 发现错误或缺失的翻译?请提交一个 translation issue
  • 文档问题 - 文档中有不对的地方?请提交一个 documentation issue

代码(需要签署 CLA

我们接受以下类型的拉取请求:

类型 流程
缺陷修复 直接提交 PR(如果已有对应议题,请附上链接)
新增翻译 直接提交 PR(参见 翻译指南
文档改进 直接提交 PR
测试覆盖率改进 直接提交 PR
新工具或新功能 先发起一个 discussion;维护者会在你动手写代码前将获批的想法转化为一个跟踪议题
重构或架构变更 先发起一个 discussion,并在写代码前等待维护者确认

我们不会接受的内容

  • 对 CI/CD 工作流、发布配置或 linter/编译器配置的更改
  • 未签署 Contributor License Agreement 的 PR
  • 变更超过 400 行的 PR(请将大工作量拆分为多个较小的 PR)
  • 未经事先讨论并获批的功能
  • 未经事先讨论对 packages/ai/ 的更改

贡献者许可协议

在我们合并你的第一个 PR 之前,你必须签署我们的 Individual CLA。这是一次性要求。

原因: SnapOtter 采用双重许可(AGPLv3 + 商业许可)。CLA 授予我们在这两种许可下分发你贡献的权利。你仍保留对自己作品的全部版权。

方式: 当你提交第一个 PR 时,CLA Assistant 机器人会评论并附上一个链接。点击它,查看协议,然后使用你的 GitHub 账户签署。整个过程只需 30 秒。

如果你是代表雇主进行贡献,且你的雇主保留对你作品的知识产权,请在提交前联系 contact@snapotter.com 以安排签署 Corporate CLA。

开始上手

前置条件

  • Node.js 22.22+
  • pnpm 9+
  • Python 3.11+(仅 AI 工具需要)
  • Docker(可选,用于完整的集成测试)

搭建环境

# Fork and clone
git clone https://github.com/<your-username>/snapotter.git
cd snapotter

# Start Postgres + Redis for local dev
docker compose -f docker-compose.dev.yml up -d

# Install dependencies
pnpm install

# Start dev servers (web on :1351, API on :13490)
pnpm dev

运行检查

在提交 PR 之前,请确保所有检查在本地通过:

pnpm lint          # Biome lint + format check
pnpm typecheck     # TypeScript across monorepo
pnpm test          # Vitest unit + integration tests

拉取请求流程

  1. Fork 仓库并从 main 创建分支(feat/my-featurefix/issue-123
  2. 使用 conventional commits 以聚焦、可审阅的提交来完成你的更改
  3. 为你的更改新增或更新测试
  4. 在本地运行 pnpm lint && pnpm typecheck && pnpm test
  5. 针对 main 提交 PR 并填写模板
  6. 如有提示,请签署 CLA
  7. 等待 CI 通过以及维护者审阅

审阅预期

  • 我们的目标是在 7 天内回复 PR
  • 小而聚焦的 PR 会更快得到审阅
  • 如果 7 天内没有回音,请在讨论串中留言提醒
  • 我们可能会请求修改、建议采用不同的方案,或者在 PR 与项目方向不符时将其关闭

你的 PR 合并之后

你的贡献将被纳入下一个版本发布,并在变更日志中署名。

适合新手的议题

想找点事情做?可以查看我们的 good first issues,那里有适合初学者的任务;也可以看看 help wanted,那里有一些我们希望得到社区帮助的较大工作项。

代码风格

  • Biome 负责格式化和 lint(双引号、分号、2 空格缩进)
  • 预提交钩子会自动对暂存文件运行 biome check --write
  • 如果 linter 报错,请修改代码(不要修改 Biome 配置)
  • 处处使用 ES 模块(import/export
  • Conventional commitsfeat:fix:refactor:docs:test:chore:

有关完整的架构细节,请参见 开发者指南

安全

请勿为安全漏洞提交公开的 PR 或议题。 请通过 GitHub Security Advisories 或发送邮件至 contact@snapotter.com 私下报告。完整细节参见 SECURITY.md

有疑问?