Closed SanJSp closed 3 years ago
The given call only supplies us with the commit numbers (f.e. 51 commits) but not the commit amounts. I will look for other calls, but am also open for hints 😁
Edit: Found the call GET /repos/:owner/:repo/stats/contributors
Working with GET /repos/:owner/:repo/stats/contributors
I receive a list of contributors with each having an array, that displays the additions/deletions in weeks. The problem here is that GitHub calculates these weeks starting on Sundays. This makes it not possible to display the metric with custom sprint durations. Therefore, the path via the detailed commits is as far as I know the only possible. I will look for further solutions.
A possible solution could be using the GraphQL API https://stackoverflow.com/a/47822439
Current Query:
query {
repository(owner: "hpi-swt2", name: "connections-portal") {
defaultBranchRef {
name
target {
... on Commit {
history(first: 100, after: ""){
nodes {
id
author {
user {
databaseId
}
email
name
}
committedDate
additions
deletions
}
pageInfo {
hasNextPage
}
}
}
}
}
}
}
The metric commit amounts is very slow. We should increase its speed by using following call: https://docs.github.com/en/rest/reference/repos#get-all-contributor-commit-activity