Spec change breaks main pipeline build
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 267
- Avg merge
- 1d 25m
- Merged PRs (30d)
- 14
Description
### Describe the bug
Whenever we make change sto the `@jsii/spec`, the main build CodePipeline breaks.
The reason is that the pipeline build does a call to `./scripts/align-version.sh`, which changes the local version of `@jsii/spec` from `0.0.0` to `1.113.0` (or whatever the number is), and also all local dependencies on it.
After that, a regular TypeScript compilation call will (sometimes?) pick up the **types of the publicly published version** with that same name, even if the local `node_modules` directories haven't changed.
We need to investigate why this happens and what we do about it, next time that we need to change something in `@jsii/spec`.
## Symptoms
```
jsii-pacmak: ·[1Gjsii-pacmak:
--
jsii-pacmak: $ yarn gen && tsc --build && chmod +x bin/jsii-pacmak && yarn lint
jsii-pacmak:
jsii-pacmak: ·[1Gjsii-pacmak:
jsii-pacmak: $ bash generate.sh
jsii-pacmak: lib/rosetta-assembly.ts(2,10): error TS2305: Module '"@jsii/spec"' has no exported member 'JsiiFeature'.
jsii-pacmak: lib/rosetta-assembly.ts(22,26): error TS2339: Property 'usedFeatures' does not exist on type 'Assembly'.
jsii-pacmak: lib/rosetta-assembly.ts(23,6): error TS7006: Parameter 'f' implicitly has an 'any' type.
```
Contributor guide
Research direction
Start with scripts/align-version.sh and generate.sh, then reproduce the failure with yarn gen followed by tsc --build. Compare how the local @jsii/spec version and its types are resolved after alignment, including the errors in lib/rosetta-assembly.ts. Done means the main CodePipeline build compiles successfully after an @jsii/spec change without selecting incompatible published types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell, typescript
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100