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

ci(github): move connect webextension example tests to GitHub Actions #12011

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

karliatto
Copy link
Member

@karliatto karliatto commented Apr 15, 2024

Description

Migrate from GitLab to GitHub Actions example webextension test.

Move the tests for example webextension to popup tests since they are using the same infrastructure and it was confusing to have those in connect-webextension package because that package now is used for different reason.

Related Issue

Resolve #7916

@karliatto karliatto force-pushed the ci/add-webtextension-to-popup branch 6 times, most recently from 1812aa6 to 32f2fb7 Compare April 18, 2024 13:08
@karliatto karliatto changed the title wip ci(github): move connect webextension example tests to GitHub Actions Apr 18, 2024
@karliatto karliatto force-pushed the ci/add-webtextension-to-popup branch from 32f2fb7 to 2cd9b60 Compare April 18, 2024 13:29
Copy link

socket-security bot commented Apr 18, 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
New author npm/[email protected]
New author npm/[email protected]
Trivial Package npm/[email protected]
Environment variable access npm/[email protected]
Environment variable access npm/[email protected]
Uses eval npm/[email protected]
Filesystem access npm/[email protected]
Environment variable access npm/[email protected]
Floating dependency npm/@types/[email protected]
New author npm/[email protected]
Floating dependency npm/@types/[email protected]

View full report↗︎

Next steps

What is new author?

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

What are trivial packages?

Packages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.

Removing this package as a dependency and implementing its logic will reduce supply chain risk.

What is environment variable access?

Package accesses environment variables, which may be a sign of credential stuffing or data theft.

Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

What is eval?

Package uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Avoid packages that use eval, since this could potentially execute any code.

What is filesystem access?

Accesses the file system, and could potentially read sensitive data.

If a package must read the file system, clarify what it will read and ensure it reads only what it claims to. If appropriate, packages can leave file system access to consumers and operate on data passed to it instead.

What are floating dependencies?

Package has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.

Packages should specify properly semver ranges to avoid version conflicts.

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

@karliatto
Copy link
Member Author

@SocketSecurity ignore

@karliatto karliatto marked this pull request as ready for review April 18, 2024 14:52
run: |
yarn workspace @trezor/connect-web build:webextension
yarn workspace @trezor/connect-web build:inline
node packages/connect-examples/update-webextensions.js
Copy link
Member

Choose a reason for hiding this comment

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

It's not called with parameters like before (--trezor-connect-src "${URL}" --npm-src "${URL}/trezor-connect.js") is this intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that was missed, I just added it. Thanks!

@karliatto karliatto force-pushed the ci/add-webtextension-to-popup branch 4 times, most recently from 3aa1bdd to 038d05a Compare April 23, 2024 10:28
Copy link
Member

@vdovhanych vdovhanych left a comment

Choose a reason for hiding this comment

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

Otherwise i think its fine

@@ -92,16 +100,24 @@ jobs:
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Build webextension
- name: Install dependencies
run: |
yarn install --immutable
yarn build:libs
Copy link
Member

Choose a reason for hiding this comment

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

we should use directly building just the necessary lib, not all of them, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, that shouldn't be needed globally here.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, that yarn build:libs was totally unnecessary, done 1c66aef

run: |
yarn workspace @trezor/connect-web build:webextension
yarn workspace @trezor/connect-web build:inline
node packages/connect-examples/update-webextensions.js --trezor-connect-src "${URL}" --npm-src "${URL}trezor-connect.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

so url here is just regular branch of a PR right? (or maybe develop branch)

also didn't we use it somewhere in combination production URLs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, URL here is that, the branch of the PR where this test is running. On schedule it is develop.

@karliatto
Copy link
Member Author

so what do you think guys, it is ok alreay? @vdovhanych @martykan @mroz22

@karliatto karliatto force-pushed the ci/add-webtextension-to-popup branch from 1c66aef to 60e2808 Compare April 26, 2024 12:58
@karliatto
Copy link
Member Author

karliatto commented Apr 26, 2024

@SocketSecurity ignore

@karliatto karliatto force-pushed the ci/add-webtextension-to-popup branch from 60e2808 to 28d36e8 Compare April 29, 2024 07:25
@karliatto karliatto merged commit 10e7f5d into develop Apr 30, 2024
71 of 73 checks passed
@karliatto karliatto deleted the ci/add-webtextension-to-popup branch April 30, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Move Connect popup tests from GitLab to GitHub Actions
4 participants