Repository navigation
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
111 lines (94 loc) · 4.94 KB
/
Copy path.coderabbit.yaml
File metadata and controls
111 lines (94 loc) · 4.94 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: en-US
reviews:
profile: chill
high_level_summary: true
collapse_walkthrough: true
high_level_summary_in_walkthrough: false
poem: false
suggested_labels: false
auto_assign_reviewers: false
path_filters:
- "!**/vendor/**"
- "!**/composer.lock"
- "!**/lib/composer.lock"
- "!**/composer/composer-*.json"
- "!**/*.min.js"
- "!**/*.min.css"
- "!**/locale/**/*.mo"
- "!**/.docker_data/**"
- "!**/qa/screenshots/**"
path_instructions:
- path: "**/*"
instructions: |
Two lesson stores. Review them separately.
File-based lessons ($CFG->lessons, a context with no manifest_id) must not regress.
Those items launch with the incoming consumer key and secret, and inherit stays on the launch URL.
They have no content_id, they are not authored, and they never reach course settings or External Links.
Do not require lti_content, a deployment, or a grade column on that path.
Flag a change that alters file-backed render or launch.
Review a manifest course as a fresh course created after this change.
A manifest saved before lti_content may break. Do not file findings about migrating old lesson JSON, old lti_link rows, or courses that already have a manifest.
New lesson LTI items provision onto lti_content. An imported LTI item stays unprovisioned until a deployment is chosen.
lti_content belongs in $DATABASE_INSTALL. Upgrade creates a table that is in the install list and missing from the database.
Do not ask for a $DATABASE_UPGRADE block only because the table is new.
A new column follows that same production order. Put it on the CREATE TABLE and in the upgrade field list. Upgrade Database runs before the new code serves traffic. Do not ask for a columnExists guard, a fallback SELECT, or a constant in place of the column because application code reads a column that upgrade adds. A missing column until that upgrade is expected.
Review a columnExists check only when the change already includes one. Do not ask for that check on other readers of the same column, and do not treat one guard as a pattern to copy. columnExists inside an upgrade script only keeps that script from adding a column that is already present.
- path: "composer.json"
instructions: |
Tsugi commits vendor/ to git; production does not run Composer.
- Any dependency bump must update composer.json, composer.lock, and vendor/ together.
- Dev packages (phpunit, phpstan, myclabs, panther, etc.) are gitignored under vendor/.
- Always finish with: composer install --no-dev --ignore-platform-reqs
so vendor/composer/autoload_*.php does not reference gitignored dev packages.
- Do not raise the PHP constraint unless explicitly requested.
- Do not remove direct dependencies (e.g. symfony/browser-kit) — modules rely on them.
- Symfony is intentionally mixed 7.4 + 8.0; avoid accidental 8.1 jumps.
- path: "lti/**"
instructions: |
LTI launch and OAuth/JWT paths are security-critical.
- Validate signatures, nonces, state, and redirect URLs carefully.
- Do not weaken checks on JWT decode or key handling (phpseclib, firebase/php-jwt).
- Prefer existing Tsugi\Util\LTI13 and LTIX patterns over new ad-hoc crypto.
- path: "admin/**"
instructions: |
Admin console code must enforce authorization before mutating data.
- Match existing admin routing and session checks in nearby files.
- Use prepared statements / ORM patterns already used in Tsugi; avoid raw SQL with unescaped input.
- path: "api/**"
instructions: |
API endpoints should validate input, return appropriate HTTP status codes, and avoid leaking secrets or PII in error messages.
- path: "lib/**"
instructions: |
Core Tsugi library (Tsugi\ namespace). Follow AGENTS.md:
- isLoggedIn() means loggedInUserId() !== 0; it does NOT require currentContextId().
- Use currentContextId() only when a course/context is required.
- Match existing PHP style: 4-space indent, braces on same line, $CFG for config.
- path: "**/*.php"
instructions: |
PHP 8.4+ Tsugi application code (not third-party vendor).
- Follow conventions in the nearest files; keep diffs small and focused.
- Escape output appropriately; treat user/LMS-supplied data as untrusted.
- config.php is local-only — never commit secrets.
auto_review:
enabled: true
drafts: false
tools:
phpstan:
enabled: true
phpcs:
enabled: false
phpmd:
enabled: false
finishing_touches:
docstrings:
enabled: false
unit_tests:
enabled: false
knowledge_base:
code_guidelines:
enabled: true
filePatterns:
- AGENTS.md
- CONTRIBUTING.md
- README_COMPOSER.md