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

Setup Replay recording on CI #19

Merged

Conversation

Andarist
Copy link
Member

@Andarist Andarist commented Apr 16, 2024

  • add a test workspace for this
  • add its workspace API key here as REPLAY_API_KEY secret

I tested what I could locally (including uploading the recordings to a sample throwaway workspace).

Note that we can see in the logs things like:

[replay.io]: Failed to add annotation
[replay.io]: Error: page.evaluate: Execution context was destroyed, most likely because of a navigation
[replay.io]: Failed to add annotation
[replay.io]: Error: page.evaluate: Target closed

It works regardless of that. Most likely the offending code is here - but fixing this properly requires further investigation.

@Andarist Andarist requested review from bvaughn and hbenl April 16, 2024 13:06
Copy link

vercel bot commented Apr 16, 2024

@Andarist is attempting to deploy a commit to the Replay Team on Vercel.

To accomplish this, @Andarist needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

Copy link

socket-security bot commented Apr 16, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@playwright/[email protected] None 0 25.3 kB aslushnikov
npm/@replayio/[email protected] environment, filesystem Transitive: eval, network, shell +126 9.84 MB ryanjduffy
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +1 9.99 MB aslushnikov

🚮 Removed packages: npm/@playwright/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented Apr 16, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/@replayio/[email protected]
  • Install script: postinstall
  • Source: yarn run if:dist -- node ./bin.js first-run

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@Andarist Andarist force-pushed the andarist/pro-100-setup-test-suites-for-playwright-e2e-tests branch from 3af5c96 to dc5416c Compare April 16, 2024 13:07
Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview Apr 16, 2024 3:24pm

package.json Show resolved Hide resolved
.github/workflows/playwright.yml Show resolved Hide resolved
Comment on lines +81 to +82
- name: Get Replay Chromium
run: npx replayio update
Copy link
Member Author

Choose a reason for hiding this comment

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

@bvaughn it would be good to have a way to cache replay chromium on CI - we don't make it easy rn to do this. Do you have any opinions on how we could make it happen?

It would be cool if the user wouldn't have to worry about the location that has to be cached. Right now the return value of getRuntimesDirectory in the new CLI varies based on some env variables etc - so I guess we'd have to expose this logic somehow through the CLI (a new command?).

On top of that, we need a stable cache key - that would be what replayio returns (but in a machine-readable format): buildId + forkedVersion (or smth like that).

That means the user would have to invoke replayio twice - it isn't super great but probably OK here.

@Andarist Andarist force-pushed the andarist/pro-100-setup-test-suites-for-playwright-e2e-tests branch from 1580524 to 6888c91 Compare April 16, 2024 14:33
@bvaughn
Copy link
Contributor

bvaughn commented Apr 16, 2024

Error: ENOENT: no such file or directory, rename '/home/runner/.replay/runtimes/chrome-linux/replay-chromium' -> '/home/runner/.replay/runtimes/chrome-linux/chrome-linux'

The most recent CLI failure is related to behavior we mimicked from the legacy CLI (without understanding why) replayio/replay-cli@6d9b8b9#r140402329

@Andarist
Copy link
Member Author

It's alive and working :)

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Awesome!

@Andarist Andarist merged commit 175e920 into main Apr 16, 2024
6 of 7 checks passed
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.

2 participants