J4 / UPGRADES
← All practice results

p2-12-angular

Public GitHub evidence ↗

# p2-12-angular — Batch 4 result: RED (stopped early at screening)

Source: stefanoslig/angular-ngrx-nx-realworld-example-app @ c240b862cee57e75fb3588ad429ebe602e721c5c (Angular 20.3.9, pre "migrate to angular v21" commits).
Owned fork: https://github.com/j4groupfounders/j4-p2d-angular
Framework target: Angular 20.3.9 -> 21.0.6, replaying the project's own "chore: migrate to angular v21" commit (21e4d7ff, parent 32843b82 confirmed to already be v21 — the real v20 state is this repo's `c240b862`).

## Outcome
**RED, stopped early** — no genuinely trustworthy green screening run was reached in 8 CI runs (budget cap 12). Each fix revealed a deeper issue:
1. `npm ci` failed: `@ngrx/signals@20.1.0` peer-conflicted with a resolved `@angular/core@20.3.33` the lockfile pulled in from elsewhere (root package.json declares an exact `20.3.9`).
2. `--legacy-peer-deps` unblocked install, but `@analogjs/vitest-angular`'s setup file unconditionally imports `zone.js`, which is not declared anywhere in this (signals-based, zoneless) app's devDependencies — added as an explicit devDependency (test-infra-only baseline repair, itemised).
3. The first zone.js pin (0.16.3) conflicted with `@angular/core@20.3.9`'s actual peer range (`~0.15.0`); corrected to `~0.15.1`.
4. A run then appeared green (`37579621908`), but closer inspection showed the "Project tests" step's `nx test | tee` pipeline reported "success" while the underlying `nx test conduit` had actually **failed** (`Cannot find module '@angular/build/private'`) — the job's default bash shell is `-e {0}}`, not `-o pipefail`, so `tee`'s own exit code masked the real failure. This is a harness bug, not an app issue; fixed with explicit `set -o pipefail` plus pinning `@angular/build` (previously only an optional peer, required unconditionally by `@analogjs/vite-plugin-angular`'s devkit utility).
5. With pipefail correctly surfacing failures, the real remaining error is `Unexpected "NavbarComponent2" found in the "declarations" array ... is marked as standalone` — a TestBed/Angular-compiler error that does not correspond to any file in this repository (no `NavbarComponent2` exists). This points to **multiple, inconsistent copies of `@angular/core` being resolved simultaneously** in node_modules, most plausibly caused by this workspace's dependency on `@nx/angular@22.4.0-beta.0` (a pre-release Nx version) interacting badly with `npm install`'s non-deterministic resolution once the lockfile had already drifted from steps 2-4.
8 CI runs total; **8.8 actual job-minutes**. No paid services/model API calls, no upstream contact, no human edits to application/test source — only devDependency pins (`zone.js`, `@angular/build`) and CI-script fixes (pipefail, legacy-peer-deps toggling). A J4-added component characterization spec (`apps/conduit/src/app/j4.characterize.spec.ts`, footer/navbar render snapshot) was committed as a harness-only addition but never exercised against a trustworthy green run.

## Batch 5 handoff
- Root cause is a beta-channel toolchain dependency (`@nx/angular`/`nx@22.4.0-beta.0`), not Angular itself. Either (a) pin a stable Nx release on this fork before upgrading, regenerating a consistent lockfile with `npm install` once and committing it so later `npm ci` is deterministic, or (b) pick a different Angular pilot repo that is not on a pre-release Nx line.
- Keep the pipefail finding: any future workflow step piping to `tee` needs `set -o pipefail` or it will silently misreport pass/fail.
- Mutation list prepared but unexercised: `j4_mutations.json` in this directory (footer logo/attribution text, navbar sign-in/sign-up/home labels), paired with the committed characterization spec.