Skip to content

Dev#12

Merged
FutureUnreal merged 3 commits intomainfrom
dev
Feb 7, 2026
Merged

Dev#12
FutureUnreal merged 3 commits intomainfrom
dev

Conversation

@FutureUnreal
Copy link
Member

@FutureUnreal FutureUnreal commented Feb 7, 2026

变更说明

关联 Issue / 需求

自测方式

  • 后端:cd backend && uv run uvicorn app.main:app --reload --port 8090
  • 前端:cd frontend && pnpm --filter @whalewhisper/web dev

风险 & 回滚

Checklist

  • 已保证改动聚焦(不混杂无关重构)
  • 已更新相关文档(如 README / 配置示例)
  • 未提交任何密钥/个人信息
  • CI(PR Checks)通过

📝 PR 说明(Codex 自动生成)

  • 变更概览:新增 CONTRIBUTING.md(中英双语)贡献指南,集中说明贡献流程、分支/提交规范、代码风格与自测方式;同时精简 .github/workflows/pr-check.yml,移除 backend/frontend 的“存在性探测/跳过”逻辑,并将前端 job 统一在 frontend/ 目录下执行命令,确保非 Draft PR 固定跑后端烟测与前端构建检查。
  • 影响范围:docs、ci
  • 如何验证
    1. 在 GitHub 上确认 PR Checks 工作流通过(backend / frontend 两个 job)。
    2. 本地按 CI 的最小检查跑一遍:
      # backend
      python -m pip install -e backend
      python -m compileall -q backend/app
      python -c "from app.main import app; print('backend app import: ok')"
      
      # frontend
      cd frontend
      pnpm install --frozen-lockfile
      pnpm --filter @whalewhisper/web build
  • 风险点:CI 不再根据目录/锁文件存在性自动跳过;若后续调整目录结构或移除/重命名 backend/pyproject.tomlfrontend/pnpm-lock.yaml(或 backend/ / frontend/ 路径),PR Checks 会直接失败,需要同步更新 workflow。

FutureUnreal and others added 3 commits February 8, 2026 00:29
* chore: add comprehensive contributing guide

* Update CONTRIBUTING.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Restore backend and frontend PR checks
- Enable Python syntax check and import test for backend
- Enable pnpm build check for frontend
- Fix 'Expected — Waiting for status to be reported' issue
@github-actions github-actions bot added area/ci Touches CI/CD (.github) needs-review Needs careful review (large/complex changes) size/L PR size: < 1000 lines changed labels Feb 7, 2026
@FutureUnreal FutureUnreal merged commit 562c8b8 into main Feb 7, 2026
5 checks passed
@qodo-code-review
Copy link

Review Summary by Qodo

✨ Enhancement 📝 Documentation

Grey Divider

Walkthroughs

Description
• Simplify CI workflow by removing conditional backend/frontend detection
• Add comprehensive bilingual contributing guide with setup and guidelines
• Streamline PR checks with direct execution and working directory defaults
Diagram
flowchart LR
  A["CI Workflow<br/>pr-check.yml"] -->|"Remove detection<br/>logic"| B["Simplified<br/>Checks"]
  C["Contributing<br/>Guide"] -->|"Add bilingual<br/>documentation"| D["Setup & Guidelines<br/>Chinese + English"]
  B -->|"Streamline<br/>execution"| E["Faster PR<br/>Validation"]
  D -->|"Guide<br/>contributors"| E
Loading

Grey Divider

File Changes

1. .github/workflows/pr-check.yml ⚙️ Configuration changes +3/-38

Simplify CI workflow by removing conditional checks

• Remove conditional detection steps for backend and frontend directories
• Eliminate redundant if conditions on all workflow steps
• Add defaults.run.working-directory: frontend to simplify frontend step paths
• Reduce workflow complexity from 79 to 44 lines while maintaining functionality

.github/workflows/pr-check.yml


2. CONTRIBUTING.md 📝 Documentation +659/-0

Add comprehensive bilingual contributing guide

• Create comprehensive bilingual contributing guide (Chinese and English)
• Document project introduction, code of conduct, and getting started instructions
• Provide detailed guidelines for branch naming, commit format, and code style
• Include testing procedures, PR process, and issue reporting templates
• Add setup instructions for both backend (Python/uv) and frontend (Node.js/pnpm)

CONTRIBUTING.md


Grey Divider

Qodo Logo

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 7, 2026

Greptile Overview

Greptile Summary

Simplified the CI workflow by removing conditional directory detection logic and added a comprehensive bilingual contributing guide.

Key Changes:

  • Removed detection steps that checked for backend/ and frontend/ existence
  • Removed conditional if statements from all workflow steps
  • Added working-directory: frontend to frontend job defaults for cleaner code
  • Created new CONTRIBUTING.md with detailed contribution guidelines in Chinese and English
  • Contributing guide covers: setup, branch naming, commit format, code style, testing, PR process, and issue reporting

Notes:

  • The workflow now assumes backend and frontend directories always exist. If either directory is removed in future refactoring, CI jobs will fail.
  • Consider adding path filters (e.g., paths: ['backend/**']) to only run jobs when relevant files change, which would also handle missing directories gracefully.

Confidence Score: 4/5

  • Safe to merge with minor considerations about workflow robustness
  • The PR adds valuable documentation and simplifies CI workflow. The workflow changes are functional for current repository structure but remove defensive checks that prevent failures if directories are removed. The CONTRIBUTING.md is well-structured with no issues. Overall improvements outweigh the minor workflow robustness concerns.
  • .github/workflows/pr-check.yml - verify that backend and frontend directories will remain stable, or add path filters to handle missing directories

Important Files Changed

Filename Overview
.github/workflows/pr-check.yml Simplified workflow by removing conditional checks; assumes backend and frontend directories always exist
CONTRIBUTING.md New comprehensive bilingual contributing guide with clear workflows, code standards, and PR process

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub
    participant CI as CI Workflow
    participant Backend as Backend Job
    participant Frontend as Frontend Job

    Dev->>GH: Push PR to dev/main branch
    GH->>CI: Trigger PR Checks workflow
    
    CI->>CI: Check if PR is draft
    alt PR is not draft
        par Backend & Frontend Jobs
            CI->>Backend: Start backend job
            Backend->>Backend: Checkout code
            Backend->>Backend: Setup Python 3.11
            Backend->>Backend: Install backend dependencies
            Backend->>Backend: Run syntax check (compileall)
            Backend->>Backend: Run import smoke test
            Backend->>CI: Report status
        and
            CI->>Frontend: Start frontend job
            Frontend->>Frontend: Checkout code
            Frontend->>Frontend: Setup Node.js 20
            Frontend->>Frontend: Setup pnpm 9.12.2
            Frontend->>Frontend: Install dependencies
            Frontend->>Frontend: Build web app
            Frontend->>CI: Report status
        end
        CI->>GH: Report overall status
        GH->>Dev: Show CI results
    else PR is draft
        CI->>GH: Skip all checks
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 24 to 27
- name: Install backend (editable)
if: steps.detect.outputs.exists == 'true'
run: |
python -m pip install --upgrade pip
pip install -e backend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow now assumes backend/ always exists. If the directory is removed or backend/pyproject.toml is missing, the job will fail. Consider adding a path filter or keeping the detection logic:

Suggested change
- name: Install backend (editable)
if: steps.detect.outputs.exists == 'true'
run: |
python -m pip install --upgrade pip
pip install -e backend
- name: Detect backend
id: detect
run: |
if [ -f backend/pyproject.toml ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Install backend (editable)
if: steps.detect.outputs.exists == 'true'
run: |

Or use path filters in the workflow trigger to only run when backend files change.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines 52 to 53
- name: Install dependencies
if: steps.detect.outputs.exists == 'true'
working-directory: frontend
run: pnpm install --frozen-lockfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the workflow now assumes frontend/ always exists. If frontend/pnpm-lock.yaml is missing, the job will fail. Consider keeping detection logic or using path filters.

@qodo-code-review
Copy link

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Wrong engines.yaml schema 🐞 Bug ⛨ Security
Description
• CONTRIBUTING.md documents an engines.yaml format using providers and inline api_key, but the
  backend loader expects llm.engines as a list and reads api_key_env (env-var based).
• Contributors following the guide will likely end up with a non-working configuration (no auth
  headers → provider calls fail) and may accidentally commit secrets into a tracked file.
Code

CONTRIBUTING.md[R80-89]

+编辑 `backend/config/engines.yaml` 配置 LLM/ASR/TTS 提供商:
+
+```yaml
+llm:
+  default: openai
+  providers:
+    openai:
+      api_key: "your-api-key"
+      model: "gpt-4"
+```
Evidence
The contributing guide’s sample YAML uses keys (providers, api_key) that the backend engine
loader does not read. The backend loads llm.engines (list) and only pulls secrets from environment
variables via api_key_env, so inline api_key in YAML won’t be used to set Authorization headers.
The repository’s own backend/config/engines.yaml matches the loader’s expected schema and uses
api_key_env rather than hardcoded keys.

CONTRIBUTING.md[80-89]
backend/app/services/engines/loader.py[38-43]
backend/app/services/engines/loader.py[67-71]
backend/app/api/llm.py[92-97]
backend/config/engines.yaml[1-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new CONTRIBUTING.md includes an `engines.yaml` example using `providers` and inline `api_key`. The backend doesn’t read those keys; it expects `llm.engines` (list) and uses `api_key_env` to fetch credentials from environment variables. This will mislead contributors into a broken setup and encourages a secret-leak pattern.

## Issue Context
Backend engine loading/parsing is implemented in `backend/app/services/engines/loader.py`, and LLM requests add Authorization headers only when `config.api_key_env` resolves to a non-empty env var.

## Fix Focus Areas
- CONTRIBUTING.md[78-90]
- CONTRIBUTING.md[397-409]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +80 to +89
编辑 `backend/config/engines.yaml` 配置 LLM/ASR/TTS 提供商:

```yaml
llm:
default: openai
providers:
openai:
api_key: "your-api-key"
model: "gpt-4"
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Wrong engines.yaml schema 🐞 Bug ⛨ Security

• CONTRIBUTING.md documents an engines.yaml format using providers and inline api_key, but the
  backend loader expects llm.engines as a list and reads api_key_env (env-var based).
• Contributors following the guide will likely end up with a non-working configuration (no auth
  headers → provider calls fail) and may accidentally commit secrets into a tracked file.
Agent Prompt
## Issue description
The new CONTRIBUTING.md includes an `engines.yaml` example using `providers` and inline `api_key`. The backend doesn’t read those keys; it expects `llm.engines` (list) and uses `api_key_env` to fetch credentials from environment variables. This will mislead contributors into a broken setup and encourages a secret-leak pattern.

## Issue Context
Backend engine loading/parsing is implemented in `backend/app/services/engines/loader.py`, and LLM requests add Authorization headers only when `config.api_key_env` resolves to a non-empty env var.

## Fix Focus Areas
- CONTRIBUTING.md[78-90]
- CONTRIBUTING.md[397-409]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🤖 Codex PR Review

PR Summary

  • 1 file changed (+3 / -38)
  • Simplifies PR CI by removing backend/frontend “detect + skip” logic so checks always run for non-draft PRs (.github/workflows/pr-check.yml)
  • Sets defaults.run.working-directory: frontend to avoid repeating working-directory on frontend run steps

Findings

  • No high-signal issues found in the diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Touches CI/CD (.github) needs-review Needs careful review (large/complex changes) size/L PR size: < 1000 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant