Skip to content

Conversation

@rodrigoluizs
Copy link
Member

⚠️ Pre Checklist

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation.
  • I will add labels to the PR, such as pr-type/feature-development.

Summary

This PR introduces bot filtering support to the DORA plugin. It adds two new environment variables:

  • ENABLE_BOT_FILTERING: Enables or disables bot filtering for DORA metrics.
  • BOT_FILTERING_PATTERN: A regular expression used to match bot author names (e.g., .*Bot|Renovate|Dependabot.*).

When enabled, the system will populate a new field IsAuthoredByBot in project_pr_metrics, which can be used to exclude bot-generated pull requests from DORA calculations.


Does this close any open issues?


Screenshots

N/A


Other Information

  • A new migration is included to add the is_authored_by_bot column to the project_pr_metrics table.
  • This feature is opt-in and configurable via .env.

…ering

Register migration script and update model as part of apache#8381
Introduce ENABLE_BOT_FILTERING and BOT_FILTERING_PATTERN to
enable exclusion of bot-authored changes (e.g., Renovate, Dependabot).
…nv-defined pattern

Use ENABLE_BOT_FILTERING and BOT_FILTERING_PATTERN to flag PRs
authored by bots during change lead time calculation.
@rodrigoluizs rodrigoluizs force-pushed the rodrigoluizs/feat-dora-bot-filtering branch from 15345a1 to 75ce65f Compare June 17, 2025 12:49
var plugin impl.Dora
dataflowTester := e2ehelper.NewDataFlowTester(t, "dora", plugin)

t.Setenv("ENABLE_BOT_FILTERING", "true")
Copy link
Member Author

Choose a reason for hiding this comment

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

The feature is supposed to be be opt-in, thus by default these 2 variables are not set and the whole filtering is skipped.

I'm setting these env vars in the test to be able to test it in the integration tests, but I'm not sure if that's the best way to test it.

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.

2 participants