From 8709ebe165815889c2e5af21a7ee0cf5fb790c26 Mon Sep 17 00:00:00 2001 From: Kenneth Wong <17061293+KennethWKZ@users.noreply.github.com> Date: Fri, 20 Nov 2026 02:05:27 +0800 Subject: [PATCH] docs(dora): relate an incident to its component's deployment Document apache/devlake#9413: when an incident's component matches a CI/CD scope of the project (by name such as owner/repo, or id, case-insensitive), DORA relates the incident to that scope's last production deployment before it; otherwise the project-wide rule applies. Updates the webhook plugin page, Change Failure Rate and the incidents table. --- docs/DataModels/DevLakeDomainLayerSchema.md | 2 +- docs/Metrics/CFR.md | 2 ++ docs/Plugins/webhook.md | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/DataModels/DevLakeDomainLayerSchema.md b/docs/DataModels/DevLakeDomainLayerSchema.md index 7f6cda28cb9..21a5224503d 100644 --- a/docs/DataModels/DevLakeDomainLayerSchema.md +++ b/docs/DataModels/DevLakeDomainLayerSchema.md @@ -285,7 +285,7 @@ An `incidents` is the abstraction of data sources' incidents. | `original_status` | varchar | 100 | The original status of an incident. | | | `priority` | varchar | 255 | The priority of the incident | | | `urgency` | varchar | 255 | The urgency of the incident | | -| `component` | varchar | 255 | The component a bug-incident affects. This field only supports Github plugin for now. The value is transformed from Github issue labels by the rules set according to the user's configuration of .env by end users during DevLake installation. | | +| `component` | varchar | 255 | The component a bug-incident affects. From the GitHub plugin, the value is transformed from GitHub issue labels by the rules set according to the user's configuration of .env by end users during DevLake installation; webhook incidents can set it directly. When it matches the name or id of one of the project's CI/CD scopes, the DORA plugin relates the incident to that scope's deployments. | | | `severity` | varchar | 255 | The severity level of a bug-incident. This field only supports Github plugin for now. The value is transformed from Github issue labels by the rules set according to the user's configuration of .env by end users during DevLake installation. | | | `parent_incident_id` | varchar | 255 | The id of its parent incident | | | `original_estimate_minutes` | int | | The original estimation of the time allocated for this incident | | diff --git a/docs/Metrics/CFR.md b/docs/Metrics/CFR.md index 0634123a241..478cb5e9742 100644 --- a/docs/Metrics/CFR.md +++ b/docs/Metrics/CFR.md @@ -25,6 +25,8 @@ The number of deployments affected by incidents/total number of deployments. For When there are multiple deployments triggered by one pipeline, tools like GitLab and BitBucket will generate more than one deployment. In these cases, DevLake will consider these deployments as ONE deployment and use the last deployment's finished date as the deployment finished date. +An incident is related to the last successful production deployment of the project that finished before the incident was created. If the incident's `component` matches one of the project's CI/CD scopes, by name (such as `owner/repo`) or id, case-insensitive, only that scope's deployments are considered, so in a project with several repositories the incident counts against the release of the repository that caused it. If the component matches no scope, or that scope has no earlier production deployment, the project-wide rule applies. + Below are the 2023 DORA benchmarks for different development teams from Google's report. However, it's difficult to tell which group a team falls into when the team's change failure rate is between 15% and 64%. Therefore, DevLake provides its own benchmarks to address this problem: | Groups | Benchmarks | DevLake Benchmarks | diff --git a/docs/Plugins/webhook.md b/docs/Plugins/webhook.md index cfaa44d057c..43523fc6483 100644 --- a/docs/Plugins/webhook.md +++ b/docs/Plugins/webhook.md @@ -14,6 +14,8 @@ In v0.14+, users can push "incidents" and "deployments" required by DORA metrics Webhooks are meant to be used at the lowest level that you want to relate incidents with deployments. For example, if you want to relate incidents at the individual service level, you will need a webhook per service. If you wish to relate incidents at the product level, you will need a webhook for the product. This is because incidents on a project will be related to the last deployment on the project with a timestamp that is before the incident's timestamp. This is true regardless of the source of incidents or deployments. +If an incident's `component` matches one of the project's CI/CD scopes, by the scope's name (such as `owner/repo`) or its id, case-insensitive, only that scope's production deployments are considered. This lets a project with several repositories relate an incident to the release of the repository that caused it, instead of to whichever repository deployed last. If the component matches no scope, or that scope has no production deployment before the incident, the project-wide rule above applies. + Note: If you post incidents using webhook due to your tool not being supported but your deployments are collected via plugins automatically, you need to re-collect data for deployments for the posted incidents to get mapped to deployments based on timestamps. This is required for Change Failure Rate (DORA) metric to show up correctly for the project. Diagram of the relationship between incidents and deployments: @@ -208,7 +210,7 @@ needs to be called when an issue or incident is created. The body should be a JS | assigneeId | ✖️ No | | | assigneeName | ✖️ No | | | severity | ✖️ No | | -| component | ✖️ No | | +| component | ✖️ No | For an incident: the CI/CD scope that caused it, by name (such as `owner/repo`) or id. DORA then relates the incident to that scope's last production deployment before it. See [Summary](#summary). | More information about these columns at the [domain layer issues table](/DataModels/DevLakeDomainLayerSchema.md#issues).