bramhanandlingala opened a new pull request, #9000:
URL: https://github.com/apache/devlake/pull/9000
## 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.
## Testing
- Verified the project builds successfully using `go build`.
- Verified formatting with `gofmt`.
- Verified static analysis using `go vet`.
- Existing DORA end-to-end tests will validate the updated review pickup
logic in CI.
Fixes #8974
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]