Skip to content

Refactoring SDK Tool #101

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

tech-sushant
Copy link
Contributor

No description provided.

@Vishalan Vishalan requested a review from Copilot August 13, 2025 12:43
Copilot

This comment was marked as outdated.

@tech-sushant tech-sushant requested a review from Copilot August 13, 2025 13:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the SDK tool structure to create a more modular and organized codebase for handling BrowserStack and Percy integrations. The refactoring consolidates common utilities and separates concerns across different integration types.

Key Changes:

  • Restructured SDK utilities into modular components (percy-web, percy-automate, percy-bstack, bstack)
  • Consolidated common types, schemas, and utilities into a shared common module
  • Added new tools for Percy visual testing simulation and test file management

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tools/simulate-percy.ts New tool for simulating Percy visual changes
src/tools/sdk-utils/percy-web/*.ts Percy Web-only integration utilities
src/tools/sdk-utils/percy-automate/*.ts Percy Automate standalone utilities
src/tools/sdk-utils/percy-bstack/*.ts Percy + BrowserStack SDK combined utilities
src/tools/sdk-utils/bstack/*.ts BrowserStack SDK-only utilities
src/tools/sdk-utils/common/*.ts Shared types, schemas, and utility functions
src/tools/percy-snapshot-utils/*.ts Test file detection and Percy snapshot utilities
src/tools/*.ts Refactored tool registration files
src/server-factory.ts Updated to register new tools
Comments suppressed due to low confidence (1)

src/tools/sdk-utils/percy-bstack/constants.ts:65

  • The comment suggests 'auto' mode is available, but the code and surrounding context indicate 'manual' mode is specifically chosen for this integration. The comment should clarify why 'manual' is preferred for BrowserStack SDK integration.
- Set \`percyCaptureMode\`. The default \`manual\` as we are adding screenshot commands manually.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Have you established the baseline first (before adding visual changes)

CRITICAL:
Do NOT run tests separately or create multiple builds during baseline establishment. The goal is to have exactly TWO builds total: (1) baseline build with all original snapshots, (2) modified build with the same tests but visual changes injected.
Copy link
Preview

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

[nitpick] The instruction text contains inconsistent formatting and could be clearer. The step numbering and validation checkpoints could be better structured as a proper list rather than paragraph text.

Suggested change
Do NOT run tests separately or create multiple builds during baseline establishment. The goal is to have exactly TWO builds total: (1) baseline build with all original snapshots, (2) modified build with the same tests but visual changes injected.
4. Run a second Percy build:
- The snapshot names must remain the same as in the baseline.
- The visual change should now appear in the same snapshot as before.
- Use the same build command you ran for the baseline.
5. Compare the two Percy builds to see the detected visual difference.
**CONSTRAINTS:**
- Do NOT run any builds until explicitly instructed in the steps.
- Do NOT add new snapshot names—only use existing ones.
- Do NOT add popup injection until the baseline is established.
- Visual changes must appear in EXISTING snapshots, not new ones.
**VALIDATION CHECKPOINTS (before proceeding to the next step):**
- Are you adding only snapshot commands (not running builds)?
- Are you reusing existing snapshot names (not creating new ones)?
- Have you established the baseline first (before adding visual changes)?
**CRITICAL:**
- Do NOT run tests separately or create multiple builds during baseline establishment. The goal is to have exactly TWO builds total:
1. Baseline build with all original snapshots
2. Modified build with the same tests but visual changes injected

Copilot uses AI. Check for mistakes.

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