refactor(github): drop dead CommentList field from ghIssue - #116
Merged
Conversation
ghIssue.CommentList was tagged json:"-" and no code path ever populated it (listIssues only decodes the API response), so the first-comment gate in shouldComment reduced to existing.Comments == 0 anyway. Remove the field and the now-unreferenced ghIssueComment type, and rewrite the gate to check Comments directly. Flap-control behaviour is unchanged. Fixes #98 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — primary route
Review Summary
Recommendation: Approve.
This PR cleanly removes a dead field from github.go and simplifies the shouldComment gate as requested in issue PR 98.
Change Analysis
The diff is minimal and surgical:
ghIssuestruct —CommentList []ghIssueCommentremoved (taggedjson:"-", was never populated)ghIssueCommenttype — removed entirely (was unreferenced after the field removal)shouldCommentfunction — reduced fromlen(existing.CommentList) == 0 && existing.Comments == 0toexisting.Comments == 0
The reduced condition is semantically equivalent to the original: CommentList was always empty (never assigned), so len(existing.CommentList) == 0 was a constant-true guard. The Comments field from the GitHub API already provides the correct first-comment count.
Linked Issue Fit
Issue PR 98 acceptance criteria are fully satisfied:
- ✅
ghIssue.CommentListremoved - ✅
ghIssueCommenttype removed - ✅
shouldCommentrewritten asif existing.Comments == 0 { return true } - ✅ Only
github.gochanged (10 additions, 15 deletions, net -5 lines)
Standards Compliance
No repository standards are violated:
- No new dependencies introduced — purely a removal refactor
- Go conventions followed — struct fields cleaned up consistently
- Comments preserved — the
shouldCommentcomment explaining the first-fire gate remains intact - File scope respected — changes confined to
github.goas the issue specified
CI Results
Both checks passed:
test— successdocker— success
Findings
No blockers, majors, or minors identified.
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.
Removes unpopulated CommentList field from ghIssue and updates shouldComment to check Comments count directly.
Fixes #98
Opened by foreman on review GO (workload wl-misospace-alert-triage-98).