From 06488d73089e5455351547fb1fbdeb5a31d4c493 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 4 Oct 2026 19:09:05 +0000 Subject: [PATCH 1/2] docs: add CodeRabbit review configuration Add repository CodeRabbit config covering pytest hooks, Bearer API auth, and Black/flake8/mypy tooling. Co-authored-by: Ben Spurlock --- .coderabbit.yaml | 113 +++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 3 +- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..fae6a78 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,113 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +# CodeRabbit Configuration +# https://docs.coderabbit.ai/reference/configuration + +language: en-US +tone_instructions: 'Be concise and constructive. Expert in Python, pytest plugins, and requests. Focus on silent-mode reliability, hook ordering, and not breaking host test sessions.' +early_access: false + +reviews: + profile: assertive + request_changes_workflow: false + high_level_summary: true + high_level_summary_placeholder: '@coderabbitai summary' + poem: true + review_status: true + review_details: false + review_progress: true + commit_status: true + collapse_walkthrough: false + + auto_review: + enabled: true + auto_incremental_review: true + drafts: false + base_branches: + - main + ignore_title_keywords: + - WIP + - '[WIP]' + - DO NOT MERGE + + path_instructions: + - path: 'src/qastudio_pytest/plugin.py' + instructions: | + pytest plugin review: + - Hooks: pytest_configure, pytest_sessionstart (tryfirst), pytest_runtest_makereport (hookwrapper), pytest_sessionfinish (trylast) + - Collect results on the call phase only + - `silent` defaults to True; API failures must not raise into the test session + - Batch results (default 10) then upload attachments when enabled + - Test linking: `@pytest.mark.qastudio_id`, `test_QA123_*` names, or docstring `QAStudio ID: QA-123` + - Prefix user-facing errors with `[QAStudio.dev]` + - Do not log API keys + + - path: 'src/qastudio_pytest/api_client.py' + instructions: | + HTTP client review: + - `requests` with Retry on 429/5xx and exponential backoff + - Auth header is `Authorization: Bearer ` + - User-Agent `qastudio-pytest/...` + - Attachment uploads are multipart/form-data to `/attachments` + - Timeouts must come from ReporterConfig.timeout + + - path: 'src/qastudio_pytest/models.py' + instructions: | + Keep ReporterConfig defaults aligned with docs: environment default, create_test_run True, batch_size 10, upload_attachments True, silent True. + Config precedence: CLI > pytest.ini > environment variables. + + - path: 'src/qastudio_pytest/utils.py' + instructions: | + Cover ANSI stripping, batching, duration formatting, and test-case ID extraction from markers, names, and docstrings. + + - path: 'tests/**/*.py' + instructions: | + pytest unit tests: + - Package tests live under tests/ (currently test_utils.py) + - Do not require a live QA Studio instance + - Add coverage when changing extraction, batching, or payload mapping + + - path: 'pyproject.toml' + instructions: | + Tooling in this repo is Black (line length 100), flake8, and mypy. Do not assume Ruff is configured unless pyproject.toml adds it. + + path_filters: + - '!**/*.lock' + - '!**/package-lock.json' + - '!dist/**' + - '!build/**' + - '!**/*.egg-info/**' + - '!venv/**' + - '!coverage/**' + - '!examples/**' + + tools: + biome: + enabled: false + ruff: + enabled: false + github-checks: + enabled: true + gitleaks: + enabled: true + +chat: + auto_reply: true + +knowledge_base: + opt_out: false + learnings: + scope: auto + code_guidelines: + enabled: true + filePatterns: + - 'CLAUDE.md' + - 'CONTRIBUTING.md' + - 'README.md' + automatic_linking_mode: auto + linked_repositories: + - repository: QAStudio-Dev/studio + instructions: 'QA Studio public API for /runs, /results, /attachments, and run completion.' + - repository: QAStudio-Dev/playwright-reporter + instructions: 'Sister Playwright reporter; keep API payload shapes compatible where possible.' + - repository: QAStudio-Dev/mcp-server + instructions: 'MCP client of the same public API.' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 004bbc9..7ad84d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,7 +99,8 @@ We follow conventional commits: 1. Update the README.md with details of changes if applicable 2. Ensure all tests pass and code is properly formatted 3. Update the CHANGELOG.md if applicable -4. The PR will be merged once you have the sign-off of a maintainer +4. PRs are reviewed by CodeRabbit using [`.coderabbit.yaml`](.coderabbit.yaml). Draft PRs and titles containing `WIP` or `DO NOT MERGE` are skipped. Use `@coderabbitai summary` in the PR description to fill in the high-level summary placeholder. +5. The PR will be merged once you have the sign-off of a maintainer ## Questions? From 0dda097a1663533bf576ed60d1a105f8eb8e1ca4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 4 Oct 2026 20:01:24 +0000 Subject: [PATCH 2/2] docs: auto-review PRs targeting develop as well as main CI already runs pull requests against develop. Align CodeRabbit auto_review.base_branches with that, and document it in CONTRIBUTING. Co-authored-by: Ben Spurlock --- .coderabbit.yaml | 1 + CONTRIBUTING.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index fae6a78..46b0a46 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -24,6 +24,7 @@ reviews: drafts: false base_branches: - main + - develop ignore_title_keywords: - WIP - '[WIP]' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ad84d6..795b5c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,7 +99,7 @@ We follow conventional commits: 1. Update the README.md with details of changes if applicable 2. Ensure all tests pass and code is properly formatted 3. Update the CHANGELOG.md if applicable -4. PRs are reviewed by CodeRabbit using [`.coderabbit.yaml`](.coderabbit.yaml). Draft PRs and titles containing `WIP` or `DO NOT MERGE` are skipped. Use `@coderabbitai summary` in the PR description to fill in the high-level summary placeholder. +4. Automatic CodeRabbit reviews run for PRs targeting `main` or `develop`, as configured in [`.coderabbit.yaml`](.coderabbit.yaml). Draft PRs and titles containing `WIP` or `DO NOT MERGE` are skipped. Use `@coderabbitai summary` in the PR description to fill in the high-level summary placeholder. 5. The PR will be merged once you have the sign-off of a maintainer ## Questions?