Skip to content

refactor(parse-ci-reports): auto-detection patterns to be provided by parsers#435

Merged
neilime merged 3 commits intomainfrom
copilot/add-supported-auto-patterns
Nov 28, 2025
Merged

refactor(parse-ci-reports): auto-detection patterns to be provided by parsers#435
neilime merged 3 commits intomainfrom
copilot/add-supported-auto-patterns

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Auto-detection patterns were hardcoded in ReportPathResolver. Each parser should define which file patterns it supports.

Changes

  • BaseParser: Added getCategory() and getAutoPatterns() abstract methods, plus ReportCategory constants
  • All parsers: Implement getCategory() (test/coverage/lint) and getAutoPatterns() with their supported glob patterns
  • ParserFactory: Added getAutoPatternsMap(), getAutoPatternsByCategory(), getAllAutoPatterns() to aggregate patterns from parsers
  • ReportPathResolver: Now delegates to ParserFactory instead of maintaining hardcoded patterns

Example

// Each parser now declares its supported patterns
export class JUnitParser extends BaseParser {
  getCategory() {
    return ReportCategory.TEST;
  }

  getAutoPatterns() {
    return [
      "**/junit*.xml",
      "**/test-results/**/*.xml",
      "**/test-reports/**/*.xml",
      "**/*test*.xml",
    ];
  }
}

Adding a new parser automatically registers its patterns for auto-detection.

Original prompt

On ReportPathResolver.js, supported auto patters should be provded by parsers.
Each parser should known which file patters it can suports


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 28, 2025 06:38
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for auto patterns by parsers in ReportPathResolver.js Refactor auto-detection patterns to be provided by parsers Nov 28, 2025
Copilot AI requested a review from neilime November 28, 2025 06:44
@neilime neilime marked this pull request as ready for review November 28, 2025 07:58
@neilime neilime changed the title Refactor auto-detection patterns to be provided by parsers refactor(parse-ci-reports): auto-detection patterns to be provided by parsers Nov 28, 2025
@neilime neilime merged commit 5e73831 into main Nov 28, 2025
32 of 33 checks passed
@neilime neilime deleted the copilot/add-supported-auto-patterns branch November 28, 2025 08:10
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