refactor(build): readonly-domain-types (stack 6/12, re-split #307) - #379
refactor(build): readonly-domain-types (stack 6/12, re-split #307)#379YosefHayim wants to merge 1 commit into
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(build): adapt build pipeline to readonly domain types
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
|
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 |
Code Review by Qodo
1. Readonly envExclude type mismatch
|
| cliEnv?: Record<string, string> | undefined; | ||
| includeLocal?: boolean | undefined; | ||
| envExclude?: string[] | undefined; | ||
| envExclude?: readonly string[] | undefined; |
There was a problem hiding this comment.
1. Readonly envexclude type mismatch 🐞 Bug ≡ Correctness
resolveCommandEnv/validateResolvedEnv now accept readonly string[] but forward those values into resolveEnv/missingKeys, which still require mutable string[], causing TypeScript assignability errors at the call sites.
Agent Prompt
### Issue description
`src/core/build/pipelineEnv.ts` now types `envExclude`/`exclude` as `readonly string[]`, but the env helper APIs it calls still require mutable `string[]` (`resolveEnv` and `missingKeys`). This creates a TS assignability failure because `readonly string[]` is not assignable to `string[]`.
### Issue Context
The helper implementations appear to only iterate over the patterns and do not mutate them, so they can safely accept `readonly string[]`.
### Fix Focus Areas
- src/core/config/env.ts[46-55]
- src/core/config/env.ts[64-79]
- src/core/config/env.ts[133-142]
- src/core/build/pipelineEnv.ts[96-123]
- src/core/build/pipelineEnv.ts[133-141]
### Suggested fix
- Change `isEnvExcluded(name, patterns)` to accept `readonly string[]`.
- Change `missingKeys(..., excludedPatterns)` to accept `readonly string[]`.
- Change `ResolveEnvInput.envExclude` to `readonly string[] | undefined` and adjust any internal locals accordingly.
- Keep the pipeline call sites passing `config.envExclude` / `input.envExclude` directly (no copies needed).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| app: AppDescriptor, | ||
| bundleId: string, | ||
| extensions: string[], | ||
| extensions: readonly string[], |
There was a problem hiding this comment.
2. Readonly extensions type mismatch 🐞 Bug ≡ Correctness
warnUnreadySigningTargets now types extensions as readonly string[] but passes it to gatherTargetSigningReadiness, which still expects mutable string[], causing a TypeScript assignability error.
Agent Prompt
### Issue description
`src/core/build/pipelineSigning.ts` changed `warnUnreadySigningTargets(..., extensions)` to `readonly string[]`, but it forwards `extensions` directly into `gatherTargetSigningReadiness`, whose signature still requires `string[]`. This is a TS assignability failure.
### Issue Context
`gatherTargetSigningReadiness` only maps over `extensions` and does not mutate it, so it can safely accept `readonly string[]`.
### Fix Focus Areas
- src/core/build/pipelineSigning.ts[118-133]
- src/core/credentials/signingPreflight.ts[59-69]
### Suggested fix
- Update `gatherTargetSigningReadiness` signature to `extensions: readonly string[]`.
- Ensure any internal uses (e.g. `extensions.map(...)`) remain valid.
- Avoid fixing this by copying at the call site unless the callee truly needs mutation.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Superseded by land of tip stack #386 (same 12 domain commits). |
Stack 6/12 of re-split HOLD #307
Domain:
buildBase:
refactor/types/readonly-stack-05-storeFull green tip:
refactor/foundation/readonly-types-fullLand stack in order. Intermediate PRs may not typecheck alone.
Summary by cubic
Make the build module readonly-first to prevent accidental mutation and tighten API contracts. No runtime behavior changes; this is a types-only refactor.
MutableDeepfor values we intentionally build up (app, buildContext, Android release, allocate request); now use copies when extending objects/arrays.app, env, iOS entitlements/extensions) while keeping inputs readonly.selectApp, account picker, extension bundle IDs).Written for commit a6be215. Summary will update on new commits.