Skip to content

CI: artifact build compiles frontend and backend modules the WAR never contains #36945

Description

@wezell

Problem

The Initial Artifact Build is the serial prefix of every PR run — all ~25 test jobs wait on it. It takes ~14.2m, of which ~7.0m is Maven. A large share of that builds things the dotCMS WAR never contains.

Frontend

core-web runs nx run-many -t build across the whole workspace (2.85m). But the WAR's webResources block lists exactly five paths:

dist/apps/dotcms-ui                    -> dotAdmin
dist/libs/dotcms-webcomponents/dist
dist/apps/dotcms-binary-field-builder
dist/apps/dotcms-block-editor
dist/libs/sdk/analytics-standalone     (its own `build-analytics` execution)

Everything else — sdk-*, ai-evals, dotcdn — is built and discarded. Both SDK publishers (deploy-javascript-sdk, publish-sdk-next) start from a clean checkout and rebuild sdk-* themselves; deploy-javascript-sdk even passes --skip-nx-cache.

This costs twice, because the execution is bound to the compile phase:

  • the serial artifact build, and
  • the 33m Frontend Unit Tests job, where mvn test -pl :dotcms-core-web runs compile first — so that job is dominated by a full workspace build before nx affected -t test runs at all.

Backend

clean install at the root builds all 24 modules unconditionally, including ones the image cannot contain:

 32.7s  dotcms-integration     then recompiled by all 7 IT shards anyway
 22.9s  dotcms-api-data-model  CLI
 17.6s  dotcms-cli             CLI
  7.4s  dotcms-postman
  6.6s  dotcms-ui-e2e
  1.3s  dotcms-test-karate
------
 1.48m of the 7.0m reactor (21%)

The CLI is 40.5s of every build and is doubly redundant: the CLI Tests job runs verify -pl :dotcms-api-data-model,:dotcms-cli, which recompiles those sources itself — and CLI tests are already gated behind the cli_test filter, so most PRs never run them.

Scope

  • Narrow the frontend build to the projects the WAR contains
  • Trim the Maven reactor so the artifact build skips test-only and CLI modules

Out of scope

Remote caching (nx or WAR-level reuse across PRs) — tracked separately; it needs a storage decision.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions