Skip to content

feat(dora): link an incident to its component's deployment - #9413

Merged
klesh merged 1 commit into
apache:mainfrom
KennethWKZ:feat/dora-incident-component
Nov 19, 2026
Merged

klesh merged 1 commit into
apache:mainfrom
KennethWKZ:feat/dora-incident-component

Conversation

@KennethWKZ

@KennethWKZ KennethWKZ commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ConnectIncidentToDeployment ties every incident to the latest successful production deployment of the whole project before the incident started. In a project with many repositories, that is often an unrelated repository that happened to deploy last, so change failure rate and the project's incident-to-deployment links point at the wrong release.

This PR uses the incident's component when it matches a CI/CD scope of the project, by the scope's name (such as owner/repo) or its id, case-insensitive. Only that scope's production deployments are then considered. If the component matches no scope, or that scope has no earlier production deployment, the project-wide lookup runs as before. So incidents without a component, or with a component that is not a repository (a Jira component, for example), behave exactly as today.

A webhook incident can set component already, so no API change is needed: a team that knows which repository caused an incident sends it as component and the incident lands on that repository's release.

Does this close any open issues?

No open issue. Found on a multi-repository project: an incident caused by one service's release was tied to another service's deploy a few minutes later.

Screenshots

Not applicable (subtask logic and a test).

Other Information

Tested:

  • New e2e case TestConnectIncidentToDeploymentByComponentDataFlow covers a match by scope name, by name in another case, by scope id, an unknown component, no component, a scope whose latest deployment is older than the project's, and a scope with no deployment before the incident (falls back to the project-wide lookup). The existing TestConnectIncidentToDeploymentDataFlow is unchanged and passes.
  • The new case fails against the previous connector.
  • plugins/dora tests pass on MySQL 8.4 and PostgreSQL 18.
  • Running on a PostgreSQL deployment: after re-sending incidents with a component and running the project's blueprint, each incident links to the release of its own repository (the no-component path is covered by the e2e case above).

Suggested label: pr-type/feature-development.

ConnectIncidentToDeployment ties every incident to the latest successful
production deployment of the whole project before the incident started. In a
project with many repositories that is often an unrelated repository that
happened to deploy last, so change failure rate and failed deployment recovery
time point at the wrong release.

When an incident's component matches a CI/CD scope of the project (its name,
such as "owner/repo", or its id, case-insensitive), only that scope's
production deployments are considered. If the component matches no scope, or
that scope has no earlier production deployment, the project-wide lookup is
used as before, so no incident loses its deployment and incidents without a
component behave exactly as today.

@klesh klesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Could you also update the website document to reflect the change?
Thanks in advance.

@klesh
klesh merged commit 9ee3c30 into apache:main Nov 19, 2026
10 checks passed
@KennethWKZ

Copy link
Copy Markdown
Contributor Author

@klesh Thanks for the review. Docs update is up: apache/devlake-website#840

It covers the webhook plugin page (how incidents relate to deployments, and the component field), Change Failure Rate, and the incidents component description in the domain layer schema. Only docs/ (next) is changed, since this isn't in a release yet.

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