Use detection aliases instead of combinedTestOnly for pure-union detections#248
Closed
Use detection aliases instead of combinedTestOnly for pure-union detections#248
combinedTestOnly for pure-union detections#248Conversation
…ctions Agent-Logs-Url: https://github.com/refined-github/github-url-detection/sessions/a7425e61-86ef-436f-9a22-a99efdc050e1 Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
fregante
April 30, 2026 19:23
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usingcombinedTestOnly.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 ofcombinedTestOnly. For example:The aliases expand recursively via
getTests()incollector.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
combinedTestOnlyhasRepoHeader— defined asisRepo(url) && !isRepoSearch(url), which is a subset ofisRepo, not a pure union. Using aliases here would fail the negative tests forisRepoSearchURLs.Result
Tests: 21320 passed (up from 18073 — 3247 new tests)