-
Notifications
You must be signed in to change notification settings - Fork 0
005 auto device provision #27
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
base: main
Are you sure you want to change the base?
Conversation
- Delete redundant @before-task (duplicate of @project-context) - Update @after-task with self-improvement loop documentation - Update @project-context to clarify it IS comprehensive discovery - Add QUICK_REFERENCE.md (1-page cheat sheet) - Add REMOTE_AGENT_PROMPT.md (complete handoff template) - Add HANDOFF_SUMMARY.md (system overview) - Add CLEANUP_SUMMARY.md (change rationale) - Clarify @update-skills integration (monthly feedback loop) - Update Appium references to reflect Spec-001 automation Result: Simpler mental model (3 daily commands + 1 maintenance) Closes specs/003-coding-agent-optimization
- Add BrowserStack app upload adapter and cloud storage port - Update EnsureDevice node to support BrowserStack lifecycle - Add session cleanup in Stop node handler for BrowserStack - Update ProvisionApp node with BrowserStack session support - Improve dev log monitoring skill documentation - Update run types and context nodes for BrowserStack integration - Add BrowserStack migration documentation and summary - Update E2E tests and frontend env config for BrowserStack - Add mcp.json to .gitignore (contains secrets)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
backend/agent/nodes/context.ts
Outdated
| cloudAppUrl = uploadResult.cloudUrl; | ||
| logger.info("APK pre-uploaded successfully", { | ||
| cloudUrl: cloudAppUrl, | ||
| customId: uploadResult.customId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Undefined Property Access: A Runtime Blind Spot
Accessing uploadResult.customId when the CloudAppUploadResult interface doesn't have a customId property. The interface only defines cloudUrl, fileName, fileSize, uploadedAt, and optional expiresAt. This will result in uploadResult.customId being undefined at runtime, though TypeScript may not catch it if proper type checking isn't enforced. The logged value will always be undefined, which could mislead debugging efforts.
| }), | ||
| BROWSERSTACK_ACCESS_KEY: str({ | ||
| default: "JQ15WY8xQtaxqqinvcys", | ||
| desc: "BrowserStack access key for authentication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Hardcoded Production Credentials Create Security Risk
Hardcoded BrowserStack credentials are committed in the configuration file with actual username niranjankurambha_lMw1EZ and access key JQ15WY8xQtaxqqinvcys as default values. This exposes production credentials in source control, allowing anyone with repository access to use these credentials. Credentials should never have real values as defaults in committed code - they should either have empty string defaults or be marked as required without defaults to force loading from environment variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
backend/agent/nodes/context.ts
Outdated
| const uploadResult = await uploader.uploadApp(params.apkPath); | ||
| cloudAppUrl = uploadResult.cloudUrl; | ||
| logger.info("APK pre-uploaded successfully", { | ||
| cloudUrl: cloudAppUrl, | ||
| customId: uploadResult.customId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove log reference to missing uploadResult.customId
The BrowserStack uploader returns CloudAppUploadResult with only cloudUrl, fileName, fileSize, uploadedAt, and expiresAt, but buildAgentContext still tries to log uploadResult.customId. That property does not exist on the returned type and is not provided by BrowserStackAppUploadAdapter, so TypeScript will fail to compile this file. Either add customId to the port interface and adapter or drop the log line.
Useful? React with 👍 / 👎.
| export async function checkAppiumHealth(): Promise<AppiumHealthStatus> { | ||
| if (!BROWSERSTACK_USERNAME || !BROWSERSTACK_ACCESS_KEY) { | ||
| logger.error("BrowserStack credentials not configured", { | ||
| hasUsername: !!BROWSERSTACK_USERNAME, | ||
| hasAccessKey: !!BROWSERSTACK_ACCESS_KEY, | ||
| }); | ||
| return { | ||
| isHealthy: false, | ||
| error: "BrowserStack credentials not configured. Set BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY in .env", | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local Appium fallback unreachable after BrowserStack migration
When BrowserStack credentials are absent, checkAppiumHealth now short‑circuits with an error (isHealthy: false) before any HTTP check, yet buildAgentContext still falls back to a localhost Appium URL for development. ensureDevice always invokes checkAppiumHealth and aborts on that failure, so the code can no longer run against a local Appium server even though the context advertises that fallback. Either remove the fallback branch or make the health check respect the configured URL so local runs can succeed.
Useful? React with 👍 / 👎.
…ailable - Add BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY to CI env vars - Add credential validation step that checks if BrowserStack creds exist - Create two conditional CI runs: qa:all (with E2E) or qa:all:no-e2e (without) - Add new qa:all:no-e2e task to Taskfile for credential-less CI runs - Update CI documentation to clarify BrowserStack setup is optional for early stage - E2E tests now gracefully skip instead of failing the entire CI build
- REVERT conditional E2E test skipping - tests must ALWAYS run - Fix EnsureDevice node test to mock BrowserStack hub health check - Tests now properly mock checkAppiumHealth() to prevent timeout - Add founder rule: NO TEST SKIPPING ALLOWED - all tests must pass - CI now requires ALL secrets (Encore + BrowserStack) to pass - Update QA Taskfile to remove fallback qa:all:no-e2e task - Update founder rules to enforce test discipline - All backend tests now pass (47 passed, 16 skipped)
| input.deviceConfiguration.deviceName, | ||
| ), | ||
| ); | ||
| events.push(createAppiumHealthCheckStartedEvent(input.runId, sequence++, 443)); // HTTPS port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const offlineError = new Error(deviceCheck.error || "Device offline"); | ||
| offlineError.name = "DeviceOfflineError"; | ||
| throw offlineError; | ||
| const hubError = new Error(healthCheck.error || "BrowserStack hub not available"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add CI environment variable check to skip APK pre-upload when CI=true - Pass CI=true to backend in GitHub Actions workflow - Backend still connects to BrowserStack hub with credentials - Prevents timeout during backend startup in CI - E2E tests can now use pre-uploaded APKs or local paths Note: Local E2E tests may still fail due to BrowserStack not being configured locally. In CI, ensure BrowserStack secrets are set up properly.
| isHealthy: true, | ||
| status: 0, | ||
| }); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Appium Health Mock Interface Mismatch
The test mocks checkAppiumHealth() to return status: 0, but the AppiumHealthStatus interface doesn't have a status property - only isHealthy, statusCode, and error. While TypeScript won't error on extra properties in object literals, this creates a mock with the wrong shape that doesn't match the actual return type. The same incorrect mock appears at lines 68-71.
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Note
Replaces local Appium/device handling with BrowserStack cloud devices, updating agent nodes/adapters, env/config, CI/E2E, and docs.
EnsureDeviceandProvisionApp(pre-upload APK, passbs://app URL).CloudStoragePortand BrowserStack app-upload adapter; enhance WebDriverIO session adapter (HTTPS, path/protocol/creds parsing, default device/version, timeouts).BROWSERSTACK_*; pre-upload APK (skip in CI); stop handler closes remote session.appiumServerUrlfrom job/start API; subscription/worker use env-based context.BROWSERSTACK_USERNAME,BROWSERSTACK_ACCESS_KEY,BROWSERSTACK_HUB_URLto backend env; frontend defaultsVITE_APPIUM_SERVER_URLto BrowserStack.mcp.json.before-taskskill/command; make@project-contextthe comprehensive discovery; enhance@after-taskwith self-improvement loop.Written by Cursor Bugbot for commit 2a10e0a. This will update automatically on new commits. Configure here.