From e577f0059d7a8f75c37697cf623f7b4873977b46 Mon Sep 17 00:00:00 2001 From: Benoit Verhaeghe Date: Tue, 2 Jul 2024 10:38:32 +0200 Subject: [PATCH] update documentation GitProject Health --- .../getting-started-with-gitproject-health.md | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/moose-wiki/Users/gitproject-health/getting-started-with-gitproject-health.md b/moose-wiki/Users/gitproject-health/getting-started-with-gitproject-health.md index 2e746c4..ab78ba6 100644 --- a/moose-wiki/Users/gitproject-health/getting-started-with-gitproject-health.md +++ b/moose-wiki/Users/gitproject-health/getting-started-with-gitproject-health.md @@ -60,6 +60,15 @@ glhImporter := GLHModelImporter new glhImporter importGroup: 137. ``` +You can also import all available top-level groups and then iterate: + +```st +groups := glhImporter importAllGroups. +groups do: [:group | + glhImporter importGroup: group id. +] +``` + ### Import a group from GitHub In a playground (`Ctrl+O`, `Ctrl+W`). @@ -85,13 +94,41 @@ myProject := ((glhModel allWithType: GLHProject) select: [ :project | project na glhImporter importCommitsOf: myProject withStats: true until: '2023-01-01' asDate. ``` +### Import Merge Requests information + +![Badge Gitlab only](https://img.shields.io/badge/GitLab_Only-8A2BE2?logo=gitlab) + +It is possible to extract MergeRequests of a project. +To avoid too many REST API requests, you should do it in multiple steps. + +First, import basic information. + +```st +(glhModel allWithType: GLHProject) do: [:project | + glhImporter importMergeRequests: project +] +``` + +> This will only import the first 20 merge requests for each project. However, one can also use the method `` to import all merge request since a specific date + +Then, you can import more data for each MergeRequest + +```st +(glphModel allWithType: GLPHEMergeRequest) do: [ :mr | + "Extract information about Merge Request approvals and review" + glhImporter importMergeResquestApprovals: mr. + "Extract information about Author, Mergers, etc." + glhImporter importMergeResquestAuthor: mr. +]. +``` + ## Visualize To visualize the group's "health" ```st dritGroup := (glhModel allWithType: GLHGroup) detect: [ :group | group id = 137 ]. -canvas := (GLHGroupVisualization new forGroup: dritGroup). +canvas := (GLHGroupVisualization new forGroup: { dritGroup } ). canvas open. ``` @@ -101,7 +138,7 @@ To export the visualization as an svg image ```st dritGroup := (glhModel allWithType: GLHGroup) detect: [ :group | group id = 137 ]. -canvas := (GLHGroupVisualization new forGroup: dritGroup). +canvas := (GLHGroupVisualization new forGroup: {dritGroup}). canvas open. canvas svgExporter