You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "hezyin (via GitHub)" <gi...@apache.org> on 2023/02/04 01:46:47 UTC

[GitHub] [incubator-devlake-website] hezyin commented on a diff in pull request #421: docs(cicd): update docs

hezyin commented on code in PR #421:
URL: https://github.com/apache/incubator-devlake-website/pull/421#discussion_r1096406562


##########
docs/DataModels/DevLakeDomainLayerSchema.md:
##########
@@ -435,6 +435,20 @@ Events of pull requests.
 
 ### Domain 4 - CI/CD(WIP)
 
+#### cicd_scopes
+
+Information about Jenkins Job, GitHub Action or Gitlab CI. 
+
+| **field**      | **type** | **length** | **description**                                                                                                                                                                                                | **key**        |
+| :------------- | :------- | :--------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| :------------- |
+| `id`           | varchar  | 255        | A cicd_scope's `id` is composed of "< plugin >:< Entity >:< PK0 >[:PK1]..."<br/>For example, a Github cicd_scope's id is like "< github >:< GithubRepos >< GithubRepoId >". Eg. 'github:GithubRepos:384111310' | PK             |

Review Comment:
   I thought the connection id is also concatenated into the id?



##########
versioned_docs/version-v0.15/DataModels/DevLakeDomainLayerSchema.md:
##########
@@ -435,6 +435,20 @@ Events of pull requests.
 
 ### Domain 4 - CI/CD(WIP)
 
+#### cicd_scopes

Review Comment:
   Please replicate the changs to the v0.15 doc as well.



##########
docs/UserManuals/ConfigUI/Jenkins.md:
##########
@@ -59,6 +59,14 @@ If you're using Jenkins builds to conduct `deployments`, please select "Detect D
 - Deployment: A Jenkins build with a name that matches the given regEx will be considered as a deployment.
 - Production: A Jenkins build with a name that matches the given regEx will be considered a build in the production environment.
 
+There're two cases. If a Jenkins build has no stage, it's converted to both a cicd_task and a cicd_pipeline,

Review Comment:
   This is how it works behind the scene:
   
   - If a Jenkins job has stages, it's converted to a cicd_pipeline and its stages are converted to cicd_tasks in DevLake's domain layer schema.
   - If a Jenkins job has no stage, it's converted to both a cicd_pipeline and a cicd_task whose names are the job's name.
   
   After the conversion, the two regexes are applied to the records in the cicd_tasks table. 



##########
docs/UserManuals/ConfigUI/GitHub.md:
##########
@@ -120,6 +120,13 @@ If you're using GitHub Action to conduct `deployments`, please select "Detect De
 - Deployment: A GitHub Action job with a name that matches the given regEx will be considered as a deployment.
 - Production: A GitHub Action job with a name that matches the given regEx will be considered a job in the production environment.
 
+A GitHub workflow run has many jobs. Each GitHub workflow run is converted to a 
+cicd_pipeline in the domain layer and each GitHub Action job is converted to a cicd_task in the domain layer.

Review Comment:
   "each GitHub Action job" -> "each GitHub Actions job run"



##########
docs/DataModels/DevLakeDomainLayerSchema.md:
##########
@@ -435,6 +435,20 @@ Events of pull requests.
 
 ### Domain 4 - CI/CD(WIP)
 
+#### cicd_scopes
+
+Information about Jenkins Job, GitHub Action or Gitlab CI. 
+
+| **field**      | **type** | **length** | **description**                                                                                                                                                                                                | **key**        |
+| :------------- | :------- | :--------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| :------------- |
+| `id`           | varchar  | 255        | A cicd_scope's `id` is composed of "< plugin >:< Entity >:< PK0 >[:PK1]..."<br/>For example, a Github cicd_scope's id is like "< github >:< GithubRepos >< GithubRepoId >". Eg. 'github:GithubRepos:384111310' | PK             |
+| `name`         | varchar  | 255        | The name of cicd_scope.                                                                                                                                                                                        |                |
+| `description`  | varchar  | 255        | The description of cicd_scope.                                                                                                                                                                                 |                |
+| `url`          | varchar  | 255        | The url of cicd_scope. Eg. https://github.com/apache/incubator-devlake or https://jenkins.xxx.cn/view/PROD/job/OPS_releasev2/                                                                                  |                |
+| `created_date` | datetime | 3          | cicd_scope creation date                                                                                                                                                                                       |                |
+| `updated_date` | datetime | 3          | Last full update was done for this cicd_scope                                                                                                                                                                  |                |

Review Comment:
   "Last full update was done for this cicd_scope" -> "Date of the last data collection for this cicd_scope"
   
   Is emphasizing "full update" important here?



##########
docs/DataModels/DevLakeDomainLayerSchema.md:
##########
@@ -435,6 +435,20 @@ Events of pull requests.
 
 ### Domain 4 - CI/CD(WIP)
 
+#### cicd_scopes
+
+Information about Jenkins Job, GitHub Action or Gitlab CI. 

Review Comment:
   This one-line description is a bit too abstract. Maybe it's easier for users to understand if we explain cicd_scopes as a collection of cicd_pipelines and give some examples.
   
   For GitHub: a GitHub repo is converted to a cicd_scope
   For Jenkins: <I'm actually not sure the Jenkins entity that corresponds to a cicd_scope>
   For GitLab: I assume it's also a GitLab repo?
   Any other data source that may produce cicd_scope?



##########
docs/UserManuals/ConfigUI/GitHub.md:
##########
@@ -120,6 +120,13 @@ If you're using GitHub Action to conduct `deployments`, please select "Detect De
 - Deployment: A GitHub Action job with a name that matches the given regEx will be considered as a deployment.
 - Production: A GitHub Action job with a name that matches the given regEx will be considered a job in the production environment.
 
+A GitHub workflow run has many jobs. Each GitHub workflow run is converted to a 

Review Comment:
   "A GitHub workflow run has many jobs" -> "A GitHub workflow has many jobs" (remove the "run")



##########
versioned_docs/version-v0.15/UserManuals/ConfigUI/Jenkins.md:
##########
@@ -51,14 +51,22 @@ Jenkins only supports `CI/CD` domain entities, transformed from Jenkins builds a
 - CI/CD: Jenkins builds, stages, etc.
 
 ### Step 3 - Adding Transformation Rules (Optional)
-
+Before you start, you should understand that 
 This set of configurations is used for calculating [DORA metrics](../DORA.md).
 
 If you're using Jenkins builds to conduct `deployments`, please select "Detect Deployment from Jenkins Builds", and input the RegEx in the following fields:
 
-- Deployment: A Jenkins build with a name that matches the given regEx will be considered as a deployment.
+- Deployment: A Jenkins build with its job name or a Jenkins build stage with its name that matches the given regEx will be considered as a deployment.

Review Comment:
   Please replicate the changs to the v0.15 doc as well.



##########
versioned_docs/version-v0.15/UserManuals/ConfigUI/GitHub.md:
##########
@@ -120,6 +120,12 @@ If you're using GitHub Action to conduct `deployments`, please select "Detect De
 - Deployment: A GitHub Action job with a name that matches the given regEx will be considered as a deployment.
 - Production: A GitHub Action job with a name that matches the given regEx will be considered a job in the production environment.
 
+A GitHub workflow run has many jobs. Each GitHub workflow run is converted to a cicd_pipeline in the domain layer and each GitHub Action job is converted to a cicd_task in the domain layer.

Review Comment:
   Please replicate the changs to the v0.15 doc as well.



##########
docs/UserManuals/ConfigUI/GitHub.md:
##########
@@ -120,6 +120,13 @@ If you're using GitHub Action to conduct `deployments`, please select "Detect De
 - Deployment: A GitHub Action job with a name that matches the given regEx will be considered as a deployment.
 - Production: A GitHub Action job with a name that matches the given regEx will be considered a job in the production environment.
 
+A GitHub workflow run has many jobs. Each GitHub workflow run is converted to a 
+cicd_pipeline in the domain layer and each GitHub Action job is converted to a cicd_task in the domain layer.
+![github-action-run](/img/ConfigUI/github-action-run.png)
+![github-action-job](/img/ConfigUI/github-action-job.png)
+
+The deployment and production regex is always applied to the records in the cicd_tasks table.
+
 By the above two fields, DevLake can identify a production deployment among massive CI jobs.

Review Comment:
   "The regexes allow users to filter their CI/CD pipelines for deployments (to production)."



##########
docs/UserManuals/ConfigUI/Jenkins.md:
##########
@@ -59,6 +59,14 @@ If you're using Jenkins builds to conduct `deployments`, please select "Detect D
 - Deployment: A Jenkins build with a name that matches the given regEx will be considered as a deployment.

Review Comment:
   I recommend revising to below:
   
   If you'd like to define `deployments` with Jenkins, please select "Detect Deployment from Jenkins Builds", and provide the following regexes
   
   - Deployment: Jenkins stages whose names match the regex will be registered as deployments (if a Jenkins job has no stage, its job name will be used to match the regex)
   - Production: Jenkins stages whose names match the regex will be assigned environment 'PRODUCTION' (if a Jenkins job has no stage, its job name will be used to match the regex)



##########
versioned_docs/version-v0.15/UserManuals/ConfigUI/Jenkins.md:
##########
@@ -51,14 +51,22 @@ Jenkins only supports `CI/CD` domain entities, transformed from Jenkins builds a
 - CI/CD: Jenkins builds, stages, etc.
 
 ### Step 3 - Adding Transformation Rules (Optional)
-
+Before you start, you should understand that 

Review Comment:
   Why is this sentence here?



##########
docs/UserManuals/ConfigUI/Jenkins.md:
##########
@@ -59,6 +59,14 @@ If you're using Jenkins builds to conduct `deployments`, please select "Detect D
 - Deployment: A Jenkins build with a name that matches the given regEx will be considered as a deployment.
 - Production: A Jenkins build with a name that matches the given regEx will be considered a build in the production environment.
 
+There're two cases. If a Jenkins build has no stage, it's converted to both a cicd_task and a cicd_pipeline,
+both have the same name as the Jenkins job's name.
+If a Jenkins build has stages, it's converted to a cicd_pipeline and its
+stages are converted to cicd_tasks in the domain layer.
+![jenkins-job-build-stage](/img/ConfigUI/jenkins-job-build-stage.png)
+
+The deployment and production regex is always applied to the records in the cicd_tasks table.
+
 By the above two fields, DevLake can identify a production deployment among massive CI jobs.

Review Comment:
   We can remove this line.



-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org