Skip to content

Align Gradle lifecycle tasks and use Yarn-managed UI tooling - #3545

Open
wborn wants to merge 10 commits into
mainfrom
fix/gradle-lifecycle-and-yarn-tooling
Open

wborn wants to merge 10 commits into
mainfrom
fix/gradle-lifecycle-and-yarn-tooling

Conversation

@wborn

@wborn wborn commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Description

  • Integrate backend artifacts, UI bundles, component manifests, generated sources, and setup JARs into assemble
  • Make check include backend and UI tests, Spotless, dependency checks, and translation validation. Preserve the standard build = assemble + check lifecycle
  • Keep installDist responsible for preparing the runnable manager distribution and deployment Docker build context
  • Add targeted Gradle tasks for backend unit tests (testBackendUnit), backend integration tests (testBackendIntegration), UI component tests (testUiComponent), and UI app tests (testUiApp)
  • Aggregate tests through testBackend, testUi, and test, preserving execution order while allowing test groups to run independently
  • Update CI workflows to use the targeted test tasks, including testBackendUnit and testBackendIntegration for custom projects and testBackend in the legacy CI/CD workflow
  • Generate unit test reports for all projects in the unit-test workflow
  • Keep module-level UI test tasks named npmTest, consistent with npmBuild
  • Automatically prepare UI test dependencies: required distributions for app tests, and generated TypeScript sources and icon fonts for component tests. Allow CI to reuse prepared artifacts with -PreuseUiTestArtifacts=true
  • Fail early before UI test preparation when Playwright Chromium is unavailable, with instructions to run ./gradlew :ui:test:installBrowsers
  • Check PostgreSQL and Keycloak readiness only for backend integration and Manager UI app tests, allowing up to 30 seconds for startup and reporting the Compose startup command on failure
  • Run explicitly requested browser installation before verification and support the Chromium headless shell artifacts restored by CI
  • Extract shared test execution, reporting, and coverage configuration into testing.gradle, with service readiness checks implemented as a buildSrc task
  • Centralize UI source-generation dependencies and reuse the root Yarn installation
  • Coordinate parallel UI npmBuild and npmTest tasks using shared Gradle resources to prevent concurrent writes to overlapping TypeScript outputs while allowing independent builds to run in parallel
  • Track TypeScript project references as configuration inputs to ensure correct task coordination when reusing Gradle's configuration cache
  • Replace direct npx execution in the Knip, browser-installation, and TypeScript-watch Gradle tasks with Yarn-managed tooling
  • Support Knip 6.43.0 by handling Rsbuild configurations statically, declaring public-type dependencies, and accommodating checks before build artifacts exist
  • Make Knip wait for scheduled source generation, UI builds, and tests without introducing additional dependencies for standalone checks
  • Add Knip regression tests covering configuration analysis and published declaration dependencies
  • Add UI task coordination regression tests covering overlapping compiler outputs, independent parallel builds, Knip ordering, browser installation before verification, standalone checks, and configuration-cache reuse
  • Expose the regression tests through testKnip and testUiLocks, with corresponding Yarn scripts test:knip and test:ui-locks, and include them in the verification lifecycle
  • Replace translation generation and Git-status shell checks in CI with non-mutating checkTranslations validation
  • Update developer documentation with lifecycle commands, targeted test execution, test prerequisites, and parallel UI task coordination

Related to #3150
Closes #3344
See also openremote/custom-project#99

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

@wborn
wborn requested a review from Ekhorn November 4, 2026 11:57

@Ekhorn Ekhorn left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall changes look good. I'll add a comment on the Knip declaration dependencies list, once I've done more testing and I'll do an AI review.

Comment thread AGENTS.md Resolved
Comment thread yarn.lock Resolved
Comment thread README.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Parallel build tasks can race on shared TypeScript outputs and let Knip inspect partially emitted declarations, risking inconsistent artifacts and false failures on clean builds.

2 open issues
What changed in this PR

This PR aligns OpenRemote’s Gradle lifecycle with standard build and verification commands while moving shared UI tooling under Yarn management.

Changes:

  • Integrates artifact generation into assemble and verification into check, with explicit test ordering.
  • Adds Yarn-managed Knip execution, compatibility configuration, regression tests, and public-type dependencies.
  • Introduces non-mutating translation checks and documents standard developer commands.
File Description
yarn.lock Records Knip, public-type dependencies, and updated resolutions.
ui/​util/​test/​knip.test.mjs Adds configuration and declaration-dependency regression tests.
ui/​util/​package.json Adds the Knip regression test script.
ui/​test/​fixtures/​component.ts Makes the component hooks interface internal.
ui/​test/​build.gradle Reuses root Yarn installation for test tooling.
ui/​knip.ts Adds static Rsbuild analysis and pre-build dependency exemptions.
ui/​knip.jsonc Removes the superseded Knip configuration.
ui/​component/​theme/​build.gradle Uses the shared lifecycle clean task.
ui/​component/​rest/​package.json Declares the model dependency for public types.
ui/​component/​rest/​build.gradle Uses centralized generation and assembly wiring.
ui/​component/​or-vaadin-components/​build.gradle Removes redundant clean and analysis-install tasks.
ui/​component/​or-tree-menu/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-translate/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-services/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-scheduler/​package.json Declares i18next for public types.
ui/​component/​or-scheduler/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-rules/​package.json Declares dependencies exposed by public types.
ui/​component/​or-rules/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-rive-renderer/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-mwc-components/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-map/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-log-viewer/​package.json Declares i18next for public types.
ui/​component/​or-log-viewer/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-json-forms/​package.json Declares i18next for public types.
ui/​component/​or-json-forms/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-icon/​build.gradle Separates font preparation and attaches it to assembly.
ui/​component/​or-gauge/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-element/​build.gradle Uses the shared lifecycle clean task.
ui/​component/​or-dashboard-builder/​package.json Declares i18next for public types.
ui/​component/​or-dashboard-builder/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-components/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-chart/​package.json Declares i18next for public types.
ui/​component/​or-chart/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-attribute-picker/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-attribute-input/​package.json Declares i18next for public types.
ui/​component/​or-attribute-input/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-attribute-history/​package.json Declares i18next for public types.
ui/​component/​or-attribute-history/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​or-attribute-card/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-attribute-barchart/​build.gradle Uses the shared lifecycle clean task.
ui/​component/​or-asset-viewer/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-asset-tree/​build.gradle Moves lifecycle handling to shared configuration.
ui/​component/​or-app/​package.json Declares i18next and Redux for public types.
ui/​component/​or-app/​build.gradle Removes redundant lifecycle tasks.
ui/​component/​model/​build.gradle Relies on centralized source-generation wiring.
ui/​component/​core/​build.gradle Adds a Yarn-backed compilation task.
ui/​build.gradle Centralizes UI lifecycle, generation, and Knip tasks.
ui/​app/​shared/​build.gradle Adds non-mutating translation validation and font dependencies.
ui/​app/​manager/​package.json Declares dependencies exposed by public types.
ui/​app/​manager/​build.gradle Prepares distributions for lifecycle-driven app tests.
ui/​AGENTS.md Documents shared UI lifecycle conventions.
setup/​build.gradle Includes setup JARs in assembly.
README.md Documents lifecycle commands and test prerequisites.
project.gradle Runs TypeScript watch through root Yarn tooling.
package.json Declares Knip and adds execution scripts.
build.gradle Aggregates assembly, verification, and ordered tests.
AGENTS.md Updates build and test guidance.
.github/​workflows/​ui-check-outdated-translations.yml Uses non-mutating translation validation.
.github/​workflows/​ci_cd.yml Uses Yarn-managed Knip and translation validation.

Review effort: Balanced

Comment thread ui/build.gradle Resolved
Comment thread ui/build.gradle Resolved
@Ekhorn
Ekhorn self-requested a review November 4, 2026 16:43
@wborn
wborn force-pushed the fix/gradle-lifecycle-and-yarn-tooling branch 2 times, most recently from 4f0e132 to 3e5eb0c Compare November 11, 2026 16:09
- Integrate backend artifacts, UI bundles, component manifests, generated sources, and setup JARs into `assemble`
- Make `check` include backend and UI tests, Spotless, dependency checks, and translation validation. Preserve the standard `build = assemble + check` lifecycle
- Keep `installDist` responsible for preparing the runnable manager distribution and deployment Docker build context
- Make test aggregation explicit: backend unit tests, integration tests, UI component tests, then UI app tests. Preserve independently runnable tasks for selective CI execution
- Centralize UI source-generation dependencies and reuse the root Yarn installation
- Replace direct `npx` execution in the Knip, browser-installation, and TypeScript-watch Gradle tasks with Yarn-managed tooling
- Support Knip 6.43.0 by handling Rsbuild configurations statically, declaring public-type dependencies, and accommodating checks before build artifacts exist
- Add Knip regression tests covering configuration analysis and published declaration dependencies
- Replace translation generation and Git-status shell checks in CI with non-mutating `checkTranslations` validation
- Update developer documentation with lifecycle commands, test aggregation, and targeted verification commands

Related to #3150
Closes #3344
- Add `testBackendUnit` and `testBackendIntegration` for separate backend test runs
- Add `testUiComponent` and `testUiApp` for separate UI test runs
- Compose these groups through `testBackend`, `testUi`, and `test`, preserving execution order
- Keep module-level UI tasks named `npmTest`, consistent with `npmBuild`
- Update CI commands while preserving compatibility with custom projects
- Document test commands and prerequisites in README and AGENTS files
- Coordinate `npmBuild` and `npmTest` tasks with shared Gradle resources to prevent concurrent writes to overlapping TypeScript outputs
- Preserve parallel execution for independent reference graphs and manifest analysis
- Make Knip wait for scheduled source generation, builds, and tests while keeping standalone checks independently runnable
- Track TypeScript reference changes so configuration-cache reuse preserves correct locking
- Add regression tests for compiler locking, independent parallel builds, Knip ordering, standalone checks, and configuration-cache invalidation
- Expose the locking tests through `testUiLocks` and `test:ui-locks`, and rename the Knip test script to `test:knip`
- Document why coordination is necessary and how locking affects test parallelism
@wborn
wborn force-pushed the fix/gradle-lifecycle-and-yarn-tooling branch from 3e5eb0c to 91b4d31 Compare November 11, 2026 16:11
- Automatically prepare required distributions for UI app tests
- Prepare generated TypeScript sources and fonts for component tests without unnecessary Manager builds
- Allow CI to reuse existing build artifacts with -PreuseUiTestArtifacts=true
- Update documentation and add tests for dependency preparation and artifact reuse
@wborn
wborn force-pushed the fix/gradle-lifecycle-and-yarn-tooling branch from 0811c0a to 5225e6c Compare November 12, 2026 08:27
- Require testBackendUnit and testBackendIntegration in reusable workflows
- Use testBackend in the legacy CI/CD workflow
- Remove the Core-only condition from the unit-test workflow
@wborn
wborn marked this pull request as ready for review November 12, 2026 10:20
@wborn
wborn requested a review from a team November 12, 2026 10:20
- Check Playwright Chromium before preparing UI tests
- Verify PostgreSQL and Keycloak readiness for backend integration and Manager UI tests
- Run explicitly requested browser installation before verification
- Extract shared test, reporting, and coverage configuration into testing.gradle
- Update prerequisite documentation and add browser setup ordering regression coverage
- Order UI cleanup before compilation and packaging
- Accept commented TypeScript configs with trailing reference commas
- Simplify backend coverage and unit test reporting filters
- Add regression tests for packaging output and compiler coordination
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align Gradle lifecycle tasks with standard conventions

3 participants