feat: test contents of mapper.json#2854
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
WalkthroughThis PR adds a new test utility ChangesFeature-Flag Mapper Content Validation Test Helper
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
controlplane/test/test-util.ts (1)
891-895: ⚡ Quick winAdd explicit types to the new helper signature.
Please type
expectedNumberOfFeatureFlagsexplicitly and add an explicitPromise<void>return type to match the repo’s TypeScript rules.♻️ Suggested diff
export async function assertMapperContentIsCorrect( blobStorage: InMemoryBlobStorage, expectedMapperKeysCount: number, - expectedNumberOfFeatureFlags = 1, -) { + expectedNumberOfFeatureFlags: number = 1, +): Promise<void> {As per coding guidelines,
**/*.{ts,tsx}requires explicit type annotations for function parameters and return types in TypeScript.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@controlplane/test/test-util.ts` around lines 891 - 895, Update the helper function signature for assertMapperContentIsCorrect to include an explicit return type and explicit type for the optional parameter: keep blobStorage: InMemoryBlobStorage and expectedMapperKeysCount: number as-is, add expectedNumberOfFeatureFlags: number (explicitly typed) and annotate the function to return Promise<void>; modify the function declaration (assertMapperContentIsCorrect) accordingly so it satisfies the repo’s TypeScript explicit-typing rule.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@controlplane/test/test-util.ts`:
- Around line 891-895: Update the helper function signature for
assertMapperContentIsCorrect to include an explicit return type and explicit
type for the optional parameter: keep blobStorage: InMemoryBlobStorage and
expectedMapperKeysCount: number as-is, add expectedNumberOfFeatureFlags: number
(explicitly typed) and annotate the function to return Promise<void>; modify the
function declaration (assertMapperContentIsCorrect) accordingly so it satisfies
the repo’s TypeScript explicit-typing rule.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 64394ebc-4506-4c68-b91f-ed62470bbde0
📒 Files selected for processing (2)
controlplane/test/feature-flag/feature-flag-integration.test.tscontrolplane/test/test-util.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2854 +/- ##
==========================================
- Coverage 65.01% 64.38% -0.63%
==========================================
Files 573 317 -256
Lines 71938 44985 -26953
Branches 4862 4862
==========================================
- Hits 46767 28964 -17803
+ Misses 23724 15996 -7728
+ Partials 1447 25 -1422 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.
The goal of this PR is to add tests to ensure that the contents of the generated mapper.json file is correct.