Skip to content

Self heal session#282

Open
vipin-bs wants to merge 8 commits into
browserstack:mainfrom
vipin-bs:self-heal-session
Open

Self heal session#282
vipin-bs wants to merge 8 commits into
browserstack:mainfrom
vipin-bs:self-heal-session

Conversation

@vipin-bs
Copy link
Copy Markdown
Collaborator

No description provided.

- Added interfaces for healing logs and reports in selfheal-utils.
- Implemented fetchSelfHealingReportByBuild to retrieve self-healing reports from BrowserStack.
- Introduced flattenHealedSelectors to simplify selector extraction from reports.
- Enhanced getSelfHealSelectors to support fetching test code alongside selectors.
- Created prepareSelfHealingPlanTool to generate structured plans for applying healed selectors.
- Added input validation and error handling for self-healing tools.
- Implemented tests for fetchSelfHealSelectorTool and prepareSelfHealingPlanTool to ensure functionality and error messaging.
- Included handling for various input shapes and credential requirements in the tools.
Copy link
Copy Markdown
Contributor

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

Expands the self-heal tooling to support build-scoped self-healing reports and enrich responses with per-session test source code, plus adds a new “plan preparation” tool to help the calling LLM apply locator edits safely.

Changes:

  • Add buildUuid mode to fetchSelfHealedSelectors, including fetching the build self-healing report + test-code context and emitting a prominent warning banner when test code is unavailable.
  • Introduce prepareSelfHealingPlan tool to normalize multiple input shapes and generate a structured plan (with optional test-code enrichment) without modifying files.
  • Add new Observability test-code fetch utilities and auth override resolution; update self-heal log parsing to support both Automate and App Automate sessions.

Reviewed changes

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

Show a summary per file
File Description
tests/tools/selfheal.test.ts Adds comprehensive unit tests for new validation paths, plan output, banner ordering, and fetch-issues guidance text.
src/tools/selfheal.ts Implements buildUuid/sessionId modes, warning banners, session normalization, and registers the new prepareSelfHealingPlan MCP tool.
src/tools/selfheal-utils/selfheal.ts Adds build-scoped self-healing report fetch + report types; updates session log parsing to capture locator types and support app-automate.
src/tools/selfheal-utils/fetch-test-code.ts New helper module to fetch test code per session, classify outcomes, and format context + LLM guidance notes.
src/lib/get-auth.ts Adds resolveBrowserStackAuth to safely merge arg overrides with server config and avoid hard failures when creds are absent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tools/selfheal.ts
Comment thread src/tools/selfheal.ts Outdated
Copy link
Copy Markdown
Collaborator

@ruturaj-browserstack ruturaj-browserstack left a comment

Choose a reason for hiding this comment

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

Check copilot comments as well , they are relevant

Comment thread src/lib/get-auth.ts Outdated
Comment thread src/tools/selfheal.ts Outdated
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.

3 participants