Skip to content

Meta-model

Every importer fills a GLHModel (a MooseModel). All entities inherit from GLHEntity and use the same classes whatever the platform: a GitHub pull request is a GLHMergeRequest, a GitHub organization is a GLHGroup.

projects

subGroups

repository

mergeRequests

pipelines

branches

commits

files

diffs

commitCreator

file

diffRanges

commits

author

note

jobs

GLHGroup

GLHProject

GLHRepository

GLHMergeRequest

GLHPipeline

GLHBranch

GLHCommit

GLHFile

GLHDiff

GLHUser

GLHDiffRange

GLHNote

GLHJob

EntityRepresentsKey attributesKey relations
GLHGroupGitLab group, GitHub organization, Bitbucket projectid, name, web_url, visibilityprojects, subGroups, group (parent)
GLHProjecta project / repository on the platformid, name, web_url, archived, topicsgroup, repository, mergeRequests, pipelines, issues, releases, creator, contributors
GLHRepositorythe Git repository of a project—project, branches, commits, tags
GLHBrancha branchname, sharepository, commits, files
GLHCommita commitid (SHA), short_id, title, message, author_name, author_email, committed_date, authored_date, additions, deletions, web_urlrepository, parentCommits, childCommits, diffs, commitCreator, commitedMergeRequest, squashedMergeRequest, jobs, tags
GLHDiffthe change of one file in a commit or merge requestold_path, new_path, new_file, renamed_file, deleted_file, diffStringcommit, mergeRequest, file, diffRanges
GLHDiffRangea hunk of a diff (@@ … @@)originalLineRange, newLineRangediff, changes
GLHChangea line of a hunk: GLHAddition, GLHDeletion, GLHLineOfCode (unchanged)sourceCode, index, relativeIndexdiffRange
GLHFilea file: GLHFileDirectory or GLHFileBlobname, pathbranch, directoryOwner, files (directories), diffs
GLHMergeRequestmerge request / pull requestid, iid, title, description, state, created_at, merged_at, closed_at, source_branch, target_branch, draft, labels, approvedproject, commits, author, merge_user, merged_by, closed_by, reviewers, assignees, approved_by, pipelines, diffs, note, mergedCommit, squashCommit
GLHNotea comment on a merge requestbody, created_at, system, resolvablemergeRequest, author, position, suggestions
GLHPipelinea CI pipeline / workflow runid, status, ref, sha, created_at, finished_at, durationproject, jobs, user, mergeRequest
GLHJoba CI jobname, duration, allow_failure, web_urlpipeline, commit, user
GLHUsera platform user or a commit authorid, username, name, public_email, botcommits, createdMergeRequests, reviewedMergeRequest, mergerOfMergeRequests, contributedProjects, launchedPipelines
GLHTag, GLHReleaseGit tags and platform releasesname, tag_name, created_atrepository, commit, project
GLHIssue, GLHMilestoneplatform issues and milestonestitle, state, due_dateproject, assignees, author

The full UML diagram of the meta-model is generated automatically by FamixUMLDocumentor:

UML diagram of the GitProjectHealth meta-model

A GLHModel is a Moose model, so all the MooseQuery API works on it.

"All entities of a type"
commits := model allWithType: GLHCommit.
files := model allWithSubTypesOf: GLHFile.
"Entities contained (transitively) in another entity"
projects := group containedEntitiesOfType: GLHProject. "includes sub-groups"
mergeRequests := group containedEntitiesOfType: GLHMergeRequest.
projectCommits := project containedEntitiesOfType: GLHCommit.
"Classic navigation"
project repository branches collect: #name.
commit diffs collect: #new_path.
commit parentCommits.
mergeRequest author username.