Skip to content

Use detection aliases instead of combinedTestOnly for pure-union detections#248

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/update-url-detection-aliases
Closed

Use detection aliases instead of combinedTestOnly for pure-union detections#248
Copilot wants to merge 1 commit intomainfrom
copilot/update-url-detection-aliases

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Following PR #247 (which converted isRepo's test URLs to use detection-name aliases), this PR does the same for every detection whose test suite was previously using combinedTestOnly.

What changed

Any detection that is a pure logical OR of sub-detections now lists those sub-detection names as aliases in its addTests() call instead of combinedTestOnly. For example:

// Before
TEST: addTests('isIssueOrPRList', combinedTestOnly);

// After
TEST: addTests('isIssueOrPRList', [
  'isIssueList',
  'isPRList',
]);

The aliases expand recursively via getTests() in collector.ts, so all positive and negative URL tests are now fully exercised.

Detections updated (15)

  • isCommitList['isRepoCommitList', 'isPRCommitList']
  • isGlobalIssueOrPRList['isGlobalPRList', 'isGlobalIssueList']
  • isIssueList['isRepoIssueList', 'isGlobalIssueList', 'isMilestone']
  • isIssueOrPRList['isIssueList', 'isPRList']
  • isConversation['isIssue', 'isPRConversation']
  • isPRList['isRepoPRList', 'isGlobalPRList']
  • hasFileEditor['isEditingFile', 'isNewFile', 'isDeletingFile']
  • hasReleaseEditor['isEditingRelease', 'isNewRelease']
  • hasWikiPageEditor['isEditingWikiPage', 'isNewWikiPage']
  • isRepoIssueOrPRList['isRepoPRList', 'isRepoIssueList', 'isRepoTaxonomyIssueOrPRList']
  • hasRenderedText['isRepoRoot', 'isRenderedTextFile']
  • hasComments['isPR', 'isIssue', 'isCommit', 'isTeamDiscussion', 'isSingleGist']
  • hasRichTextEditor['hasComments', 'isNewIssue', 'isCompare', 'isRepliesSettings', 'hasReleaseEditor', 'isDiscussion', 'isNewDiscussion']
  • hasCode['hasComments', 'isRepoTree', 'isRepoSearch', 'isGlobalSearchResults', 'isSingleFile', 'isGist', 'isCompare', 'isCompareWikiPage', 'isBlame']
  • hasFiles['isCommit', 'isCompare', 'isPRFiles']

Kept as combinedTestOnly

  • hasRepoHeader — defined as isRepo(url) && !isRepoSearch(url), which is a subset of isRepo, not a pure union. Using aliases here would fail the negative tests for isRepoSearch URLs.

Result

Tests: 21320 passed (up from 18073 — 3247 new tests)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants