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


##########
docs/DataModels/DevLakeDomainLayerSchema.md:
##########
@@ -254,44 +251,51 @@ A ref is the abstraction of a branch or tag.
 | **field**    | **type** | **length** | **description**                       
                                                                                
                                                                                
                                                                                
                                                                      | **key** 
    |
 | :----------- | :------- | :--------- | 
:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 | :---------- |
 | `id`         | varchar  | 255        | A ref's `id` is composed of "< plugin 
>:< Entity >:< PK0 >[:PK1]..."<br/>For example, a Github ref is composed of 
"github:GithubRepos:< GithubRepoId >:< RefUrl >". Eg. The id of release v5.3.0 
of PingCAP/TiDB project is 'github:GithubRepos:384111310:refs/tags/v5.3.0' A 
repo's `id` is composed of "< plugin >:< Entity >:< PK0 >[:PK1]..."           | 
PK          |
-| `ref_name`   | varchar  | 255        | The name of ref. Eg. 
'[refs/tags/v0.9.3](https://github.com/apache/incubator-devlake/tree/v0.9.3)'   
                                                                                
                                                                                
                                                                                
                |             |
+| `ref_name`   | varchar  | 255        | The name of ref. Eg. 
'[refs/tags/v0.9.3](https://github.com/apache/incubator-devlake/tree/v0.9.3)'   
                                                                                
                                                                                
                                                                                
       |             |
 | `repo_id`    | varchar  | 255        | The id of repo this ref belongs to    
                                                                                
                                                                                
                                                                                
                                                                      | 
FK_repos.id |
 | `commit_sha` | char     | 40         | The commit this ref points to at the 
time of collection                                                              
                                                                                
                                                                                
                                                                       |        
     |
 | `is_default` | int      |            | <ul><li>0: the ref is the default 
branch. By the definition of 
[Github](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch),
 the default branch is the base branch for pull requests and code 
commits.</li><li>1: not the default branch</li></ul> |             |
 | `merge_base` | char     | 40         | The merge base commit of the main ref 
and the current ref                                                             
                                                                                
                                                                                
                                                                      |         
    |
 | `ref_type`   | varchar  | 64         | There're 2 typical 
types:<ul><li>BRANCH</li><li>TAG</li></ul>                                      
                                                                                
                                                                                
                                                                                
         |             |
 
-#### refs_commits_diffs
+#### commits_diffs
 
-This table shows the commits added in a new ref compared to an old ref. This 
table can be used to support tag-based analysis, for instance, '_No. of commits 
of a tag_', '_No. of merged pull request of a tag_', etc.
+This table shows the commits added in a new commit compared to an old commit. 
This table can be used to support tag-based and deploy-based analysis.
 
-The records of this table are computed by 
[RefDiff](https://github.com/apache/incubator-devlake/tree/main/plugins/refdiff)
 plugin. The computation should be manually triggered after using 
[GitRepoExtractor](https://github.com/apache/incubator-devlake/tree/main/plugins/gitextractor)
 to collect commits and refs. The algorithm behind is similar to 
[this](https://github.com/apache/incubator-devlake/compare/v0.8.0%E2%80%A6v0.9.0).
+The records of this table are computed by 
[RefDiff](https://github.com/apache/incubator-devlake/tree/main/plugins/refdiff)
 plugin. The computation should be manually triggered after using 
[GitRepoExtractor](https://github.com/apache/incubator-devlake/tree/main/plugins/gitextractor)
 to collect commits. The algorithm behind is similar to 
[this](https://github.com/apache/incubator-devlake/compare/v0.8.0%E2%80%A6v0.9.0).
 
-| **field**            | **type** | **length** | **description**               
                                  | **key**        |
-| :------------------- | :------- | :--------- | 
:-------------------------------------------------------------- | 
:------------- |
-| `commit_sha`         | char     | 40         | One of the added commits in 
the new ref compared to the old ref | FK_commits.sha |
-| `new_ref_id`         | varchar  | 255        | The new ref's id for 
comparison                                 | FK_refs.id     |
-| `old_ref_id`         | varchar  | 255        | The old ref's id for 
comparison                                 | FK_refs.id     |
-| `new_ref_commit_sha` | char     | 40         | The commit new ref points to 
at the time of collection          |                |
-| `old_ref_commit_sha` | char     | 40         | The commit old ref points to 
at the time of collection          |                |
-| `sorting_index`      | varchar  | 255        | An index for debugging, 
please skip it                          |                |
+| **field**        | **type** | **length** | **description**                   
                                    | **key**        |
+| :--------------- | :------- | :--------- | 
:-------------------------------------------------------------------- | 
:------------- |
+| `commit_sha`     | char     | 40         | One of the added commits in the 
new commit compared to the old commit | FK_commits.sha |
+| `new_commit_sha` | char     | 40         | The new commit                    
                                    |                |

Review Comment:
   It looks like `commit_sha` is not the PK of the table. How about moving 
PK(s) up? Also, don't forget to change the order in the screenshots below.



##########
docs/DataModels/DevLakeDomainLayerSchema.md:
##########
@@ -254,44 +251,51 @@ A ref is the abstraction of a branch or tag.
 | **field**    | **type** | **length** | **description**                       
                                                                                
                                                                                
                                                                                
                                                                      | **key** 
    |
 | :----------- | :------- | :--------- | 
:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 | :---------- |
 | `id`         | varchar  | 255        | A ref's `id` is composed of "< plugin 
>:< Entity >:< PK0 >[:PK1]..."<br/>For example, a Github ref is composed of 
"github:GithubRepos:< GithubRepoId >:< RefUrl >". Eg. The id of release v5.3.0 
of PingCAP/TiDB project is 'github:GithubRepos:384111310:refs/tags/v5.3.0' A 
repo's `id` is composed of "< plugin >:< Entity >:< PK0 >[:PK1]..."           | 
PK          |
-| `ref_name`   | varchar  | 255        | The name of ref. Eg. 
'[refs/tags/v0.9.3](https://github.com/apache/incubator-devlake/tree/v0.9.3)'   
                                                                                
                                                                                
                                                                                
                |             |
+| `ref_name`   | varchar  | 255        | The name of ref. Eg. 
'[refs/tags/v0.9.3](https://github.com/apache/incubator-devlake/tree/v0.9.3)'   
                                                                                
                                                                                
                                                                                
       |             |
 | `repo_id`    | varchar  | 255        | The id of repo this ref belongs to    
                                                                                
                                                                                
                                                                                
                                                                      | 
FK_repos.id |
 | `commit_sha` | char     | 40         | The commit this ref points to at the 
time of collection                                                              
                                                                                
                                                                                
                                                                       |        
     |
 | `is_default` | int      |            | <ul><li>0: the ref is the default 
branch. By the definition of 
[Github](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch),
 the default branch is the base branch for pull requests and code 
commits.</li><li>1: not the default branch</li></ul> |             |
 | `merge_base` | char     | 40         | The merge base commit of the main ref 
and the current ref                                                             
                                                                                
                                                                                
                                                                      |         
    |
 | `ref_type`   | varchar  | 64         | There're 2 typical 
types:<ul><li>BRANCH</li><li>TAG</li></ul>                                      
                                                                                
                                                                                
                                                                                
         |             |
 
-#### refs_commits_diffs
+#### commits_diffs
 
-This table shows the commits added in a new ref compared to an old ref. This 
table can be used to support tag-based analysis, for instance, '_No. of commits 
of a tag_', '_No. of merged pull request of a tag_', etc.
+This table shows the commits added in a new commit compared to an old commit. 
This table can be used to support tag-based and deploy-based analysis.

Review Comment:
   How about using "deploy-based metrics" instead of "deploy-based analysis" to 
make it more precise?



##########
docs/Plugins/refdiff.md:
##########
@@ -89,6 +89,28 @@ curl -v -XPOST http://localhost:8080/pipelines --data @- 
<<'JSON'
 JSON
 ```
 
+4. Refdiff has a new subtask `calculateProjectDeploymentCommitsDiff`, which 
can find related deployments according to the project, and then calculate the 
commits diff between deployments. Such a function can be used to support the 
calculation of dora indicators.

Review Comment:
   Text change:
   "Such a function can be used to support the calculation of dora indicators." 
to 
   "This function can be used to support the calculation of DORA metrics."



-- 
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