Skip to content

refactor(github): drop dead CommentList field from ghIssue - #116

Merged
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-alert-triage-98/issue-98
Sep 5, 2026
Merged

refactor(github): drop dead CommentList field from ghIssue#116
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-alert-triage-98/issue-98

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

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).

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>

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. ghIssue structCommentList []ghIssueComment removed (tagged json:"-", was never populated)
  2. ghIssueComment type — removed entirely (was unreferenced after the field removal)
  3. shouldComment function — reduced from len(existing.CommentList) == 0 && existing.Comments == 0 to existing.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.CommentList removed
  • ghIssueComment type removed
  • shouldComment rewritten as if existing.Comments == 0 { return true }
  • ✅ Only github.go changed (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 shouldComment comment explaining the first-fire gate remains intact
  • File scope respected — changes confined to github.go as the issue specified

CI Results

Both checks passed:

  • test — success
  • docker — success

Findings

No blockers, majors, or minors identified.

@joryirving
joryirving merged commit 1deb222 into main Sep 5, 2026
3 checks passed
@joryirving
joryirving deleted the foreman/wl-misospace-alert-triage-98/issue-98 branch September 5, 2026 12:51
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.

[P3] github.go ghIssue.CommentList is declared but never populated, so shouldComment's first-comment gate reduces to Comments==0

2 participants