The PR Check workflow step "Check for changes to source during build" (in .github/workflows/cicd_comp_build-phase.yml) runs git status --porcelain after the Maven build. If any file in the working tree is modified or added, the step fails.
The file that was causing the failure: core-web/libs/dotcms-webcomponents/src/components.d.ts.
-
The check step is not new
It was added in July 2024 (commitc6c0834c, PR #29137) to protect against the initial build modifying source files that are not committed. -
What changed recently
- main has
components.d.tscommitted with imports using the package path:
from "@dotcms/dotcms-models". - After the PrimeNG v21 / Angular 21 migration (e.g. #34388, Jan 2026), the Stencil compiler in this repo generates
components.d.tswith relative paths:
from "../../dotcms-models/src/index". - So when CI runs the full Maven build, Stencil regenerates
components.d.tsin place. The generated content (path style, and possibly formatting/order) no longer matches the committed version, sogit statussees a modification and the step fails. - On main, the committed file either matched what Stencil produced at that time, or the build path/tsconfig was such that the file was not regenerated differently. The branch’s path resolution / build setup makes the generated file differ from the one in git.
- main has
-
Summary
The step did not change; the build output forcomponents.d.tsdid (path resolution / Angular 21 / Nx context). So the same protection step that has been there since July 2024 now fails on this branch because one generated file is always “modified” after the build.
-
.gitignore
Added:
/core-web/libs/dotcms-webcomponents/src/components.d.ts -
Stop tracking
The file was removed from the index withgit rm --cachedso it is no longer tracked. It is still generated on disk by Stencil during the build.
Why this is acceptable
- The published types for the package come from the build output, not from
src/: incore-web/libs/dotcms-webcomponents/package.json,"types"points to
"../../dist/libs/dotcms-webcomponents/dist/types/components.d.ts".
So consumers and the rest of the monorepo use the built types. - The copy in
src/is generated by Stencil for the compiler’s own use. Not tracking it avoids the CI failure when the generated content differs from a previously committed version. - Stencil’s docs suggest committing
components.d.tsfor type safety and build order; in this repo, types are provided viadistand path aliases intsconfig.base.json, so ignoring the generated file insrc/is a reasonable trade-off to keep CI green without changing the public contract of the library.
- Making the generated file deterministic (e.g. so Stencil always emits
@dotcms/dotcms-modelsinstead of relative paths) would require Stencil/tsconfig changes and may not be fully under our control. The.gitignoreapproach is the one applied.
- Workflow:
.github/workflows/cicd_comp_build-phase.yml(step “Check for changes to source during build”). - Failing run (example): https://github.com/dotCMS/core/actions/runs/21871377611
- Stencil generated file:
core-web/libs/dotcms-webcomponents/src/components.d.ts(autogenerated, now ignored and untracked).