Conversation
* 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
Review Summary by Qodo
WalkthroughsDescription• 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 Diagramflowchart 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
File Changes1. .github/workflows/pr-check.yml
|
Greptile OverviewGreptile SummarySimplified the CI workflow by removing conditional directory detection logic and added a comprehensive bilingual contributing guide. Key Changes:
Notes:
Confidence Score: 4/5
|
| 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
| - name: Install backend (editable) | ||
| if: steps.detect.outputs.exists == 'true' | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e backend |
There was a problem hiding this comment.
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:
| - 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!
| - name: Install dependencies | ||
| if: steps.detect.outputs.exists == 'true' | ||
| working-directory: frontend | ||
| run: pnpm install --frozen-lockfile |
There was a problem hiding this comment.
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.
Code Review by Qodo
1. Wrong engines.yaml schema
|
| 编辑 `backend/config/engines.yaml` 配置 LLM/ASR/TTS 提供商: | ||
|
|
||
| ```yaml | ||
| llm: | ||
| default: openai | ||
| providers: | ||
| openai: | ||
| api_key: "your-api-key" | ||
| model: "gpt-4" | ||
| ``` |
There was a problem hiding this comment.
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
🤖 Codex PR ReviewPR Summary
Findings
|
变更说明
关联 Issue / 需求
自测方式
cd backend && uv run uvicorn app.main:app --reload --port 8090cd frontend && pnpm --filter @whalewhisper/web dev风险 & 回滚
Checklist
PR Checks)通过📝 PR 说明(Codex 自动生成)
CONTRIBUTING.md(中英双语)贡献指南,集中说明贡献流程、分支/提交规范、代码风格与自测方式;同时精简.github/workflows/pr-check.yml,移除 backend/frontend 的“存在性探测/跳过”逻辑,并将前端 job 统一在frontend/目录下执行命令,确保非 Draft PR 固定跑后端烟测与前端构建检查。PR Checks工作流通过(backend / frontend 两个 job)。backend/pyproject.toml、frontend/pnpm-lock.yaml(或backend//frontend/路径),PR Checks 会直接失败,需要同步更新 workflow。