Skip to content

chore: enhance bot report summary#15175

Merged
mnkiefer merged 1 commit intomainfrom
enhance-bot-report
Feb 12, 2026
Merged

chore: enhance bot report summary#15175
mnkiefer merged 1 commit intomainfrom
enhance-bot-report

Conversation

@mnkiefer
Copy link
Contributor

@mnkiefer mnkiefer commented Feb 12, 2026

  • Improves how user account ages are checked and by expanding the detection scope.
  • Changes also add better tracking and reporting of the detection process.

@mnkiefer mnkiefer self-assigned this Feb 12, 2026
Copilot AI review requested due to automatic review settings February 12, 2026 14:24
@mnkiefer mnkiefer merged commit a43d52d into main Feb 12, 2026
72 checks passed
@mnkiefer mnkiefer deleted the enhance-bot-report branch February 12, 2026 14:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the bot detection workflow by expanding the detection scope and improving reporting. The changes refactor user account age checking into a reusable function, add tracking for issue creators (not just PR commenters), and provide more detailed summary information including the number of accounts checked and lookup failures.

Changes:

  • Refactored user account age checking into a reusable ensureUserCreatedDate() function to eliminate code duplication
  • Extended detection scope to include issue creators via listForRepo API, catching bot accounts that only create issues/PRs without commenting
  • Added tracking for accounts seen and user lookup failures, providing transparency in the detection process

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +145 to +151
const { data: recentIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all',
since: cutoff.toISOString(),
per_page: 100,
});
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The new issue listing code doesn't use pagination like the PR listing does (lines 36-58). With per_page: 100, this will only check the first 100 items. In active repositories with more than 100 issues/PRs in the last 6 hours, newer accounts that only created issues beyond the first 100 would be missed.

Consider using pagination similar to the PR listing pattern to ensure all recent issues are checked.

Suggested change
const { data: recentIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all',
since: cutoff.toISOString(),
per_page: 100,
});
const recentIssues = await github.paginate(
github.rest.issues.listForRepo,
{
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all',
since: cutoff.toISOString(),
per_page: 100,
}
);

Copilot uses AI. Check for mistakes.
});

for (const issue of recentIssues) {
await ensureUserCreatedDate(issue.user?.login);
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The github.rest.issues.listForRepo API returns both issues and pull requests. Since PR creators are already being checked at line 82, this code will redundantly check PR creators again. Additionally, this could cause incorrect counting in the accountsSeen metric since the same user would be processed twice (once as PR creator, once via listForRepo).

Consider filtering out pull requests by checking for the pull_request property, similar to the pattern used at line 199:

for (const issue of recentIssues) {
  if (!issue.pull_request) {  // Only process actual issues, not PRs
    await ensureUserCreatedDate(issue.user?.login);
  }
}
Suggested change
await ensureUserCreatedDate(issue.user?.login);
// github.rest.issues.listForRepo returns both issues and PRs; skip PRs here
if (!issue.pull_request && issue.user?.login) {
await ensureUserCreatedDate(issue.user.login);
}

Copilot uses AI. Check for mistakes.
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.

1 participant