You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The close_older_issues and close_older_discussions handlers implement near-identical marker-based query construction and exact-marker filtering logic, with only API transport differences (REST vs GraphQL) and entity-specific fields.
This creates a high-maintenance duplication hotspot: behavior changes to close-older matching now require parallel edits in two large files.
Critical Information
Severity: High
Duplication type: Structural duplication
Occurrences: 2 primary implementations
Estimated duplicated logic: >80 lines of equivalent control flow and filtering
Overview
The
close_older_issuesandclose_older_discussionshandlers implement near-identical marker-based query construction and exact-marker filtering logic, with only API transport differences (REST vs GraphQL) and entity-specific fields.This creates a high-maintenance duplication hotspot: behavior changes to close-older matching now require parallel edits in two large files.
Critical Information
d1c210e8581deb8ab71d26a678876a3e45065465Duplication Details
Pattern
Marker-based close-older search and exact body-marker filtering are repeated with similar branching and logging:
searchQuery+exactMarkerbased oncloseOlderKeyvs workflow-id markerexcludeNumber, marker exact-match, additional entity-specific checks)Locations
actions/setup/js/close_older_issues.cjs:34actions/setup/js/close_older_issues.cjs:47actions/setup/js/close_older_issues.cjs:78actions/setup/js/close_older_discussions.cjs:37actions/setup/js/close_older_discussions.cjs:50actions/setup/js/close_older_discussions.cjs:99Representative duplicated structure
if (closeOlderKey) { ... } else { ... }issuesAndPullRequests) vs GraphQL (search(type: DISCUSSION))body.includes(exactMarker)matchImpact Analysis
Refactoring Recommendations
actions/setup/js/close_older_search_helpers.cjsImplementation Checklist
Analysis Metadata
.go/.cjsfiles in latest commit scopeReferences:
Warning
The following domains were blocked by the firewall during workflow execution:
ab.chatgpt.comapi.github.comchatgpt.comgithub.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.