refactor(readiness): readonly-domain-types (stack 10/12, re-split #307) - #383
Conversation
|
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
PR Summary by QodoRefactor readiness stack: adopt readonly domain types across migrate/plan/snapshot
AI Description
Diagram
High-Level Assessment
Files changed (34)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
1 issue found across 34 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/core/snapshot/sources/appleListing.ts">
<violation number="1" location="src/core/snapshot/sources/appleListing.ts:52">
P3: This new `isJsonObject` type guard is byte-for-byte identical to the `isJsonRecord` guard being added in `src/core/snapshot/sources/playRestore.ts` (same body: typeof-object, null, Array.isArray checks, same `Readonly<{ [key: string]: JsonValue }>` predicate, added in this same batch). Both files now maintain duplicate narrowing logic. Since `playRestore.ts` already exports narrow-useful helpers (`jsonRecord`, `stringField`) and `appleListing.ts` has its own `fieldString`, this guard could live once in a shared module (or appleListing could reuse `jsonRecord`) so the two sources don't drift if the JsonValue shape or the guard's null/array handling ever changes.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| .map(([locale, fields]) => toEntity(locale, fields)); | ||
| }); | ||
| /** Narrow a captured {@link JsonValue} to a plain object (rejecting arrays and null). */ | ||
| const isJsonObject = ( |
There was a problem hiding this comment.
P3: This new isJsonObject type guard is byte-for-byte identical to the isJsonRecord guard being added in src/core/snapshot/sources/playRestore.ts (same body: typeof-object, null, Array.isArray checks, same Readonly<{ [key: string]: JsonValue }> predicate, added in this same batch). Both files now maintain duplicate narrowing logic. Since playRestore.ts already exports narrow-useful helpers (jsonRecord, stringField) and appleListing.ts has its own fieldString, this guard could live once in a shared module (or appleListing could reuse jsonRecord) so the two sources don't drift if the JsonValue shape or the guard's null/array handling ever changes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/snapshot/sources/appleListing.ts, line 52:
<comment>This new `isJsonObject` type guard is byte-for-byte identical to the `isJsonRecord` guard being added in `src/core/snapshot/sources/playRestore.ts` (same body: typeof-object, null, Array.isArray checks, same `Readonly<{ [key: string]: JsonValue }>` predicate, added in this same batch). Both files now maintain duplicate narrowing logic. Since `playRestore.ts` already exports narrow-useful helpers (`jsonRecord`, `stringField`) and `appleListing.ts` has its own `fieldString`, this guard could live once in a shared module (or appleListing could reuse `jsonRecord`) so the two sources don't drift if the JsonValue shape or the guard's null/array handling ever changes.</comment>
<file context>
@@ -48,8 +48,20 @@ const captureListing = (
.map(([locale, fields]) => toEntity(locale, fields));
});
+/** Narrow a captured {@link JsonValue} to a plain object (rejecting arrays and null). */
+const isJsonObject = (
+ capturedNode: JsonValue,
+): capturedNode is Readonly<{ [key: string]: JsonValue }> => {
</file context>
|
Superseded by land of tip stack #386 (same 12 domain commits). |
User description
Stack 10/12 of re-split HOLD #307
Domain:
readinessBase:
refactor/types/readonly-stack-09-releaseFull green tip:
refactor/foundation/readonly-types-fullLand stack in order. Intermediate PRs may not typecheck alone.
Summary by cubic
Adopts read-only types across readiness, migrate, plan, and snapshot modules to improve immutability and type safety. Updates APIs to accept readonly collections, uses
MutableDeepfor internal builders, and hardens snapshot JSON parsing.runPlanners), readiness probes/scopes, migrate commands/tests, snapshot orchestrator/commands/sources.MutableDeep<...>when constructing objects (Fastlane/EAS parsers, Play product mapping) to satisfy read-only models.Schema.mutable), added JSON guards (isJsonObject/isJsonRecord) and readonly field helpers; replaced filter+type-guard withflatMapto drop nulls.readFastlaneSetupto build results without mutation.Written for commit 55007a4. Summary will update on new commits.
CodeAnt-AI Description
Strengthen readiness, planning, migration, and snapshot data handling
What Changed
Impact
✅ Safer snapshot restores✅ Complete Fastlane migration details✅ Fewer failures when processing read-only configuration💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.