diff --git a/.github/workflows/pr-agent.yml b/.github/workflows/pr-agent.yml new file mode 100644 index 00000000..c704c2a0 --- /dev/null +++ b/.github/workflows/pr-agent.yml @@ -0,0 +1,30 @@ +name: PR Agent (DeepSeek) + +on: + pull_request: + types: [opened, reopened, ready_for_review] + issue_comment: + types: [created] + +jobs: + pr_agent_job: + if: ${{ github.event.sender.type != 'Bot' }} + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: write + name: Run PR Agent on every pull request, respond to user comments + steps: + - name: PR Agent action step + id: pragent + uses: the-pr-agent/pr-agent@main + env: + OPENAI_KEY: ${{ secrets.DEEPSEEK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CONFIG.MODEL: "deepseek/deepseek-chat" + CONFIG.FALLBACK_MODELS: '["deepseek/deepseek-chat"]' + GITHUB_ACTION_CONFIG.AUTO_REVIEW: "true" + GITHUB_ACTION_CONFIG.AUTO_DESCRIBE: "true" + GITHUB_ACTION_CONFIG.AUTO_IMPROVE: "true" + CONFIG.AI_TIMEOUT: "180" diff --git a/.pr_agent.toml b/.pr_agent.toml new file mode 100644 index 00000000..2309109f --- /dev/null +++ b/.pr_agent.toml @@ -0,0 +1,36 @@ +[config] +model = "deepseek/deepseek-chat" +fallback_models = ["deepseek/deepseek-chat"] +ai_timeout = 180 + +[github_action_config] +auto_review = true +auto_describe = true +auto_improve = true +pr_actions = ["opened", "reopened", "ready_for_review"] + +[pr_reviewer] +extra_instructions = """\ +Focus on the following aspects during review: +- Security vulnerabilities and unsafe code patterns +- Logic errors and edge cases not handled +- Performance bottlenecks and inefficient algorithms +- API design, breaking changes, and backward compatibility +- Proper error handling and logging +- Code maintainability, readability, and adherence to project conventions +- Missing tests or insufficient test coverage for the changes +""" +num_max_findings = 5 +require_tests_review = true +require_security_review = true +require_estimate_effort_to_review = true + +[pr_description] +generate_ai_title = true +use_bullet_points = true +enable_pr_diagram = true + +[pr_code_suggestions] +num_code_suggestions = 6 +suggestions_score_threshold = 5 +focus_only_on_problems = true diff --git a/README.md b/README.md index 26e7fccd..02e930a9 100644 --- a/README.md +++ b/README.md @@ -128,4 +128,6 @@ dotnet test --collect:"XPlat Code Coverage" See the canonical AI rule set under `docs/ai/rules/`: - **Rule Index**: `docs/ai/rules/README.md` - **Copilot Entrypoint**: `.github/copilot-instructions.md` -- **Agent Entrypoint**: `AGENTS.md` \ No newline at end of file +- **Agent Entrypoint**: `AGENTS.md` + + \ No newline at end of file