Skip to content

fix(corsair): pass a test kek after resolveKekAtInit - #1449

Closed
Dhirenderchoudhary wants to merge 1 commit into
corsairdev:mainfrom
Dhirenderchoudhary:fix/empty-kek-tests
Closed

fix(corsair): pass a test kek after resolveKekAtInit#1449
Dhirenderchoudhary wants to merge 1 commit into
corsairdev:mainfrom
Dhirenderchoudhary:fix/empty-kek-tests

Conversation

@Dhirenderchoudhary

@Dhirenderchoudhary Dhirenderchoudhary commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • throws when kek is empty and a database is set. hooks and retry-recover still passed kek: '', so every plugin PR that touches constants.ts fails corsair#test.
  • Use kek: 'test-kek' like the other core tests.

Test plan

  • corsair#test (hooks.test.ts, retry-recover.test.ts)
  • Re-run CI on an open plugin PR after this lands

Summary by CodeRabbit

  • Tests
    • Updated test configurations to use a representative encryption key value.
    • Existing test behavior and assertions remain unchanged.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@Dhirenderchoudhary is attempting to deploy a commit to the corsair Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 8716d8e0-bcb7-4075-9b30-5c60ef24f1ed

📥 Commits

Reviewing files that changed from the base of the PR and between 77b9736 and 301d488.

📒 Files selected for processing (2)
  • packages/corsair/tests/hooks.test.ts
  • packages/corsair/tests/retry-recover.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The test configurations in hook and retry-recovery tests now use kek: 'test-kek' instead of an empty string. Test logic and assertions remain unchanged.

Changes

Test KEK Configuration

Layer / File(s) Summary
Update test encryption-key configuration
packages/corsair/tests/hooks.test.ts, packages/corsair/tests/retry-recover.test.ts
The affected createCorsair calls now pass kek: 'test-kek'.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 301d4

This PR updates database-backed tests to use the required non-empty test KEK without changing production behavior or public contracts. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating Corsair tests to pass a test key-encryption key after the resolveKekAtInit behavior changed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the core Changes in packages/corsair label Sep 1, 2026
@Dhirenderchoudhary
Dhirenderchoudhary marked this pull request as ready for review September 1, 2026 06:23
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates two Corsair test suites to provide a valid non-empty test KEK when initializing Corsair with a database.

  • Replaces empty KEKs in endpoint hook tests with test-kek.
  • Replaces empty KEKs in retry and recovery tests with test-kek.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The changed test configuration satisfies the non-empty KEK requirement for database-backed Corsair instances, while each test retains isolated in-memory storage.

Important Files Changed

Filename Overview
packages/corsair/tests/hooks.test.ts Uses a valid test KEK across database-backed hook tests, preventing initialization from failing before hook behavior is exercised.
packages/corsair/tests/retry-recover.test.ts Uses a valid test KEK in both retry scenarios so the tests reach the intended request and recovery behavior.

Reviews (1): Last reviewed commit: "fix(corsair): pass a test kek after reso..." | Re-trigger Greptile

@Dhirenderchoudhary

Copy link
Copy Markdown
Collaborator Author

Closing as #1450 same fix done by @yuvrxj-afk with better approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes in packages/corsair

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant