klesh commented on code in PR #308:
URL: 
https://github.com/apache/incubator-devlake-website/pull/308#discussion_r1011047351


##########
docs/DeveloperManuals/Project.md:
##########
@@ -0,0 +1,195 @@
+---
+title: "Project"
+sidebar_position: 5
+description: >
+  `Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+---
+
+## Summary
+`Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.

Review Comment:
   Do not present `project` as some kind of subsystem for DORA, no.
   Lets say it is **a set of scopes from different domains**, a way to group 
different resources, and it is crucial for some metric calculation like DORA.



##########
docs/DeveloperManuals/Project.md:
##########
@@ -0,0 +1,195 @@
+---
+title: "Project"
+sidebar_position: 5
+description: >
+  `Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+---
+
+## Summary
+`Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+
+It contains the following two models:
+ - `projects` describes a project object, including its name, creation and 
update time and other basic information
+ - `project_metrics` describes the mapping relationship enabled by a plugin, 
including the name of the project and plugin on both sides of the mapping, and 
basic information about plugin options.
+
+![image](project_table.jpg)
+
+## project
+
+|   **field**   | **type** | **length** | **description**               | 
**key** |
+| ------------- | -------- | ---------- | ----------------------------- | 
------- |
+| `name`        | varchar  | 255        | name for project              | PK   
   |
+| `description` | longtext |            | description of the project    |      
   |
+| `created_at`  | datetime | 3          | created time of project       |      
   |
+| `updated_at`  | datetime | 3          | last updated time of project  |      
   | 
+

Review Comment:
   We can add a `project_mapping` to demonstrate how different scopes are 
connected



##########
docs/DeveloperManuals/Project.md:
##########
@@ -0,0 +1,195 @@
+---
+title: "Project"
+sidebar_position: 5
+description: >
+  `Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+---
+
+## Summary
+`Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+
+It contains the following two models:
+ - `projects` describes a project object, including its name, creation and 
update time and other basic information
+ - `project_metrics` describes the mapping relationship enabled by a plugin, 
including the name of the project and plugin on both sides of the mapping, and 
basic information about plugin options.
+
+![image](project_table.jpg)
+
+## project
+
+|   **field**   | **type** | **length** | **description**               | 
**key** |
+| ------------- | -------- | ---------- | ----------------------------- | 
------- |
+| `name`        | varchar  | 255        | name for project              | PK   
   |
+| `description` | longtext |            | description of the project    |      
   |
+| `created_at`  | datetime | 3          | created time of project       |      
   |
+| `updated_at`  | datetime | 3          | last updated time of project  |      
   | 
+
+
+| **name**  | **describe**                         | **created_at**          | 
**updated_at**          |
+| --------- | ------------------------------------ | ----------------------- | 
------------------------|
+| project_1 | this is one of the test projects     | 2022-11-01 01:22:13.000 | 
2022-11-01 02:24:15.000 |
+| project_2 | this is another project test project | 2022-11-01 01:23:29.000 | 
2022-11-01 02:27:24.000 |
+
+## project_metric
+
+|   **field**   | **type** | **length** | **description**                      
                      | **key** |
+| ------------- | -------- | ---------- | 
---------------------------------------------------------- | ------- |
+| `project_name`   | varchar  | 255     | name for project                     
                      | PK      |
+| `plugin_name`    | varchar  | 255     | name for plugin                      
                      | PK      |
+| `plugin_option`  | longtext |         | check if metric plugins have been 
enabled by the project   |         |
+
+
+| **project_name** | **plugin_name** | **plugin_option**      |
+| ---------------- | --------------- | ---------------------- |
+| project_1        | gitlab          | {'enable':true}        |
+| project_2        | gitlab          | {'enable':false}       |
+| project_2        | github          | {'enable':true}        |
+
+
+It requires each plugin to implement an interface named `PluginMetric`
+
+# 如何使用 Project
+
+1. 首先我们可以通过 `GET` `/plugininfo` 接口来获取到 完整详细的 `插件` 信息,其中包括对应 `插件` 
的每个表的结构信息。除此以外,我们也可以通过调用相对简单的 `GET` `/plugins` 
来获取更为简洁的插件信息。简洁的插件信息仅包含插件名称,也就是`plugin_name`组成的列表,除此之外不包含其他任何信息。

Review Comment:
   The order of the steps doesn't feel right, my first reaction to this API 
was: why am I looking at `/plugininfo` ? I'm reading the project document...
   Let's start from creating project, and then how to enable metrics for the 
project, and then `/plugins` for fetching all metric plugin names



##########
docs/DeveloperManuals/Project.md:
##########
@@ -0,0 +1,195 @@
+---
+title: "Project"
+sidebar_position: 5
+description: >
+  `Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+---
+
+## Summary
+`Project` is an object that can be used for DORA to associate 
`changes(commits)`, with `deployments` and `issues`.
+
+It contains the following two models:
+ - `projects` describes a project object, including its name, creation and 
update time and other basic information
+ - `project_metrics` describes the mapping relationship enabled by a plugin, 
including the name of the project and plugin on both sides of the mapping, and 
basic information about plugin options.
+
+![image](project_table.jpg)
+
+## project
+
+|   **field**   | **type** | **length** | **description**               | 
**key** |
+| ------------- | -------- | ---------- | ----------------------------- | 
------- |
+| `name`        | varchar  | 255        | name for project              | PK   
   |
+| `description` | longtext |            | description of the project    |      
   |
+| `created_at`  | datetime | 3          | created time of project       |      
   |
+| `updated_at`  | datetime | 3          | last updated time of project  |      
   | 
+
+
+| **name**  | **describe**                         | **created_at**          | 
**updated_at**          |
+| --------- | ------------------------------------ | ----------------------- | 
------------------------|
+| project_1 | this is one of the test projects     | 2022-11-01 01:22:13.000 | 
2022-11-01 02:24:15.000 |
+| project_2 | this is another project test project | 2022-11-01 01:23:29.000 | 
2022-11-01 02:27:24.000 |
+
+## project_metric
+
+|   **field**   | **type** | **length** | **description**                      
                      | **key** |
+| ------------- | -------- | ---------- | 
---------------------------------------------------------- | ------- |
+| `project_name`   | varchar  | 255     | name for project                     
                      | PK      |
+| `plugin_name`    | varchar  | 255     | name for plugin                      
                      | PK      |
+| `plugin_option`  | longtext |         | check if metric plugins have been 
enabled by the project   |         |
+
+
+| **project_name** | **plugin_name** | **plugin_option**      |
+| ---------------- | --------------- | ---------------------- |
+| project_1        | gitlab          | {'enable':true}        |

Review Comment:
   Oh, maybe we should extract the `enable` as a `field`?



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