Skip to content

Visualizations

GitProjectHealth adds views to the Pharo inspector and provides Roassal visualizations that you can open or export from a script.

Inspect an entity (Ctrl+I) to get these tabs:

Inspected entityTabShows
GLHGroupGroup Qualitythe projects of the group (and sub-groups), green if their last pipeline succeeded, red if it failed
group of GLHGroupsGroups Qualitythe same, for several groups
GLHProjectContributorsthe users who committed in the project
GLHRepositoryCommits Historythe commit graph (branches and merges)
GLHRepositoryCommits distributionnumber of commits per day, stacked by author
GLHRepositoryWeekly Commitscommits per day of the week
GLHUserCommits distributioncommits per day, stacked by project
GLHUserWeekly Commitscommits per day of the week
GLHCommitCommit View, File Impact, Commits Treethe diff of the commit, the impacted files, its child commits
GLHDiffDiff View, Files Impactedthe diff and the impacted files
any GLHEntityTreethe containment tree of the entity

Commits distribution of a user, stacked by project

Each visualization returns a Roassal RSCanvas that you can open, inspect or export.

"group: a GLHGroup imported with a platform importer"
canvas := GLHGroupVisualization new forGroup: { group }.
canvas open.

The colors can be changed with passingPipelineColor:, failingPipelinecolor: and noPipelineColor:.

commits := (project containedEntitiesOfType: GLHCommit) asOrderedCollection.
"Commits per day, stacked by author (default)"
(GLHCommitDistributionVisualization new forCommits: commits) open.
"Commits per day, stacked by project"
(GLHCommitDistributionVisualization new
groupCommitBlock: [ :commit | commit repository project ];
forCommits: commits) open.
"Commits per day of the week, and average per day of the week"
(GLHCommitDistributionByWeekDayVisualization new forCommits: commits) open.
(GLHCommitDistributionAverageByWeekDayVisualization new forCommits: commits) open.
(GLHProjectContributorVisualization new forProject: project) open.
canvas := GLHGroupVisualization new forGroup: { group }.
canvas svgExporter
withoutFixedShapes;
fileName: 'group-health';
export.
canvas pngExporter
fileName: 'group-health';
export.

Files are written next to the image.

GLHGroupCSVExporter exports, for each project of a group and of its sub-groups, the result and the date of its last pipeline:

csv := GLHGroupCSVExporter new forGroup: group.
'group-health.csv' asFileReference writeStreamDo: [ :stream | stream nextPutAll: csv ].