|
| 1 | +# CodeRabbit configuration for serverless-appsync-plugin |
| 2 | +# Reference: https://docs.coderabbit.ai |
| 3 | +# Inspect the live, parsed config on any PR with: @coderabbitai configuration |
| 4 | +language: en-US |
| 5 | + |
| 6 | +reviews: |
| 7 | + # Start conservative: surface bugs, security, and CFN/logic-correctness |
| 8 | + # issues; stay quiet on style (ESLint + Prettier already enforce that in CI). |
| 9 | + # Revisit "assertive" after a few weeks if the team wants broader feedback. |
| 10 | + profile: chill |
| 11 | + request_changes_workflow: false |
| 12 | + high_level_summary: true |
| 13 | + review_status: true |
| 14 | + collapse_walkthrough: false |
| 15 | + changed_files_summary: true |
| 16 | + poem: false |
| 17 | + |
| 18 | + auto_review: |
| 19 | + enabled: true |
| 20 | + drafts: false |
| 21 | + incremental_reviews: true |
| 22 | + |
| 23 | + # Project-wide guidance. The biggest noise-reducer is telling CodeRabbit what |
| 24 | + # NOT to repeat — formatting/style is already handled by Prettier + ESLint. |
| 25 | + instructions: | |
| 26 | + This is a TypeScript plugin for the Serverless Framework that compiles an |
| 27 | + `appSync` config block into AWS AppSync CloudFormation. Prioritise, in order: |
| 28 | + 1. Correctness of the generated CloudFormation — valid resource shapes, |
| 29 | + Ref/Fn::GetAtt that resolve, no missing or duplicated logical IDs. |
| 30 | + 2. AWS AppSync semantics — auth modes, data sources, resolvers/pipeline |
| 31 | + functions, WAF, custom domains, API keys, caching, logging. |
| 32 | + 3. Serverless integration — throw errors via this.serverless.classes.Error; |
| 33 | + never add a runtime require of 'serverless/lib/...' (it breaks on |
| 34 | + Serverless v4, see #632 — such imports must be `import type` only); |
| 35 | + use the injected serverless/options/utils rather than framework internals. |
| 36 | + 4. Backwards compatibility of the public `appSync` config schema and of the |
| 37 | + emitted CloudFormation — changes there can break users' live stacks. |
| 38 | + Do NOT comment on code formatting, import ordering, or line length — Prettier |
| 39 | + and ESLint enforce those in CI. Skip missing JSDoc unless a symbol is |
| 40 | + exported. Prefer substantive findings over nits. |
| 41 | +
|
| 42 | + path_filters: |
| 43 | + - '!lib/**' |
| 44 | + - '!**/node_modules/**' |
| 45 | + - '!package-lock.json' |
| 46 | + - '!**/__snapshots__/**' |
| 47 | + - '!**/*.snap' |
| 48 | + - '!coverage/**' |
| 49 | + - '!**/.serverless/**' |
| 50 | + # Transient config written by the e2e synthesis harness |
| 51 | + - '!examples/**/serverless.e2e.yml' |
| 52 | + |
| 53 | + path_instructions: |
| 54 | + - path: 'src/**/*.ts' |
| 55 | + instructions: | |
| 56 | + Plugin source. Verify the emitted CloudFormation is valid and complete, |
| 57 | + AWS resource properties are correct, and errors use |
| 58 | + this.serverless.classes.Error. Flag any runtime require of |
| 59 | + 'serverless/lib/...' (must be `import type`). Call out changes that alter |
| 60 | + the public `appSync` schema or the emitted template shape — those can |
| 61 | + break existing users. |
| 62 | + - path: 'src/types/**' |
| 63 | + instructions: | |
| 64 | + Public/shared type definitions. Flag changes that narrow or remove |
| 65 | + existing config options; those are breaking for consumers. |
| 66 | + - path: 'src/__tests__/**/*.ts' |
| 67 | + instructions: | |
| 68 | + Unit tests. Check edge-case coverage (null/undefined/empty/boundary) and |
| 69 | + that fakes/mocks stay isolated between tests. |
| 70 | + - path: 'e2e/**/*.ts' |
| 71 | + instructions: | |
| 72 | + CFN-synthesis tests. Assertions should target concrete values and |
| 73 | + resource shapes (not just truthiness) and be explicit about cardinality. |
| 74 | + - path: 'integration/**/*.ts' |
| 75 | + instructions: | |
| 76 | + Real-AWS integration tests. They deploy live resources — verify they are |
| 77 | + opt-in/gated and always tear down in afterAll, even on failure. |
| 78 | + - path: 'examples/**' |
| 79 | + instructions: | |
| 80 | + Examples double as user-facing documentation and as test fixtures, so |
| 81 | + they must stay deployable. Flag config a user couldn't actually deploy. |
| 82 | +
|
| 83 | + tools: |
| 84 | + enabled: true |
| 85 | + # ESLint already runs in CI (`npm run lint`); don't duplicate its findings. |
| 86 | + eslint: |
| 87 | + enabled: false |
| 88 | + |
| 89 | +chat: |
| 90 | + auto_reply: true |
| 91 | + |
| 92 | +knowledge_base: |
| 93 | + learnings: |
| 94 | + scope: auto |
0 commit comments