Skip to content

Conversation

@Yicong-Huang
Copy link
Contributor

@Yicong-Huang Yicong-Huang commented Oct 20, 2024

This PR fixes CI issues introduced in #2912. The symptom is frontend test ci failed without failing the entire CI. There are a few reasons underneath:

  • Alias dependency resolution issue. The newly introduced Monaco-editor-wrapper has peer dependency with alias @codingame/monaco-vscode-api@8.0.4. Yarn@1 will install it as vscode@npm:@codingame/monaco-vscode-api@8.0.4 in the lock file.
    However, during parsing the lock file, Nx reports cannot find the package with name npm:vscode@npm:@codingame/monaco-vscode-api (note for the npm: in the beginning).

Solution (2 steps):

  1. Added resolution in package.json monaco-editor: npm:vscode@npm:@codingame/monaco-vscode-api so that the generated lock file has correct handle.
  2. To be able to parse this added resolution field, Yarn@1 has to be upgraded to Yarn@4.5.1.
  • multiple webpack resolution issue. Our project uses a custom webpack. Monaco also introduces their webpack dependency. There are multiple webpacks, and the used version got resolved to be @5.92.3 which caused error when bundling frontend compile files.

Solution: pin webpack version to use @5.89.0 in resolution.

  • Nx not failing upon a failed execution. In Upgrade Monaco Language Client to 8.8.3 #2912, we also updated the Nx from @18.1.3 to @18.2.0. The frontend test is failed to be executed, but Nx reports success (did not return error).

Solution: this seems to be a bug on Nx side. in release @18.2.0, a bug was introduced so that errors reported from the project graph build during the daemon process would not be rethrown, causing the main thread to not fail properly. We updated it to version @20.0.3 and it is confirmed to be solved. See https://github.com/Texera/texera/actions/runs/11429004023 (it properly failed the CI).

Steps to migrate this PR:

Under core directory:

  • You need to switch from Yarn@1 to Yarn@4.5.1: run corepack enable && corepack prepare yarn@4.5.1 --activate && yarn --cwd gui set version 4.5.1

Under core/gui directory:

  • You can verify the Yarn version with yarn --version. It should show 4.5.1
  • Remove all cached/dependency files: rm -rf node_modules .angular
  • Reinstall with the upgraded Yarn: yarn install

@Yicong-Huang Yicong-Huang self-assigned this Oct 20, 2024
@Yicong-Huang Yicong-Huang added bug fix testing frontend Changes related to the frontend GUI labels Oct 20, 2024
Copy link
Contributor

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

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

LGTM!

@Yicong-Huang Yicong-Huang merged commit 3e0d60e into master Oct 22, 2024
@Yicong-Huang Yicong-Huang deleted the yicong-fix-frontend-ci branch October 22, 2024 01:22
shengquan-ni added a commit that referenced this pull request Nov 1, 2024
The old docker file does not sync with the latest yarn change(#2954) and
fails to compile. This PR updates the Dockerfile to use yarn 4.5.1.
PurelyBlank pushed a commit that referenced this pull request Dec 4, 2024
…ion (#2954)

This PR fixes CI issues introduced in #2912. The symptom is frontend
test ci failed without failing the entire CI. There are a few reasons
underneath:

- **Alias dependency resolution issue.** The newly introduced
`Monaco-editor-wrapper` has peer dependency with alias
`@codingame/monaco-vscode-api@8.0.4`. Yarn@1 will install it as
`vscode@npm:@codingame/monaco-vscode-api@8.0.4` in the lock file.
However, during parsing the lock file, Nx reports cannot find the
package with name `npm:vscode@npm:@codingame/monaco-vscode-api` (note
for the `npm:` in the beginning).

> Solution (2 steps): 
> 1. Added resolution in package.json `monaco-editor:
npm:vscode@npm:@codingame/monaco-vscode-api` so that the generated lock
file has correct handle.
> 2. To be able to parse this added resolution field, Yarn@1 has to be
upgraded to Yarn@4.5.1.

- **multiple webpack resolution issue.** Our project uses a custom
webpack. Monaco also introduces their webpack dependency. There are
multiple webpacks, and the used version got resolved to be `@5.92.3`
which caused error when bundling frontend compile files.

> Solution: pin webpack version to use `@5.89.0` in resolution.

- **Nx not failing upon a failed execution.** In #2912, we also updated
the Nx from @18.1.3 to @18.2.0. The frontend test is failed to be
executed, but Nx reports success (did not return error).

> Solution: this seems to be a bug on Nx side. in release @18.2.0, a bug
was introduced so that errors reported from the project graph build
during the daemon process would not be rethrown, causing the main thread
to not fail properly. We updated it to version @20.0.3 and it is
confirmed to be solved. See
https://github.com/Texera/texera/actions/runs/11429004023 (it properly
failed the CI).


### Steps to migrate this PR:
Under `core` directory:
- You need to switch from Yarn@1 to Yarn@4.5.1: run `corepack enable &&
corepack prepare yarn@4.5.1 --activate && yarn --cwd gui set version
4.5.1`

Under `core/gui` directory:
- You can verify the Yarn version with `yarn --version`. It should show
4.5.1
- Remove all cached/dependency files: `rm -rf node_modules .angular`
- Reinstall with the upgraded Yarn: `yarn install`
PurelyBlank pushed a commit that referenced this pull request Dec 4, 2024
The old docker file does not sync with the latest yarn change(#2954) and
fails to compile. This PR updates the Dockerfile to use yarn 4.5.1.
@Yicong-Huang Yicong-Huang removed the bug label Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants