Skip to content

QA: Integration test — two-phase duplicate detection & human activity signals (#54 + #55) #102

@Sachindu-Nethmin

Description

@Sachindu-Nethmin

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.go and internal/steps/auto_closer.go

When the bot detects a duplicate it now:

  • Phase 1 (immediate): Adds the potential-duplicate label and posts a triage comment — does not close the issue.
  • Phase 2 (delayed): The simili auto-close command (run via cron or manually) re-examines every open issue bearing potential-duplicate. If the grace period has elapsed and no human activity was detected, it closes the issue and swaps the label to duplicate.

Configurable in .simili.yaml:

auto_close:
  grace_period_hours: 72   # default: 72 h

Issue #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-bot installed and configured.
  • .simili.yaml present with auto_close.grace_period_hours: 0 (or use the --grace-period-minutes 1 CLI flag to expire immediately).

Test 1 — Happy path: issue closed after grace period with no human activity

  1. Open a new issue that is clearly a duplicate of an existing one.
  2. Trigger the bot triage (push a comment or wait for the webhook).
  3. Confirm the bot posts a triage comment and only adds the potential-duplicate label — issue remains open.
  4. Wait for the grace period to elapse (or run with --grace-period-minutes 1).
  5. Run: simili auto-close --repo <org/repo> --grace-period-minutes 1
  6. Expected: The issue is closed, potential-duplicate label is removed, duplicate label is added, and a closing comment is posted.

Test 2 — Human activity signal A: negative reaction

  1. Repeat steps 1–3 from Test 1.
  2. React to the bot's triage comment with 👎 as a non-bot user.
  3. Run simili auto-close --repo <org/repo> --grace-period-minutes 1.
  4. Expected: Issue is not closed. Result JSON shows skipped_human count incremented.

Test 3 — Human activity signal B: human comment

  1. Repeat steps 1–3 from Test 1.
  2. Post a comment as a non-bot user on the issue.
  3. Run simili auto-close --repo <org/repo> --grace-period-minutes 1.
  4. Expected: Issue is not closed. skipped_human incremented in output.

Test 4 — Human activity signal C: issue reopened by human

  1. Manually close a potential-duplicate-labeled issue, then reopen it as a human.
  2. Run simili auto-close --repo <org/repo> --grace-period-minutes 1.
  3. Expected: Issue is not closed. skipped_human incremented.

Test 5 — Dry-run mode

  1. Run: simili auto-close --repo <org/repo> --grace-period-minutes 1 --dry-run
  2. 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

Metadata

Metadata

Labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions