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

Remove WASM build from UI test workflows #45801

Open
zmb3 opened this issue Aug 24, 2024 · 1 comment
Open

Remove WASM build from UI test workflows #45801

zmb3 opened this issue Aug 24, 2024 · 1 comment
Labels
developer-experience Addressing these issues will improve the experience of developers working on Teleport github-actions

Comments

@zmb3
Copy link
Collaborator

zmb3 commented Aug 24, 2024

Investigate whether we can remove the WASM build from the UI test workflows. The RDP WASM component should not be needed for the web UI tests, and it currently takes just as long as the full test suite, which means that we could cut test runtime in half by removing this step.

@zmb3 zmb3 added github-actions developer-experience Addressing these issues will improve the experience of developers working on Teleport labels Aug 24, 2024
@ravicious
Copy link
Member

AFAIK the idea behind this would be to replace these three imports with some kind of a shim:

import init, {
init_wasm_log,
FastPathProcessor,
} from 'teleport/ironrdp/pkg/ironrdp';

Here's what Isaiah said when we were talking about it back in December 2023:

The difficulty with adding type-shims is that those types will always be searched for in teleport/ironrdp/pkg/ironrdp, which is generated by wasm-pack with a .gitignore that ignores everything (*).

This means that we could check in the types generated in web/packages/teleport/src/ironrdp/pkg/ironrdp.d.ts and it will cause e.g. yarn type-check to pass without needing to build the full wasm module. The problem will arise when that API changes --- we will need to remember to git add --force those changes. An alternative is that we use this non-upstreamed change in wasm-pack to avoid that gitignore creation. That could work relatively smoothly, we would then just maintain our own .gitignore in web/packages/teleport/src/ironrdp/pkg/ that looks like

*
!.gitignore
!ironrdp.d.ts

Keep in mind that that this was said in the context of removing the need to compile WASM code completely. Back then if you didn't compile WASM stuff, you couldn't really use Connect in dev mode as it'd show type errors from the whole project in an overlay inside the app. This has since been removed after we migrated to Vite.

In the case of a CI step, we don't have to worry about gitignore that much. We can keep the shim in a separate directory. In the CI step, we can move the shim to where the code expects WASM files to be. Devs working on those WASM components would need to remember about updating the shim though, but the CI would remind them about that anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Addressing these issues will improve the experience of developers working on Teleport github-actions
Projects
None yet
Development

No branches or pull requests

2 participants