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

Publish WASM package to enable argon2 support on CLI #691

Merged
merged 16 commits into from
Apr 15, 2024

Conversation

dani-garcia
Copy link
Member

Type of change

- [ ] Bug fix
- [x] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [x] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Continuation of #680

I've created workflows to publish the WASM builds to NPM, so that it can be used from the CLI client.

The publishing step is based on the NAPI builds, and I've tested it against the Github NPM registry. We'll need to get a build going and published on the NPM registry to be able to use it on the CLI.

@@ -15,6 +15,7 @@
"main": "node/bitwarden_wasm.js",
"module": "index.js",
"types": "bitwarden_wasm.d.ts",
"scripts": {},
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 isn't technically required, but npm would output a confusing warning if it wasn't there, so I decided to add it.

Copy link
Contributor

github-actions bot commented Apr 1, 2024

Logo
Checkmarx One – Scan Summary & Details1215d9f3-79c9-43dc-864d-ba712288e139

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Unpinned Actions Full Length Commit SHA /release-wasm.yml: 49 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /release-wasm.yml: 113 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /release-wasm.yml: 107 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 60.71%. Comparing base (499e213) to head (1ada3f5).

Files Patch % Lines
crates/bitwarden-wasm/src/client.rs 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #691      +/-   ##
==========================================
- Coverage   60.83%   60.71%   -0.13%     
==========================================
  Files         173      173              
  Lines       10598    10619      +21     
==========================================
  Hits         6447     6447              
- Misses       4151     4172      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dani-garcia dani-garcia marked this pull request as ready for review April 1, 2024 13:49
@dani-garcia dani-garcia requested a review from a team as a code owner April 1, 2024 13:49
@dani-garcia dani-garcia requested a review from Hinton April 1, 2024 13:49
.github/workflows/release-wasm.yml Outdated Show resolved Hide resolved
.github/workflows/release-wasm.yml Outdated Show resolved Hide resolved
.github/workflows/release-wasm.yml Outdated Show resolved Hide resolved
.github/workflows/release-wasm.yml Outdated Show resolved Hide resolved
.github/workflows/release-wasm.yml Outdated Show resolved Hide resolved
michalchecinski
michalchecinski previously approved these changes Apr 3, 2024
@Hinton Hinton mentioned this pull request Apr 9, 2024
crates/bitwarden-wasm/src/client.rs Fixed Show fixed Hide fixed
crates/bitwarden-wasm/src/client.rs Fixed Show fixed Hide fixed
Hinton
Hinton previously approved these changes Apr 9, 2024
# Conflicts:
#	crates/bitwarden-wasm/Cargo.toml
Copy link
Member

Choose a reason for hiding this comment

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

I think you can get rid of the SETUP NPM by using the actions/setup-node action with registry-url per https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry. You can also omit writing the token to disk and just pass it in as an env during the publish command.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm hesitant to change this here as all our other NPM publishing workflows in sdk and clients are doing it this way, so I wouldn't want a single workflow being different than the rest.

I definitely think this is a good improvement over manually creating the file, and we definitely want to switch to it, but I think it would be better for a separate PR to update all workflows at once.

@dani-garcia dani-garcia merged commit 0be54d1 into main Apr 15, 2024
77 checks passed
@dani-garcia dani-garcia deleted the ps/argon2-publish branch April 15, 2024 12:58
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.

3 participants