Commits
Commits describe the changes made to the source code of a project. We will see how to obtain the list of commits and their properties.
The commits model
The commits model contains essential information about the activity of a project, team and developer.
Properties
- Name
sha
- Type
- string
- Description
Unique identifier for the commit.
- Name
url
- Type
- string
- Description
The url for the commit.
- Name
createdAt
- Type
- timestamp
- Description
Timestamp of when the commit was created.
- Name
total
- Type
- integer
- Description
Absolute amount of additions
- Name
additions
- Type
- integer
- Description
Amount of additions
- Name
deletions
- Type
- integer
- Description
Amount of deletions
- Name
totalAbsolute
- Type
- integer
- Description
Absolute amount of changes
- Name
userName
- Type
- string
- Description
The author username of the commit.
- Name
repositoryId
- Type
- string
- Description
The id of the repository.
- Name
repositoryName
- Type
- string
- Description
The name of the repository.
- Name
provider
- Type
- string
- Description
The name of the provider.
- Name
totalSizeCommit
- Type
- integer
- Description
Total size of the commit
- Name
totalChangesCommit
- Type
- integer
- Description
Total changes of the commit
- Name
totalChangesRework
- Type
- integer
- Description
Total changes rework of the commit
List all commits
Request
curl -G https://api.pulzen-gateway/api/dashboard/commits \
-H "Authorization: Basic {token}"
Response
{
"sha": "8ed6b23bf62802ccd676aa79eafeb91cadcaaad6",
"url": "https://github.com/CleveritDemo/groowcity-frontend/commit/8ed6b23bf62802ccd676aa79eafeb91cadcaaad6",
"createdAt": "2022-01-24T11:49:19Z",
"total": 11,
"additions": 25,
"deletions": -14,
"totalAbsolute": 39,
"userName": "karloiz",
"email": null,
"date": "2022-01-24T11:49:19Z",
"dayOfWeek": "MONDAY",
"pullRequests": [
"2817",
"2788",
"2815"
],
"repositoryId": "R_kgDOK0c6GA",
"repositoryName": "groowcity-frontend",
"teams": [],
"provider": "GITHUB",
"totalSizeCommit": 4677,
"totalChangesCommit": 39,
"totalChangesRework": 39
}
Query Parameters:
provider
: Can be one of the following:GITHUB
,GITLAB
,BITBUCKET
,AZUREDEVOPS
.dateStart
: FormatYYYY-MM-DD
.dateEnd
: FormatYYYY-MM-DD
.
Metrics
From Commits: API Endpoint
IsRefactor and Percentage Of Refactor
Definition: Measures the amount of work involving changes made to existing code that is less than 21 days old.
Attributes to Consider:
fileChange.list
is required.
Summary:
- The
fileChange
object contains all additions, deletions, and total lines modified per file. - Attributes in the commit request object include:
totalSizeCommit
: Represents the total size of a specific commit, which is the total lines for all files involved in the commit.totalChangesCommit
: Represents the total changes of a specific commit, which is the total lines for all files involved in the commit.totalChangesRework
: If the changes in the commit are made within 21 days from the last changes of the file.
- The frequency with which development branches are integrated into the main branch.