You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/04/29 21:21:14 UTC
Re: [D] pr_deployed_date field in project_pr_metrics table [incubator-devlake]
GitHub user dosubot[bot] edited a comment on the discussion: pr_deployed_date field in project_pr_metrics table
<!-- Greeting -->
Hello @boraer! I'm [Dosu](https://dosu.dev), a bot here to help you solve bugs, answer questions, and become a contributor. I'm ready to assist you while we wait for a human maintainer. How can I help you today?
<!-- Answer -->
The `pr_deployed_date` field in the `project_pr_metrics` table is populated by retrieving deployment information for a pull request and calculating the PR deploy time. Specifically, the `pr_deployed_date` is set to `deployment.FinishedDate` if a deployment is found and its `FinishedDate` is not nil. Here's a snippet of the relevant code:
```go
// Get the deployment for the PR
deployment, err := getDeploymentCommit(pr.MergeCommitSha, data.Options.ProjectName, db)
if err != nil {
return nil, err
}
// Calculate PR deploy time
if deployment != nil && deployment.FinishedDate != nil {
projectPrMetric.PrDeployTime = computeTimeSpan(pr.MergedDate, deployment.FinishedDate)
projectPrMetric.DeploymentCommitId = deployment.Id
projectPrMetric.PrDeployedDate = deployment.FinishedDate
}
```
This process involves associating pull requests with deployments, which are collected from various sources like GitHub, GitLab, Jenkins, etc. The calculation of `PR deploy time` is done by subtracting a PR's `merged_date` from its `deployed_date` <sup>[[1]](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/dora/tasks/change_lead_time_calculator.go)</sup><sup>[[2]](https://github.com/apache/incubator-devlake-website/blob/main/versioned_docs/version-v0.21/Metrics/PRDeployTime.md)</sup>.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fincubator-devlake).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fincubator-devlake).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fincubator-devlake#message_id=bc82e423-629a-4393-99d8-810b5c5055e4) [](https://github.dosu.com/apache/incubator-devlake?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fincubator-devlake) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fincubator-devlake)
GitHub link: https://github.com/apache/incubator-devlake/discussions/8447#discussioncomment-13221385
----
This is an automatically sent email for dev@devlake.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@devlake.apache.org