Skip to content

feat(dora): exclude bot/automation accounts from PR Pickup Time calcu…#9000

Open
bramhanandlingala wants to merge 1 commit into
apache:mainfrom
bramhanandlingala:fix/#8974
Open

feat(dora): exclude bot/automation accounts from PR Pickup Time calcu…#9000
bramhanandlingala wants to merge 1 commit into
apache:mainfrom
bramhanandlingala:fix/#8974

Conversation

@bramhanandlingala

@bramhanandlingala bramhanandlingala commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #8974.

AI-powered code review bots (such as GitHub Copilot, Dependabot, and GitHub Actions) often post comments immediately after a pull request is created. DevLake currently considers the first PR comment as the start of the review process, regardless of whether the comment is from a human or an automated account. As a result, the PR Pickup Time metric can become artificially close to zero and no longer represent the actual time taken for a human reviewer to respond.

This PR introduces bot account detection and excludes bot-generated comments when calculating the first review event.

Changes

  • Added an IsBot field to the cross-domain Account model.
  • Added a database migration to introduce the is_bot column in the accounts table with a default value of false.
  • Updated the GitHub account converter to populate IsBot using:
    • GitHub account type == "Bot" when available.
    • The [bot] login suffix as a fallback.
  • Updated the DORA batchFetchFirstReviews logic to ignore comments from bot accounts when determining the first review, ensuring PR Pickup Time and PR Review Time reflect the first human review.

Scope

This change currently supports GitHub accounts only.

For other integrations (GitLab, Bitbucket, Azure DevOps, etc.), the is_bot field defaults to false, resulting in no behavioral changes until bot detection is implemented for those providers.

Fixes #8974

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

@klesh
Could you review and approve this PR request

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.

[Question][Metrics] How to remove automation from project_pr_metrics?

1 participant