Skip to content

An application that gives you information about pull requests and commits in a Github or Azure DevOps repository with using GraphQL and REST API.

Notifications You must be signed in to change notification settings

leventyil/Git-Analytic

Repository files navigation

Git-Analytic

An application that gives you information about pull requests and commits in a Github or Azure DevOps repository with using GraphQL and REST API’s.

Getting Personal Access Tokens

You need Personal Acces Tokens for reading repository information.

Github

In Github, You can create one from the Settings>Developer settings>Personal access tokens page.
Application only needs the “repo” scope.

Azure DevOps

In Azure DevOps, you can create one from the User Settings page.
While creating this PAT, you should select the “Read” and “Status” permission in the “Code” scope.

Configuring the Application

With PAT, application also needs user or organization name and if you want to use it with Azure DevOps, project name too.
We store this information at appsettings.json file.
If you want to use the application with Github profile or organization, you should enter “1” for “isGithubRepo” value.
For understanding that is it a user or organization account, application also needs “isUserRepo” value.
Because when requesting repositories from the GraphQL API, we must use different queries for user and organization profiles.

a

How Application Works

Github queries are cURL’s converted from JSON query strings with escaped double quotes and curly braces.
The below one is a REST API URL for Azure DevOps.

a

You can find or create queries with using APIs documentations.

With Http Client, we send a request that includes the selected query and headers to the API and then deserialize the json response with to a Model.

a

Application uses two different Models, one for GraphQL response and the other one for REST.
With using models, it prints information about selected repository’s pull requests and top 10 user with the most commits, for now 😊

Here are some useful links:

https://docs.github.com/en/graphql

https://graphql-dotnet.github.io/docs/getting-started/introduction

https://docs.microsoft.com/en-us/rest/api/azure/devops/git/?view=azure-devops-rest-6.0

https://www.dotnetperls.com/common-elements-list

https://app.quicktype.io/

About

An application that gives you information about pull requests and commits in a Github or Azure DevOps repository with using GraphQL and REST API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages