Skip to content

Allow one-off Browserstack CI dispatch with custom websocket URL#167

Draft
Vincent Ahrend (pvditto) wants to merge 6 commits into
mainfrom
pv/quickstart-cloud-smoke-testing
Draft

Allow one-off Browserstack CI dispatch with custom websocket URL#167
Vincent Ahrend (pvditto) wants to merge 6 commits into
mainfrom
pv/quickstart-cloud-smoke-testing

Conversation

@pvditto
Copy link
Copy Markdown
Contributor

@pvditto Vincent Ahrend (pvditto) commented Sep 11, 2025

Summary

This PR adds optional input parameters to all BrowserStack workflows, enabling testing of new Ditto cloud deployments with custom configuration.

Supported workflows:

  • android-kotlin-ci.yml
  • swift-ci.yml
  • javascript-web-browserstack.yml
  • android-cpp-browserstack.yml

All workflows now accept these optional inputs (all default to repository secrets when not provided):

  • websocket_url - Custom Ditto websocket URL
  • app_id - Custom Ditto app ID
  • playground_token - Custom Ditto playground token
  • auth_url - Custom Ditto auth URL

React Native Fix

  • Fixed React Native app to actually use the DITTO_WEBSOCKET_URL environment variable
  • Previously it was defined in env.d.ts but not used in the transport config
  • Now properly configures websocket URL via updateTransportConfig

Usage

Automatic Dispatch with Script

The scripts/cloud-smoke-test.js script can dispatch all BrowserStack workflows and monitor their progress:

Basic usage (uses environment variables for all config):

node scripts/cloud-smoke-test.js

With custom websocket URL:

node scripts/cloud-smoke-test.js --websocket-url wss://staging.example.com/ws

With multiple custom parameters:

node scripts/cloud-smoke-test.js \
  --websocket-url wss://staging.example.com/ws \
  --app-id staging-app-id \
  --playground-token staging-token

All available options:

  • --websocket-url <url> - Custom websocket URL
  • --app-id <id> - Custom app ID
  • --playground-token <token> - Custom playground token
  • --auth-url <url> - Custom auth URL
  • --help - Show help message

All parameters are optional and fall back to these environment variables:

  • DITTO_WEBSOCKET_URL
  • DITTO_APP_ID
  • DITTO_PLAYGROUND_TOKEN
  • DITTO_AUTH_URL

The script will:

  1. Validate inputs
  2. Dispatch all 4 BrowserStack workflows in parallel
  3. Monitor progress with colored output
  4. Wait up to 45 minutes for completion
  5. Report final results
  6. Exit with appropriate status code (0 = success, 1 = failure)

Manual Dispatch

To test individual workflows manually:

  1. Go to Actions tab → Select any supported BrowserStack workflow
  2. Click "Run workflow"
  3. Enter custom values in the input fields (optional)
  4. Leave fields blank to use defaults from secrets

All parameters are completely optional - workflows will use repository secrets as defaults when inputs are not provided.

- Add workflow_dispatch input for custom websocket URL to:
  - android-kotlin-ci.yml
  - swift-ci.yml
  - javascript-web-browserstack.yml
  - android-cpp-browserstack.yml
- Default to existing secrets when input not provided
- Enables testing new websocket server versions via manual workflow dispatch

Note: React Native app was also updated to use DITTO_WEBSOCKET_URL
environment variable (was previously defined but not used)
@pvditto Vincent Ahrend (pvditto) changed the title Add optional websocket URL input to BrowserStack workflows Allow one-off Browserstack CI dispatch with custom websocket URL Sep 11, 2025
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

📱 BrowserStack Test Results

Status: ✅ Passed
Build: #105
BrowserStack: View detailed results

Tested Devices:

  • Google Pixel 8 (Android 14)
  • Samsung Galaxy S23 (Android 13)
  • Google Pixel 6 (Android 12)
  • OnePlus 9 (Android 11)

@github-actions
Copy link
Copy Markdown
Contributor

📱 BrowserStack Test Results

Status: ✅ Passed
Build: #108
BrowserStack: View detailed results

Tested Devices:

  • Google Pixel 8 (Android 14)
  • Samsung Galaxy S23 (Android 13)
  • Google Pixel 6 (Android 12)
  • OnePlus 9 (Android 11)

Aaron LaBeau (biozal) added a commit that referenced this pull request May 27, 2026
The integration test relies on seeding a doc via Ditto Cloud's API v4
endpoint and then waiting for it to sync down to the local peer. The
seed step succeeds (HTTP 200) but the doc never propagates — Big Peer's
visible task set stays frozen at 2786 docs (the same snapshot since
~Oct 2025), and no rust-tui CI seed since run #167 has appeared.

This matches the pattern documented on other quickstarts
(javascript-tui, javascript-web, react-native, react-native-expo) which
all disabled their cloud-dependent tests with the same `if: false` and
the same comment, tracked as DEVX-759. Applying the same fix here so
this PR's CI can go green.

The integration_test.rs improvements from the prior commit (30s timeout,
explicit auth.login(), better diagnostics) stay in place — they're
still valuable when running locally and for when DEVX-759 is resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Aaron LaBeau (biozal) added a commit that referenced this pull request May 27, 2026
* feat: Updated to v5 preview 4

* feat: update CI/CD to use version 1.91.1 version of rustc

* feat: updated to fix linting issues

* fix: forgot proper version of Rust for linux - you have to cut and paste in the yml file for each platform

* fix: updated to fix auth

* fix: linting

* fix: fixed tests running

* fixed linting and formating

* Updated for RC3 and fixing security issues

* updated to v5

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* updated to fix PR comments

* updated toolchain

* fix(rust-tui): make integration test sync wait robust against slow seeds

CI was failing because the seeded task wasn't visible within 15s of the
local peer connecting; 2786 other tasks did sync but the just-seeded one
hadn't propagated yet. Three changes:

- Bump max_attempts from 15s to 30s (matches cpp-tui's wait window).
- Explicitly call auth.login() before sync().start() so the first sync
  round always has a valid JWT, instead of racing the expiration handler
  to authenticate. Mirrors the javascript-tui v5 pattern.
- On failure, surface count + any rust-tui-seeded tasks visible locally
  to make future diagnosis less ambiguous.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci(rust-tui): disable integration test - Ditto Cloud API key expired

The integration test relies on seeding a doc via Ditto Cloud's API v4
endpoint and then waiting for it to sync down to the local peer. The
seed step succeeds (HTTP 200) but the doc never propagates — Big Peer's
visible task set stays frozen at 2786 docs (the same snapshot since
~Oct 2025), and no rust-tui CI seed since run #167 has appeared.

This matches the pattern documented on other quickstarts
(javascript-tui, javascript-web, react-native, react-native-expo) which
all disabled their cloud-dependent tests with the same `if: false` and
the same comment, tracked as DEVX-759. Applying the same fix here so
this PR's CI can go green.

The integration_test.rs improvements from the prior commit (30s timeout,
explicit auth.login(), better diagnostics) stay in place — they're
still valuable when running locally and for when DEVX-759 is resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant