Skip to content

Commit ae6d29f

Browse files
committed
chore: add CodeRabbit app queue cleanup check
Add a deterministic CodeRabbit pre-merge check for the DrJKL app queuePrompt finding: when app.ts temporarily assigns api.authToken/api.apiKey around api.queuePrompt, require rejected-path tests that prove both credentials are cleared. Path instructions alone did not reliably surface this on the canary. Verification: parsed .coderabbit.yaml with Ruby YAML.load_file and confirmed the custom check list includes App queue credential cleanup on rejection; ran git diff --check successfully.
1 parent 676c3c5 commit ae6d29f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.coderabbit.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ reviews:
6464
6565
When warning, reference the specific ADR by number and link to `docs/adr/` for context. Frame findings as directional guidance since ADR 0003 and 0008 are in Proposed status.
6666
67+
- name: App queue credential cleanup on rejection
68+
mode: warning
69+
instructions: |
70+
Use only PR metadata already available in the review context: the changed-file list relative to the PR base, the PR description, and the diff content. Do not rely on shell commands.
71+
72+
This check applies ONLY when the PR changes `src/scripts/app.ts` and that diff assigns `api.authToken` or `api.apiKey` before awaiting `api.queuePrompt`.
73+
74+
When applicable, require a changed app test file such as `src/scripts/app.core.test.ts` or `src/scripts/app.test.ts` to include rejected-queue coverage that:
75+
1. Populates both credential sources (`authToken` and API key, or the stores that feed them) with non-empty values.
76+
2. Makes `api.queuePrompt` reject.
77+
3. Calls `app.queuePrompt`.
78+
4. Asserts after the rejection path that both `api.authToken` and `api.apiKey` are cleared, deleted, or `undefined`.
79+
80+
Warn if rejection is tested without those cleanup assertions, or if cleanup is asserted only on the successful `api.queuePrompt` path. Mention that success-path cleanup alone does not prove credentials are cleared after a failed queue request.
81+
6782
path_instructions:
6883
- path: '**/*.test.ts'
6984
instructions: |

0 commit comments

Comments
 (0)