feat(dora): exclude bot/automation accounts from PR Pickup Time calcu…#9000
Open
bramhanandlingala wants to merge 1 commit into
Open
feat(dora): exclude bot/automation accounts from PR Pickup Time calcu…#9000bramhanandlingala wants to merge 1 commit into
bramhanandlingala wants to merge 1 commit into
Conversation
Contributor
Author
|
@klesh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Timemetric 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
IsBotfield to the cross-domainAccountmodel.is_botcolumn in theaccountstable with a default value offalse.IsBotusing:type == "Bot"when available.[bot]login suffix as a fallback.batchFetchFirstReviewslogic to ignore comments from bot accounts when determining the first review, ensuringPR Pickup TimeandPR Review Timereflect the first human review.Scope
This change currently supports GitHub accounts only.
For other integrations (GitLab, Bitbucket, Azure DevOps, etc.), the
is_botfield defaults tofalse, resulting in no behavioral changes until bot detection is implemented for those providers.Fixes #8974