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

[BEEEP][PM-14388] Better dev experience on desktop-browser IPC #11822

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented Nov 1, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14388

📔 Objective

This PR tries to improve developer experience on desktop-browser integration by removing some unnecessary steps.

  • Allow enabling biometric integration on desktop MacOS, even if the app is not an appstore build, when launching it in dev mode. This should make it much faster to test changes without waiting for a full build+signing. In my testing it seems to work perfectly fine.
  • When building the IPC code in debug mode, use a TMP directory instead of the App Groups folder. As the app won't be codesigned, using App Groups leads to a lot of popups asking for access to that folder.
  • Try to detect any bitwarden extension installed in the chrome based browsers by reading their preferences and add their extension to the allowlist. This is to make it easier to test dev builds of the browser extension, which generates a random extension id per user. Previously devs had to manually patch the manifest file, which is specially annoying now that we regenerate it each time, but this should be done automatically for them now.
  • Reorganized and unified the Linux browser detection logic a bit to move it closer to what we do for Mac and Windows. This should make it easier to add other chrome-based browsers in the future. It also revealed that we weren't deleting the manifest from chromium before, that's fixed as well.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

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

Project coverage is 33.53%. Comparing base (4a2c14d) to head (17009f7).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/desktop/src/main/native-messaging.main.ts 0.00% 40 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11822      +/-   ##
==========================================
- Coverage   33.55%   33.53%   -0.02%     
==========================================
  Files        2814     2814              
  Lines       87435    87464      +29     
  Branches    16674    16677       +3     
==========================================
- Hits        29337    29330       -7     
- Misses      55793    55829      +36     
  Partials     2305     2305              

☔ 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 November 1, 2024 11:47
@dani-garcia dani-garcia requested a review from a team as a code owner November 1, 2024 11:47
Copy link
Member

@justindbaur justindbaur left a comment

Choose a reason for hiding this comment

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

Looks great, one question, is there any world where a dev would want to opt out of this improvement?

For example in browser we don't show the welcome tab on install but we added a way to opt out of that so you can test the more production like experience.

I think this differs in that it's actually making the dev experience MORE like production but just wanted to offer it up as a question.


// If one of the commands is autofill_login or generate_password, we know it's probably the Bitwarden extension
for (const { command_name, extension } of Object.values(commands)) {
if (command_name === "autofill_login" || command_name === "generate_password") {
Copy link
Member

Choose a reason for hiding this comment

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

Genius

Copy link
Member Author

Choose a reason for hiding this comment

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

@quexten should get the props for this idea, he's the one who came up with it 😄

@dani-garcia
Copy link
Member Author

Looks great, one question, is there any world where a dev would want to opt out of this improvement?

For example in browser we don't show the welcome tab on install but we added a way to opt out of that so you can test the more production like experience.

I think this differs in that it's actually making the dev experience MORE like production but just wanted to offer it up as a question.

I think most of the changes as you mention only bring us closer to what production should be, and the differences that these changes enable aren't really behavioral, they just unblock certain features that previously weren't working in dev, so I can't imagine there's many reasons to disable them.

For testing a more production build on MacOS, you'll need to test against a masdev build to make sure the sanbdox isn't causing any issues anyway, and in production builds these changes don't have any effect.

@dani-garcia dani-garcia merged commit 5eae599 into main Nov 1, 2024
37 of 38 checks passed
@dani-garcia dani-garcia deleted the ps/allow-dev-extensions-desktop branch November 1, 2024 13:13
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