Improve /check and preserve free-text report statuses#63
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Slack /check (list-missing) flow so members with imported GitLab/GitHub MR/PR activity are not incorrectly flagged as missing, by considering both Slack author_id signals and fuzzy name matches against fetched item authors.
Changes:
- Load all weekly work items for
/checkand derive a unique set of reported author names from them. - Treat a member as “reported” if their Slack user ID appears on a Slack-sourced item or their Slack profile name fuzzily matches a fetched item author.
- Add unit test coverage for the new
memberReportedThisWeekhelper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/integrations/slack/slack.go | Enhances /check missing-member detection to include fetched MR/PR activity via author-name matching and adds helper utilities. |
| internal/integrations/slack/slack_logic_test.go | Adds focused unit test for memberReportedThisWeek. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for _, uid := range memberIDs { | ||
| if reportedAuthorIDs[uid] { | ||
| user, err := api.GetUserInfo(uid) | ||
| nameCandidates := []string{uid} | ||
| if err == nil { |
There was a problem hiding this comment.
handleListMissing now calls api.GetUserInfo(uid) for every team member before checking whether they’re already reported. This adds N Slack API calls per /check and increases latency/rate-limit risk. Consider deriving nameCandidates from the existing cached users list (getCachedUsers/api.GetUsers) or only fetching user info for members that are still potentially missing after the author_id check.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| if user.Name != "" { | ||
| nameCandidates = append(nameCandidates, user.Name) | ||
| } |
There was a problem hiding this comment.
Including user.Name (Slack handle) in nameCandidates makes the fuzzy token-subset match very permissive (e.g., handle "alex" will match fetched author "Alex Rivera"), which can incorrectly mark unrelated members as reported and hide genuinely missing reports. Suggest restricting fuzzy matching to DisplayName/RealName (or requiring a minimum token count / exact-match-only for handles) to avoid false positives.
| if user.Name != "" { | |
| nameCandidates = append(nameCandidates, user.Name) | |
| } |
What changed
(no change)toAuto(resolved in session; root cause analysis in progress)Tests
go test ./...