Skip to content

Match axe findings by rule and report all failing elements#240

Open
kzhou314 wants to merge 2 commits into
mainfrom
robust-finding-fingerprint
Open

Match axe findings by rule and report all failing elements#240
kzhou314 wants to merge 2 commits into
mainfrom
robust-finding-fingerprint

Conversation

@kzhou314

Copy link
Copy Markdown
Contributor

Closes https://github.com/github/accessibility/issues/10754

Axe findings were fingerprinted on a single element's exact HTML, so a small DOM shift changed the key and re-filed issues that were already tracked. Instead, we match axe findings by url + ruleId instead of HTML, so re-scans re-link to the existing issue even when surrounding markup changes. Moreover, we capture every element that fails a rule (not just the first) and list them all in the issue body.

@kzhou314 kzhou314 requested a review from a team as a code owner June 22, 2026 23:53
GitHub Advanced Security started work on behalf of kzhou314 June 22, 2026 23:54 View session
@kzhou314 kzhou314 requested a review from JoyceZhu June 22, 2026 23:54
GitHub Advanced Security finished work on behalf of kzhou314 June 22, 2026 23:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves how accessibility scan findings (especially axe violations) are correlated to existing GitHub issues by using a more stable identity (url + ruleId) and expands reporting so a single rule-level issue can include all failing elements on a page.

Changes:

  • Add nodes to axe findings to capture all elements failing a given axe rule.
  • Update filing/matching logic so axe findings are keyed by url + ruleId rather than element HTML.
  • Update issue body generation and tests to list multiple failing elements for a rule.
Show a summary per file
File Description
tests/types.d.ts Extends test-side Finding typing to include per-finding nodes.
tests/site-with-errors.test.ts Adds assertions ensuring axe findings include populated nodes aligned with finding.html.
.github/actions/find/tests/findForUrl.test.ts Adds coverage ensuring axe violations capture all failing nodes into Finding.nodes.
.github/actions/find/src/types.d.ts Extends action Finding typing to include FindingNode[].
.github/actions/find/src/findForUrl.ts Populates Finding.nodes from axe violation nodes during scanning.
.github/actions/file/tests/updateFilingsWithNewFindings.test.ts Adds tests verifying axe findings remap to existing issues despite HTML shifts.
.github/actions/file/tests/generateIssueBody.test.ts Adds test asserting issue bodies list every failing node when present.
.github/actions/file/src/updateFilingsWithNewFindings.ts Updates axe finding keying to be rule-level (url + ruleId).
.github/actions/file/src/types.d.ts Extends filing-side Finding typing to include per-finding nodes.
.github/actions/file/src/generateIssueBody.ts Refactors “What” section generation to list all failing nodes when available.

Copilot's findings

Tip

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

  • Files reviewed: 7/10 changed files
  • Comments generated: 2

Comment thread .github/actions/find/tests/findForUrl.test.ts
Comment thread .github/actions/file/src/generateIssueBody.ts
GitHub Advanced Security started work on behalf of kzhou314 June 23, 2026 00:01 View session
GitHub Advanced Security finished work on behalf of kzhou314 June 23, 2026 00:01
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.

2 participants