Startrekzky commented on code in PR #310:
URL: 
https://github.com/apache/incubator-devlake-website/pull/310#discussion_r1012582750


##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,26 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   - Find the [commits diff](the link to refdiff plugin) between two 
consecutive deployments by deployments' commit_sha 
+   - under the same scope and environment (in terms of 
TESTING/STAGING/PRODUCTION)
+for example, here, we will get commit-2 and commit-3 by calculating 
commits_diff before deployment-1 and deployment-2,
+we can say commit-2, commit-3 and commit-4 are deployed by deployment-2
+   - Connect pr/mr and commits_diff through merge_commit or pr_commit, for 
example, 
+we get pr-3 connected to commit-3
+   - Now we can get pr-3's deploy time by finish_time of deployment-2 minus 
merge_time of pr-3.
 
 <b>Data Sources Required</b>
 
-This metric relies on PR/MRs collected from GitHub or GitLab.
+This metric relies on two sources:
+1. PR/MRs collected from GitHub or GitLab by enabling "Code Review" under the 
Data Entities section.
+2. Deployments collected in multiple ways:

Review Comment:
   Text change:
   "Deployments collected in one of the following ways:"



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,26 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   - Find the [commits diff](the link to refdiff plugin) between two 
consecutive deployments by deployments' commit_sha 
+   - under the same scope and environment (in terms of 
TESTING/STAGING/PRODUCTION)
+for example, here, we will get commit-2 and commit-3 by calculating 
commits_diff before deployment-1 and deployment-2,
+we can say commit-2, commit-3 and commit-4 are deployed by deployment-2
+   - Connect pr/mr and commits_diff through merge_commit or pr_commit, for 
example, 

Review Comment:
   Please capitalize PR/MR to make them consistent.



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,26 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   - Find the [commits diff](the link to refdiff plugin) between two 
consecutive deployments by deployments' commit_sha 

Review Comment:
   The link should be changed to 
'https://devlake.apache.org/docs/Plugins/refdiff/'. I used a placeholder before.



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,26 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   - Find the [commits diff](the link to refdiff plugin) between two 
consecutive deployments by deployments' commit_sha 
+   - under the same scope and environment (in terms of 
TESTING/STAGING/PRODUCTION)
+for example, here, we will get commit-2 and commit-3 by calculating 
commits_diff before deployment-1 and deployment-2,

Review Comment:
   1. Text change:
   "For example, we will get commit-2 and commit-3 by calculating commits_diff 
between deployment-1 and deployment-2, which means commit-2 and commit-3 are 
deployed by deployment-2". 
   2. Can we add a picture to better explain the logic?



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,26 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).

Review Comment:
   There's no related section about `deployment` list in 'Deployment Frequency' 
doc.
   
   Text change: 
   `PR deploy time` is calculated by subtracting a PR's deployed_date and 
merged_date. Hence, we should associate PR/MRs with `deployments`. 
   
   Here are the detailed steps:
   1. Find the [commits diff](the link to refdiff plugin) between two 
consecutive deployments by deployments' commit_sha under the same scope and 
environment (in terms of TESTING/STAGING/PRODUCTION)
   2. ....
   3. ....



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to