Skip to content

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Apr 17, 2025

Description

This PR improves the error handling when automatically opening the browser fails. Several users have reported issues with the create-release-branch tool failing when their terminal application lacks sufficient privileges for System Events or when using non-standard browsers like Brave.

Instead of failing with an unclear osascript error, the tool now:

  • Attempts to open the browser gracefully
  • Falls back to displaying clear manual instructions if automatic opening fails
  • Continues running the server regardless of browser open status

Testing Instructions

Prerequisites

  • macOS system
  • Terminal application (Terminal.app, iTerm2, VS Code integrated terminal, etc.)

Test Case 1: System Events Permission Disabled

  1. First, test current behavior on main:

    git checkout main
    yarn build
    // use package locally (eg: from Core repo)
    yarn && yarn create-release-branch -i
    • Note that it fails with osascript error if permissions are not granted
  2. Disable System Events permission:

    • Open System Settings > Privacy & Security > Automation
    • Find your terminal application
    • Disable "System Events" permission
  3. Test the fix:

    git checkout fix/handle-macos-browser-open-permissions
    yarn build
    // use package locally (eg: from Core repo)
    yarn && yarn create-release-branch -i
    • Verify you see a clear message with the URL to open manually
    • Verify the server continues running
    • Verify you can copy/paste the URL and access the UI

Test Case 2: Non-standard Browser (Brave)

  1. Set Brave as your default browser

  2. Test current behavior on main:

    git checkout main
    yarn build
    // use package locally (eg: from Core repo)
    yarn && yarn create-release-branch -i
    • Note any errors or unexpected behavior
  3. Test the fix:

    git checkout fix/handle-macos-browser-open-permissions
    yarn build
    // use package locally (eg: from Core repo)
    yarn && yarn create-release-branch -i
    • Verify you see either:
      a) Browser opens successfully in Brave, or
      b) Clear instructions to open the URL manually
    • Verify the server continues running
    • Verify you can access the UI by manually opening the URL

@cryptodev-2s cryptodev-2s self-assigned this Apr 17, 2025
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner April 17, 2025 20:01
@cryptodev-2s cryptodev-2s force-pushed the fix/handle-macos-browser-open-permissions branch from 502ba02 to 0f2b9b2 Compare April 17, 2025 20:07
@cryptodev-2s cryptodev-2s force-pushed the fix/handle-macos-browser-open-permissions branch from 0f2b9b2 to 3ae4579 Compare April 17, 2025 20:08
@cryptodev-2s cryptodev-2s linked an issue Apr 17, 2025 that may be closed by this pull request
4 tasks
);

if (interactive) {
stdout.write(`Starting UI on port ${port}...\n`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as redundant

@cryptodev-2s cryptodev-2s requested a review from mcmire April 17, 2025 20:10
@cryptodev-2s cryptodev-2s enabled auto-merge (squash) April 17, 2025 20:13
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Superb manual testing steps. I tried all of them and they worked. Nice job!

@cryptodev-2s cryptodev-2s merged commit 6960373 into main Apr 17, 2025
15 checks passed
@cryptodev-2s cryptodev-2s deleted the fix/handle-macos-browser-open-permissions branch April 17, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Brave browser in create-release-branch --interactive
2 participants