Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update yarn to v3 #273

Merged
merged 7 commits into from
Jun 15, 2023
Merged

Conversation

lordrip
Copy link
Member

@lordrip lordrip commented Jun 8, 2023

Context

Upgrade yarn to the v3 version

Changes

  • Update yarn version
  • Update @kie-tools-core/* dependencies to match with kaoto-ui version
  • With the invaluable help of @djelinek, refactored the tests to account for the delay when opening VSCode in CI.

Known issues

  • kaoto-ui@main is not working since it requires the latest version of kaoto-backend since it provides the new /v2 endpoints for the multiple routes support.

fixes: #270

@lordrip lordrip requested a review from apupier June 8, 2023 10:17
@lordrip
Copy link
Member Author

lordrip commented Jun 8, 2023

@apupier I have the following situation whenever we link the latest kaoto-ui with vscode-kaoto: apart from the @kie-tools dependency mismatch, the latest version of kaoto-ui requires the latest version of the kaoto-backend, which is not released yet 😬

Should we stay then in the released kaoto-ui when linking locally then?

@lordrip lordrip marked this pull request as draft June 8, 2023 10:21
@apupier
Copy link
Member

apupier commented Jun 8, 2023

Should we stay then in the released kaoto-ui when linking locally then?

I guess you mean the kaoto-backend.
it would be nice to use the latest kaoto-backend in jobs but it will require to build the native binaries locally as it is not published which takes quite some time and will be complicated to maintain. So for now, I let it aside and relied on frequent releases of backend and ui.
Corresponding issue #70

When developing locally, there is a little trick to use another backend: https://github.com/KaotoIO/vscode-kaoto/blob/main/CONTRIBUTING.md#how-to-manually-test-latest-kaoto-backend

@lordrip lordrip changed the title chore: update yarn - update yarn.lock and ignore yarn cache chore: update yarn to v3 Jun 8, 2023
@lordrip lordrip force-pushed the chore/upgrade-yarn-v3 branch 2 times, most recently from df94c97 to c92fe03 Compare June 8, 2023 13:57
@lordrip
Copy link
Member Author

lordrip commented Jun 9, 2023

Should we stay then in the released kaoto-ui when linking locally then?

I guess you mean the kaoto-backend. it would be nice to use the latest kaoto-backend in jobs but it will require to build the native binaries locally as it is not published which takes quite some time and will be complicated to maintain. So for now, I let it aside and relied on frequent releases of backend and ui. Corresponding issue #70

When developing locally, there is a little trick to use another backend: https://github.com/KaotoIO/vscode-kaoto/blob/main/CONTRIBUTING.md#how-to-manually-test-latest-kaoto-backend

I agree, it would be nice to have the latest Kaoto backend. In this particular case, using the main branch for Kaoto UI won't work with the backend 1.0 because of the former using newer /v2 endpoints from the latter to support multiple routes.

@lordrip lordrip force-pushed the chore/upgrade-yarn-v3 branch 2 times, most recently from a01ba8f to 2e41ab9 Compare June 9, 2023 12:50
As [kaoto-ui](https://github.com/KaotoIO/kaoto-ui) migrated to yarn v3, it's
time for vscode to do the same.

Changes:

* Upgrade yarn to v3 - berry
* Remove installing global dependencies from CI workflows as those are deprecated
in favor of the "yarn dlx" command
* Add a local yarn plugin (.yarn/plugins/plugins-list.js) to bring the functionality
from yarn v1 "yarn list --prod --json" since the "@vscode/vsce" depends on such functionality.
more datails in [the following issue](microsoft/vscode-vsce#517)
* Update the CONTRIBUTING.md file to reflect the new API for "yarn link"
* Bump "@kie-tools-core/*" from "0.27.0" to "0.29.0" as it's required that the dependencies
match from the root package and the linked package.
* Add a resolution entry for "zundo" package to support both "[email protected]" and "kaoto-ui@main-branch"

fixes: KaotoIO#270
@lordrip lordrip force-pushed the chore/upgrade-yarn-v3 branch 2 times, most recently from fda8f5e to e699b53 Compare June 12, 2023 13:33
bus: acquireVsCodeApi(),
editorFactory: new KaotoEditorFactory(),
editorFactory: new KaotoEditorFactory() as unknown as EditorFactory<Editor, KogitoEditorChannelApi>,
Copy link
Member Author

Choose a reason for hiding this comment

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

There's a mismatch between @kie-tools-core from kaoto-ui and vscode-kaoto. This will be removed during the next release of kaoto-ui.

Copy link
Member

Choose a reason for hiding this comment

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

So related to the comment here https://github.com/KaotoIO/vscode-kaoto/pull/273/files?diff=split&w=1#r1229554845

if I understand well, this is a trick to avoid failure at compile time but in case a method that does not exists is called it will fail at runtime?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is a trick to avoid failure at compile time

yes

In case a method that does not exists is called it will fail at runtime

yes, it will be like that, but I proposed this change because in the newest version of @kie-tools-core there were 2 properties added:

- kogitoGuidedTour_guidedTourUserInteraction
- kogitoGuidedTour_guidedTourRegisterTutorial

and we're not using them yet, so I assumed that we could move forward like that. I could remove it as well since even if we're supporting linking vscode-kaoto with kaoto-ui@main, at the test side still won't work with the latest kaoto-backend.

@@ -159,14 +159,17 @@
"tsconfig-paths-webpack-plugin": "^4.0.1",
"typescript": "^5.0.4",
"url-loader": "^4.1.1",
"vscode-extension-tester": "5.6.0",
"vscode-extension-tester": "^5.7.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

Upgraded this dependency as it has bigger timeouts

Changelog

@lordrip lordrip marked this pull request as ready for review June 14, 2023 10:21
"@kie-tools-core/patternfly-base": "^0.27.0",
"@kie-tools-core/vscode-extension": "^0.27.0",
"@kie-tools-core/workspace": "^0.27.0",
"@kie-tools-core/backend": "^0.29.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

This upgrade is needed to match the kaoto-ui current dependencies, as it is a requirement from yarn link to match dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

surprised that it is working with kaoto-ui 1.0.0.

await driver.wait(until.elementLocated(By.xpath("//div[@data-testid='viz-step-slot']")));
await driver.wait(until.elementLocated(By.xpath("//div[@data-testid='viz-step-slot']")));
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved the workaround here to ensure that we have time after each workspace loading.

There's an open feature request in redhat-developer/vscode-extension-tester#854 that could help with this.

Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

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

"@kie-tools-core/patternfly-base": "^0.27.0",
"@kie-tools-core/vscode-extension": "^0.27.0",
"@kie-tools-core/workspace": "^0.27.0",
"@kie-tools-core/backend": "^0.29.0",
Copy link
Member

Choose a reason for hiding this comment

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

surprised that it is working with kaoto-ui 1.0.0.

.yarn/plugins/plugin-list.js Outdated Show resolved Hide resolved
bus: acquireVsCodeApi(),
editorFactory: new KaotoEditorFactory(),
editorFactory: new KaotoEditorFactory() as unknown as EditorFactory<Editor, KogitoEditorChannelApi>,
Copy link
Member

Choose a reason for hiding this comment

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

So related to the comment here https://github.com/KaotoIO/vscode-kaoto/pull/273/files?diff=split&w=1#r1229554845

if I understand well, this is a trick to avoid failure at compile time but in case a method that does not exists is called it will fail at runtime?

@apupier
Copy link
Member

apupier commented Jun 15, 2023

@lordrip lordrip merged commit 7b45592 into KaotoIO:main Jun 15, 2023
@lordrip lordrip deleted the chore/upgrade-yarn-v3 branch June 15, 2023 10:06
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.

Upgrade to Yarn v3
3 participants