Skip to content

feat(accessibility): read an Automate build or session link's accessibility issues - #498

Closed
Aaryan430 wants to merge 5 commits into
browserstack:mainfrom
Aaryan430:feat/a11y-automate-links
Closed

Aaryan430 wants to merge 5 commits into
browserstack:mainfrom
Aaryan430:feat/a11y-automate-links

Conversation

@Aaryan430

Copy link
Copy Markdown
Collaborator

Stacked on #496 (which is stacked on #494). GitHub can't stack a PR on a fork branch, so the first four commits here are theirs. Review only the last commit, c4bab51; the diff shrinks to it as #494 and #496 merge.

"Show me the accessibility issues from Automate build <link>" had no route. The Accessibility API takes only its own build id and answers an Automate build id with 404 "Build not found", and nothing in the MCP mapped one to the other.

The mapping. A session run through the BrowserStack SDK belongs to the SDK's build, whose id is also the Accessibility build id. The session's test-code record names it as build_uuid:

GET {automation API}/ext/v1/sessions/{session_id}/testCode (public, basic auth; already used by the self-heal tools and in the TRA capability index as get_session_test_code)

So reportUrl now also takes:

Link Resolution Calls
Automate session (…/builds/{build}/sessions/{session}) session → build_uuid 1, + 1 to confirm the build has accessibility results
Automate build (…/builds/{build}) any session of the build (sessions.json?limit=1) → build_uuid 2, + 1

The resolved build then goes through #496's build export, so the count, duplicate folding, CSV link and paging are unchanged. A session link reads the whole build's issues; the tool description says so.

Failures say what happened instead of surfacing as a bare 404 from the export:

Case Message
Session not run through the SDK (testCode 404) not linked to a BrowserStack SDK build, so it has no accessibility results
SDK run without accessibility testing (Accessibility API 404 on the build) the run's build has no accessibility results: accessibility testing was not on for it
Unknown Automate build No Automate build with id …

The Automated Tests 404 hint (wrong kind of build id) now points at passing the Automate link as reportUrl.

Verification

Ran this branch's build against the real API:

reportUrl Result
Automate build link of an SDK run with accessibility Resolved to its Accessibility build: 182 issues, 66 duplicates folded (~9 s)
Automate session link from that build Same build and issues (~5 s)
Automate build of an SDK run without accessibility "…accessibility testing was not on for it"
Automate build whose session didn't use the SDK "…not linked to a BrowserStack SDK build…"
Unknown Automate build id "No Automate build with id …"

New tests cover both link shapes and the three failure cases; npm run build (lint, format, 1332 tests, tsc) passes.

Not in this PR: reading only one session's test (rather than its whole build). The build's testRuns tree links a session to its Accessibility test case (retries[].uuid), but how retried tests map sessions to attempts is unverified.

🤖 Generated with Claude Code

Aaryan430 and others added 5 commits October 19, 2026 15:00
The issues export has a row for every occurrence. In a grouped report each
repeated occurrence carries a "Duplicate Issue of" link to its main issue, and
the dashboard leaves those rows out of its issue count. startAccessibilityScan
and fetchAccessibilityIssues counted every row, so a scan the dashboard shows
as 79 issues was reported as "We found 122 issues".

The parser now returns main issues only, folds each duplicate into the issue
its link points at (duplicate_count), and returns how many duplicates it left
out; both tools state that number next to the total. A duplicate whose main
issue cannot be identified is counted only there. Reports without the
"Duplicate Issue of" column are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scan and issue tools return one text block per message. A client that
joins the blocks with no separator (Claude Code does) runs the report link
into the next block's first word: "...&Key-Pair-Id=KWDR32L2KWU1BWe found 122
issues". The key pair id is opaque, so an agent copying the link takes the
"W" with it and the download fails with 403 InvalidKey. Each block now ends
with a newline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…low Analyzer reports

fetchAccessibilityIssues read only Website Scanner runs, so an agent that ran
an SDK test with accessibility on, or was handed a Workflow Analyzer report,
had no way to read its issues. The API already exports both the same way as a
scan run: start a CSV export, poll the same route with the task id, download
the link. Only the route and its parameter names differ.

The tool now takes exactly one source: scanId with scanRunId, buildId (the
Accessibility build id, thBuildId in the report link), or workflowReportId.
The fetcher builds each source's export URLs; the parser, duplicate folding
and paging are unchanged. A build the API does not find (the Automate build
id is one) gets a message naming the id to pass instead, and the next-page
hint repeats the source's own arguments.

Rows now carry affected_page, since builds and Workflow Analyzer reports span
several pages, and source_test when the export has a "Source test" column
(Automated Tests builds).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…V link

An agent handed a dashboard report link had to find the ids itself, and
fetchAccessibilityIssues returned parsed issues but not the CSV. Both
now go through the tool.

reportUrl takes a Website Scanner or Automated Tests report link. An
Automated Tests link carries its build id. A Website Scanner link carries
one run's thBuildId, which only the scan list can map to ids: each scan
there carries its latest run's link, so the newest scans are walked
(15 pages) for a match. A link to an older run is reported as such, with
the scan's id, rather than guessed at. The list is walked at its default
page size: at limit=50 or 100 its cursor skips scans.

Every answer now includes the CSV's download link, as startAccessibilityScan
already does. When a link was resolved the answer says to what, and the
next-page hint uses the ids, so later pages skip the lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bility issues

"Show me the accessibility issues from Automate build <link>" had no route:
the Accessibility API takes only its own build id and answers an Automate
build id with 404, and nothing mapped one to the other.

A session run through the BrowserStack SDK belongs to the SDK's build, whose
id is also the Accessibility build id, and the session's test-code record
(GET /ext/v1/sessions/{id}/testCode, already used for self-healing) names it
as build_uuid. So reportUrl now takes an Automate session link (one call) or
build link (one more call, for any of its sessions) and reads that build's
issues through the existing build export.

A session not run through the SDK, an SDK run without accessibility testing
(a build the Accessibility API does not know) and an unknown Automate build
each get their own message instead of a bare 404, and the Automated Tests
404 hint now points at passing the Automate link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Central YAML (base), Organization UI (inherited), Workspace UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 24200208-5db4-4ada-8e9d-9096abf4ac9a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Aaryan430

Copy link
Copy Markdown
Collaborator Author

Superseded by #502, the same change raised from a branch in this repo instead of a fork, so the stacked PRs show only their own changes.

@Aaryan430 Aaryan430 closed this Oct 21, 2026
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