Skip to content

fix: install pnpm deps in hoisted mode + declare @babel/types (#24288) (CP: 25.1)#24295

Merged
ZheSun88 merged 2 commits into25.1from
fix-it-2-25.1
May 8, 2026
Merged

fix: install pnpm deps in hoisted mode + declare @babel/types (#24288) (CP: 25.1)#24295
ZheSun88 merged 2 commits into25.1from
fix-it-2-25.1

Conversation

@vaadin-bot
Copy link
Copy Markdown
Collaborator

Cherry-pick of #24288 (commit d9290f8) from main to 25.1.

Summary

Same fix as #24288: switches pnpm install to hoisted (flat npm-style)
layout so transitive npm deps (@babel/types, @lit/reactive-element,
cookie, set-cookie-parser, @preact/signals-react/runtime) are
always reachable from project root, eliminating the vite-basics IT
hang and similar symptoms.

Adjustments for 25.1

The cherry-pick required two small adjustments to match this branch's
dep graph:

  1. @babel/types pinned to 7.28.5 (matching @babel/preset-react
    already in vite/package.json) instead of main's 7.29.0. 25.1
    does not declare @babel/core, so version coherence is anchored to
    preset-react.

  2. Skipped @babel/core and @babel/plugin-transform-react-jsx-development
    declarations from the main commit. These are not declared as direct
    deps on 25.1, and the React function location plugin
    (flow-build-tools/.../react-function-location-plugin.js) only
    imports @babel/types.

Everything else is identical:

  • flow-server/.../npmrc: adds node-linker=hoisted.
  • flow-build-tools/.../FrontendTools.java: replaces
    --shamefully-hoist=true CLI flag with --config.node-linker=hoisted.
  • NodeUpdaterTest, TaskRunPnpmInstallTest, FrontendToolsTest
    updated to match.

Test plan

  • CI on this PR passes (specifically it-tests (1) and it-tests (2)).
  • mvn -pl flow-build-tools test -Dtest=NodeUpdaterTest,TaskRunPnpmInstallTest,FrontendToolsTest passes.
  • After install in any vite-using IT module, node_modules/.pnpm/ does not exist (or is empty); node_modules/@babel/types/ and node_modules/@lit/reactive-element/ exist as real directories at the project root.

🤖 Generated with Claude Code

… (CP: 25.1)

Cherry-pick of d9290f8 from main.

Adjusted for 25.1's dep-graph: @babel/types is pinned to 7.28.5 to
match @babel/preset-react's version on this branch (main pins to
7.29.0 to match @babel/core which is not declared on 25.1).
@babel/core and @babel/plugin-transform-react-jsx-development from the
main commit are not added — they are not declared as direct deps on
25.1 and the React function location plugin only imports @babel/types.

The .npmrc and FrontendTools changes that switch pnpm to hoisted mode
apply unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the +0.0.1 label May 8, 2026
@vaadin-bot
Copy link
Copy Markdown
Collaborator Author

This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR [Message is sent from bot]

## Summary

Validation runs occasionally lose ~30 minutes on `it-tests (11, ...)`
because
the step runs to the job timeout instead of finishing — costing a full
re-run
  attempt to produce green. Example:
https://github.com/vaadin/flow/actions/runs/25435931074/job/74614298073
  (attempt 1 cancelled at 30:00, attempt 2 succeeded.)

  ## Current behavior (root cause)

  The `flow-test-redeployment` module starts its app via
`spring-boot-maven-plugin:start` (pre-IT) and stops it via `:stop`
(post-IT).
Spring DevTools is on the classpath and the test churns class files
(touching
`Application.class` to trigger reloads), which in this run produced **8
DevTools-driven restarts in 20 seconds**, the last firing 442 ms before
  `spring-boot:stop` ran:

  12:47:56.241 [File Watcher] Restarting due to 1 class path change ...
  12:47:56.683 [INFO] --- spring-boot-maven-plugin:4.1.0-RC1:stop ...
  [ERROR] Spring application lifecycle JMX bean not found.
          Could not stop application gracefully:
          org.springframework.boot:type=Admin,name=SpringApplication

`stop` queries the admin MBean exactly once and there is no retry;
during a
restart the bean is briefly unregistered, so the call fails. The forked
Spring Boot JVM (PID 3969 in this run) is therefore **never killed**.
Maven
  moves on under `-fae`, finishes 16 more modules, and exits with BUILD
FAILURE — but the orphan JVM still holds the write end of the pipe
inherited
from `mvn ... | tee -a mvn-it-tests-11.out`
(`.github/workflows/validation.yml`).
  `tee` cannot reach EOF, the bash pipeline cannot complete, and the job
  hangs until GitHub force-cancels at the 30-min job timeout. The runner
cleanup confirms the orphan: `Terminate orphan process: pid (3969)
(java)`.

  ## Fix

  Two small, independent changes:

1. **`flow-tests/test-redeployment/pom.xml`** — insert a
maven-antrun-plugin
      execution bound to post-integration-test (declared before 
spring-boot-maven-plugin so it runs first in that phase) that sleeps 5
seconds
before spring-boot:stop runs. This module's tests deliberately trigger
DevTools
restarts; the original failure was a 442 ms race between the last
restart and
stop-server querying the admin JMX bean. The 5-second quiet period lets
DevTools finish re-registering the bean so stop-server can shut the app
down
      cleanly instead of leaving an orphan JVM behind.

2. **`.github/workflows/validation.yml`** — add `timeout-minutes: 22` on
the
`Run ITs` step (the job-level 30-min cap stays as the outer fence). If a
future plugin produces a similar shape of hang, the step now fails after
22 min instead of 30, leaving room within the original job budget for
report packaging, artifact upload, and the existing `run_attempt > 1`
     retry path.

3. **`.github/workflows/validation.yml`** — replace mvn ... | tee ...out
with file
redirection (>"$LOG" 2>&1 + tail -f --pid) so an orphan child JVM
holding
an inherited stdout fd can no longer pin the step open. Add a follow-up
Kill
leftover Java processes step (if: always()) that SIGTERM/SIGKILLs any
remaining
java processes before report packaging — defensive cleanup against any
      future plugin that leaks a JVM.
@vaadin-bot
Copy link
Copy Markdown
Collaborator Author

This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR[Message is sent from bot]

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Test Results

 1 388 files  ±0   1 388 suites  ±0   1h 28m 8s ⏱️ + 9m 20s
10 022 tests ±0   9 952 ✅ ±0  70 💤 ±0  0 ❌ ±0 
10 495 runs  ±0  10 416 ✅ ±0  79 💤 ±0  0 ❌ ±0 

Results for commit 4b5cb49. ± Comparison against base commit 0648006.

@ZheSun88 ZheSun88 marked this pull request as ready for review May 8, 2026 09:26
@ZheSun88 ZheSun88 merged commit a306397 into 25.1 May 8, 2026
29 checks passed
@ZheSun88 ZheSun88 deleted the fix-it-2-25.1 branch May 8, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants