Skip to content

[Feature][Scope Config] Add Bot Account Exclusion Option for Accurate Metricsย #8646

@dmora

Description

@dmora

Search before asking

  • I searched the issues and found no similar feature request

Use case

Problem: Bot accounts (dependabot, github-actions, renovate, etc.) significantly skew DevLake metrics, particularly DORA calculations.

In our organization's deployment:

  • 28% of commits are from bots (1,763 of 6,222)
  • 17% of deployment commits are bot-generated (70 of 560)
  • Lead Time for Changes is artificially affected by automated dependency updates

The current bot handling (PR #7845) only ignores PRs where author_id=0, which doesn't cover:

  • Commits authored by *[bot] accounts
  • PRs with valid author IDs but bot-generated content (dependabot has a real GitHub account)
  • Title-pattern bot PRs ("Bump X from Y to Z")

Current workaround: Users must create MySQL views or modify every Grafana dashboard query manually, which is error-prone and doesn't persist across DevLake upgrades.

Describe the solution you'd like

Add a Bot Exclusion section to Scope Config with the following options:

1. Author Pattern Exclusion

Exclude authors matching patterns:
[ ] *[bot]
[ ] dependabot*
[ ] renovate*
[ ] github-actions*
[ ] Custom: ___________

2. Title Pattern Exclusion (for PRs)

Exclude PRs with titles matching:
[ ] Bump * from * to *
[ ] Update * from * to *
[ ] Custom regex: ___________

3. Exclusion Scope

Apply exclusion to:
[x] Commits
[x] Pull Requests
[x] DORA Metrics (deployment commits)
[ ] Issues

Implementation Suggestion

The filtering could be applied during the transformation phase (similar to how issue type mapping works) rather than at collection, allowing users to:

  1. Still collect all data for audit purposes
  2. Filter at query time via domain layer tables
  3. Toggle filtering without re-collecting data

API Example

{
  "scopeConfig": {
    "botExclusion": {
      "enabled": true,
      "authorPatterns": ["*[bot]", "dependabot*"],
      "titlePatterns": ["Bump * from * to *"],
      "applyTo": ["commits", "pull_requests", "cicd_deployment_commits"]
    }
  }
}

Related issues

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/config-uiThis issue or PR relates to config-uipriority/highThis issue is very importanttype/feature-requestThis issue is a proposal for something new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions