-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcoderabbit.template.yaml
79 lines (76 loc) · 3.53 KB
/
coderabbit.template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
language: 'en-US'
tone_instructions: 'Concise, technical, and clear'
early_access: false
enable_free_tier: true
auto_resolve_threads: true
reviews:
profile: 'chill'
request_changes_workflow: false
high_level_summary: false
high_level_summary_placeholder: '@coderabbitai summary'
high_level_summary_in_walkthrough: false
auto_title_placeholder: '@coderabbitai'
auto_title_instructions: ''
review_status: true
commit_status: true
fail_commit_status: false
collapse_walkthrough: false
changed_files_summary: false
sequence_diagrams: false
assess_linked_issues: true
related_issues: true
related_prs: true
suggested_labels: true
auto_apply_labels: false
suggested_reviewers: true
auto_assign_reviewers: false
poem: false
abort_on_close: true
auto_review:
enabled: true
auto_incremental_review: true
ignore_title_keywords: []
labels: []
drafts: false
base_branches: []
finishing_touches:
docstrings:
enabled: true
path_instructions:
- path: 'integrations/**/nango.yaml'
instructions: |
- If `sync_type: full`, then the sync should also have `track_deletes: true`.
- If the sync requires metadata, set `auto_start: false` and document the metadata as an input in `nango.yaml`.
- Scopes should be explicitly documented.
- path: 'integrations/**/**.ts'
instructions: |
- Use TypeScript best practices and ensure typings are strictly defined.
- Use comments to explain logic and link to external API documentation.
- Place endpoint URLs as comments above API requests.
- Avoid modifying arguments and prefer returning new values.
- Create a `types.ts` file containing typed third-party API responses.
- Proxy calls should use retries (default: `10`).
- Use `await nango.log()` instead of `console.log` for logging.
- Use the `params` property in proxy calls instead of appending params onto the endpoint.
- Use `nango.paginate` wherever possible for pagination.
- Always use `ProxyConfiguration` for proxy request configurations.
- Validate inputs/outputs using `zod`.
- Ensure date inputs are valid and converted using `new Date()` to the provider's expected format.
# Syncs
- The `fetchData` function must be the default export and placed at the top.
- Always paginate requests to ensure all records are retrieved.
- Avoid parallel requests to maintain the retry policy and prevent rate limits.
- Mapping logic should be in a dedicated function.
- Shared mapping logic should be stored in a `mappers` directory.
- Mapper files should follow the `mappers/to-{entity}.ts` naming convention.
- Avoid type casting and rely on TypeScript's type checking.
- If the sync is incremental, use `nango.lastSyncDate`.
# Actions
- The `runAction` function must be the default export and placed at the top.
- Use `ActionError` only for specific error messages, otherwise rely on script failure.
Example:
```typescript
throw new nango.ActionError<ActionErrorResponse>({
message: 'Missing some parameter that will prevent the action from successfully running'
});
```