Skip to content

Plugin for per-sub-project DORA metrics in a monorepo - #9037

Open
eyal4D wants to merge 5 commits into
apache:mainfrom
eyal4D:feature/subprojects-for-monorepo
Open

Plugin for per-sub-project DORA metrics in a monorepo#9037
eyal4D wants to merge 5 commits into
apache:mainfrom
eyal4D:feature/subprojects-for-monorepo

Conversation

@eyal4D

@eyal4D eyal4D commented Aug 9, 2026

Copy link
Copy Markdown

Repos containing multiple logically separate projects (each deployed by its own CI job, PRs tagged by label) previously collapsed into a single set of DORA numbers, since DevLake's scope model is one-scope-per-repo.

Adds a new metric plugin, monorepo, that runs after dora and attributes deployments (by CI job name) and merged pull requests (by label) to a configured sub-project, writing per-sub-project deployment and change lead time metrics to two new tables. Nothing existing is modified: dora and the core scope model are untouched, and PR coding/pickup/review time are reused from dora's own project_pr_metrics rather than recomputed.

Includes unit tests, an e2e test with fixtures, and Grafana dashboards (mysql + postgresql) to view the output.

uriahrokach and others added 5 commits August 9, 2026 16:27
…repo

Repos containing multiple logically separate projects (each deployed by
its own CI job, PRs tagged by label) previously collapsed into a single
set of DORA numbers, since DevLake's scope model is one-scope-per-repo.

Adds a new metric plugin, monorepo, that runs after dora and attributes
deployments (by CI job name) and merged pull requests (by label) to a
configured sub-project, writing per-sub-project deployment and change
lead time metrics to two new tables. Nothing existing is modified: dora
and the core scope model are untouched, and PR coding/pickup/review
time are reused from dora's own project_pr_metrics rather than
recomputed.

Includes unit tests, an e2e test with fixtures, and Grafana dashboards
(mysql + postgresql) to view the output.
Adds a Project Settings panel for the monorepo plugin, letting users
define sub-projects (name, PR labels, deploy job pattern) directly in
config-ui rather than only via the raw API, following the existing
pattern used for the linker plugin's fields.
RunAfter() is advisory-only: core's blueprint plan builder
(GeneratePlanJsonV200) merges every enabled metric plugin's plan with
ParallelizePipelinePlans, which zips stages together by index and never
consults RunAfter. With dora and monorepo both enabled on a project,
monorepo's single stage ran concurrently with dora's first stage
instead of after dora's third stage, where project_pr_metrics and
cicd_deployment_commits actually get written — silently producing
nil coding/pickup/review times with no error.

Pads monorepo's plan with empty stages so its real work lands strictly
after dora's plan completes. This is a workaround for the unenforced
RunAfter contract, not a true fix; it's coupled to dora's current
3-stage plan (documented in the code). Adds a regression test locking
in the padded shape, and corrects the RunAfter doc comment which
previously claimed ordering was guaranteed.

Verified: fresh blueprint plan generation on the rebuilt binary shows
org -> dora(x3) -> [empty x3] -> monorepo; migration and e2e tests
pass on both MySQL and a real Postgres instance.
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