[Feature][dora] Support DORA metrics
Search before asking
- [X] I had searched in the issues and found no similar feature requirement.
Description
The DORA metrics are very popular these days, but they are quite complicated to calculate. In order to support DORA metrics, I suggest that we create a set of plugins to do the job.
- The
webhookplugins https://github.com/apache/incubator-devlake/issues/3023 - The
doraplugin
Prototype: https://www.figma.com/file/Eux4Dhorxp7M0TwzOnL6Yh/Config-UI-for-V1.0?node-id=1447%3A11776
Idea
- Define an interface
PluginDashboardsfor the plugin to declare all granfana-dashboards that it could offer. includingid,title,description,grafana_dashboard_json. The framework would callgrafanaAPI to make sure dashboards exist and are up to date - Define an interface
PluginIconfor the plugin to return an SVG icon, (related to #2847) go embedf - The
doraplugin would offer a set ofsubtasksfor data-enrichment, i.e. to connect deployments and incidents, and a set ofdashboardsviaPluginDashboardsinterface. - Another plugin
webhookplugin would offer a set ofAPIs to support creatingcicd_pipeline deploymentandissue incidentwithcurl
The Domain Layer Entities need to be updated (related to #2875):
- Add
environmenttocicd_tasksto indicate target environment, i.e. Production/Staging/Testing - Add the following fields to
pull_request-
coding_timespan: from first commit author time to PR open time -
review_lag: from PR open time to first review completed (this could be a comment or an approval) -
review_timespan: first review completed to PR merged -
deploy_timespan: PR merged to deploy -
change_timespan: from first commit author time to deploy time
-
- Add
deployment_idtoissues: to indicate whichcicd_pipelinecaused theissue - Update Domain Layer Document
The webhook plugin would provide the following APIs (related to #3023)
- Define
connectionstruct as(id, name), with DYNAMIC GENERATEDissue_endpoint, cicd_pipeline_endpoints -
POST /plugins/webhook/connectionscreateswebhook connection -
GET /plugins/webhook/connectionsget all webhook connections -
GET /plugins/webhook/connections/:connection_idget detail of the webhook connection -
PATCH /plugins/webhook/connections/:connection_idupdate webhook connection -
DELETE /plugins/webhook/connections/:connection_iddelete the webhook connection -
POST /plugins/webhook/:connection_id/cicd_pipelinecreatescicd_piplineandcicd_pipeline_reposif not existed (ci/cd webhook) -
POST /plugins/webhook/:connection_id/issuescreatesissues(withtype=INCIDENTnormally) andboardif not existed (incident webhook) -
POST /plugins/webhook/:connection_id/issues/:id/closeclose specifiedissue - Add swagger document for webhook plugin
The dora plugin would contain the following subtasks
-
enrichTaskEnvfor Deployment Frequency accepts argumentenvironmentRegexand enrichcicd_tasks.environmentagainstcicd_tasks.name, along withscopeparameter (related to #2876 ) (notes: updateenvironmentRegextoproductionPattern,stagingPatternandtestingPattern) -
calcChangeLeadTimefor Change Lead Time aka Lead Time for Changes to calculate newly added fields ofpull_request(related to #2878 ) -
connectIssueCicdPipelineByTimefor Change Failure Rate (depends onissue.type=incident) connectsissues.deployment_id(type=incident) andcicd_pipelinesbased on time (assuming the incident is caused by the most recent deploymentunder the sameproject` maybe?) (related to #2879 ) -
Implement
PluginDashboards -
Implement
PluginIcon -
Add swagger document for pipeline/blueprint
Config-UI
- #2981
@yumengwang03 Please post the final design here https://www.figma.com/file/Eux4Dhorxp7M0TwzOnL6Yh/Config-UI-for-V1.0?node-id=1396%3A11624
Update existing data-source plugins and framework
- Update Gitlab to accept a task option named
deployTagPatternand set type=DEPLOYMENT tocicd_taskif matched #3114 - Update Jenkins to accept a task option named
deployTagPatternand set type=DEPLOYMENT tocicd_taskif matched #3122 - Update Github to accept a task option named
deployTagPatternand set type=DEPLOYMENT tocicd_taskif matched #3102 - Hardcode
doratask inrunner.RunPipelineifcore.GetPlugin("dora")succeeded #3127
Use case
measuring DevOps quality and efficiency
Related issues
No response
Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@abeizn @likyh with me
Here is a question, lots of teams choose to squash commits, so the time of first commit will be a problem
Config-ui proposal