-
Notifications
You must be signed in to change notification settings - Fork 16
QA: Integration test — two-phase duplicate detection & human activity signals (#54 + #55) #102
Copy link
Copy link
Closed
Closed
Copy link
Description
Purpose
Manually verify that the two features shipped in PR #88 (merged 2026-02-25) behave correctly end-to-end on a real repository.
Background
Issue #54 — Two-phase duplicate detection with cooldown
Implemented in
internal/steps/duplicate_detector.goandinternal/steps/auto_closer.go
When the bot detects a duplicate it now:
- Phase 1 (immediate): Adds the
potential-duplicatelabel and posts a triage comment — does not close the issue. - Phase 2 (delayed): The
simili auto-closecommand (run via cron or manually) re-examines every open issue bearingpotential-duplicate. If the grace period has elapsed and no human activity was detected, it closes the issue and swaps the label toduplicate.
Configurable in .simili.yaml:
auto_close:
grace_period_hours: 72 # default: 72 hIssue #55 — Human activity detection
Implemented in
internal/steps/auto_closer.go+internal/integrations/github/client.go
hasHumanActivity() checks three signals after the potential-duplicate label was applied:
| Check | Signal | Where |
|---|---|---|
| A | 👎 or 😕 reaction by a non-bot user on the bot's triage comment | ListIssueCommentReactions |
| B | Any human comment posted after the triage report (24 h look-back for the comment search) | comment timestamp comparison |
| C | Issue reopened by a human after labeling | ListIssueEvents (type: reopened) |
If any signal is present the issue is skipped; potential-duplicate is left in place for a human to review.
Test Steps
Prerequisite
- A test GitHub repository with
simili-botinstalled and configured. .simili.yamlpresent withauto_close.grace_period_hours: 0(or use the--grace-period-minutes 1CLI flag to expire immediately).
Test 1 — Happy path: issue closed after grace period with no human activity
- Open a new issue that is clearly a duplicate of an existing one.
- Trigger the bot triage (push a comment or wait for the webhook).
- Confirm the bot posts a triage comment and only adds the
potential-duplicatelabel — issue remains open. - Wait for the grace period to elapse (or run with
--grace-period-minutes 1). - Run:
simili auto-close --repo <org/repo> --grace-period-minutes 1 - Expected: The issue is closed,
potential-duplicatelabel is removed,duplicatelabel is added, and a closing comment is posted.
Test 2 — Human activity signal A: negative reaction
- Repeat steps 1–3 from Test 1.
- React to the bot's triage comment with 👎 as a non-bot user.
- Run
simili auto-close --repo <org/repo> --grace-period-minutes 1. - Expected: Issue is not closed. Result JSON shows
skipped_humancount incremented.
Test 3 — Human activity signal B: human comment
- Repeat steps 1–3 from Test 1.
- Post a comment as a non-bot user on the issue.
- Run
simili auto-close --repo <org/repo> --grace-period-minutes 1. - Expected: Issue is not closed.
skipped_humanincremented in output.
Test 4 — Human activity signal C: issue reopened by human
- Manually close a
potential-duplicate-labeled issue, then reopen it as a human. - Run
simili auto-close --repo <org/repo> --grace-period-minutes 1. - Expected: Issue is not closed.
skipped_humanincremented.
Test 5 — Dry-run mode
- Run:
simili auto-close --repo <org/repo> --grace-period-minutes 1 --dry-run - Expected: JSON output lists processed issues with reasons but no actual changes are made on GitHub (no label changes, no close, no comment).
Test 6 — Unit tests (automated)
go test ./internal/steps/... -run "TestIsBotComment|TestHasNegativeReaction|TestReopenedByHuman" -v
go test ./...Expected: All tests pass, no race conditions (go test -race ./...).
References
- Closes / verifies: Enhancement: Two-phase duplicate detection with cooldown period #54, Enhancement: Human activity detection for duplicate review #55
- Implemented in: PR feat(auto-closer): expand human activity detection (issues #54 & #55) #88 (merged 2026-02-25) — feat(auto-closer): expand human activity detection (issues #54 & #55) #88
- Key files:
internal/steps/auto_closer.go— grace period logic,hasHumanActivity()internal/steps/duplicate_detector.go:108— Phase 1 label-only behaviourinternal/integrations/github/client.go—ListIssueCommentReactionscmd/simili/commands/auto_close.go— CLI entry point.github/workflows/e2e-test.yml— automated E2E coverage (steps 7b, 11b)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done