refactor(types): readonly domain types full stack (replaces #307) - #386
Conversation
|
|
Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters. If you still want a review, comment |
PR Summary by Qodorefactor(types): enforce readonly domain types across the full stack
AI Description
Diagram
High-Level Assessment
Files changed (133)
|
|
Important Review skippedToo many files! This PR contains 132 files, which is 32 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (132)
You can disable this status message by setting the 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 |
Code Review by Qodo
1. BuildEngine not in types.ts
|
| export type CredentialsProvider = Readonly<{ | ||
| readonly name: string; | ||
| resolveBuildCredentials( | ||
| buildContext: ResolvedBuildContext, |
There was a problem hiding this comment.
1. buildengine not in types.ts 📘 Rule violation ⌂ Architecture
Provider interface/types like CredentialsProvider and BuildEngine are (re)defined in src/core/types/providers.ts rather than being defined in src/core/types.ts as required, which undermines the single canonical import surface for core provider shapes.
Agent Prompt
## Issue description
Core provider shapes (`CredentialsProvider`, `BuildEngine`, etc.) are defined in `src/core/types/providers.ts`, but compliance requires these domain/provider interface definitions to live in `src/core/types.ts`.
## Issue Context
This PR refactors types to readonly, but it also leaves the provider interface/type definitions outside the mandated `src/core/types.ts` location.
## Fix Focus Areas
- src/core/types/providers.ts[35-61]
- src/core/types.ts[1-200]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| /** A registered Bundle ID resource (an App ID in the Developer portal). */ | ||
| export type BundleIdResource = { | ||
| export type BundleIdResource = Readonly<{ | ||
| id: string; | ||
| identifier: string; |
There was a problem hiding this comment.
2. bundleidresource in core types 📘 Rule violation ⌂ Architecture
App Store Connect *Resource types are defined/maintained in src/core/types/appleCatalog.ts instead of src/apple/ascClient.ts, which violates the required placement for ASC resource/query shapes.
Agent Prompt
## Issue description
ASC `*Resource` types (e.g., `BundleIdResource`, `CertificateResource`) are located in `src/core/types/appleCatalog.ts`, but compliance requires ASC Resource/Query types to live in `src/apple/ascClient.ts`.
## Issue Context
This PR updates these types to be `Readonly`, but it keeps them in a core types module rather than the ASC client module.
## Fix Focus Areas
- src/core/types/appleCatalog.ts[7-33]
- src/apple/ascClient.ts[1-140]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Re-split replacement for HOLD #307. 12 domain commits on one green tip.
Domains: types → apple → google → providers → store → build → credentials → config → release → readiness → services → cli-agents.
Stack PRs also opened as
readonly-stack-01…12for domain review. This tip PR is the landable unit.Supersedes
Closes #307.
Test plan
Summary by cubic
Refactored the codebase to use readonly domain types end-to-end and introduced a
MutableDeephelper for safe, local mutation during object construction. Updated APIs to accept/return readonly data for clearer intent and fewer accidental mutations, with no runtime behavior changes.Refactors
Schema.mutablewrappers.MutableDeepand applied it when building objects (e.g., config, build context, credentials, listings).readonlyarrays/maps across CLI, build, credentials, store, snapshot, release, and services.Migration
readonlyarrays to functions (e.g., useas constor avoid mutating inputs).MutableDeep<...>.Written for commit d0c226d. Summary will update on new commits.