GitIssueManager is a .NET 9 Web API for creating, updating, and closing issues across GitHub and GitLab using a unified, provider-agnostic interface.
- Unified issue management API for GitHub and GitLab
- Bearer token-based authentication support
- Auto-generated Swagger documentation
- Extensible service factory design
- Logging via Serilog
- ASP.NET Core 9
- Serilog (logging)
- Swashbuckle (Swagger)
- Newtonsoft.Json
- Moq + xUnit (testing)
- GitIssueManager/
- GitIssueManager.Api - API layer
- GitIssueManager.Core - Core logic and abstractions
- GitIssueManager.Tests - Unit tests
The Providers section in appsettings.json allows you to override the default API base URLs for GitHub and GitLab.
"Providers": {
"GitHub": {
"BaseURL": "https://api.github.com"
},
"GitLab": {
"BaseURL": "https://gitlab.com/api/v4"
}
}Note: This configuration is optional. If omitted, the following defaults will be used automatically:
- GitHub:
https://api.github.com - GitLab:
https://gitlab.com/api/v4
You typically only need to customize this if you're pointing to a self-hosted or enterprise version of GitHub/GitLab.
Logging is configured in appsettings.json under the Serilog section. By default, logs are written to the console and daily-rotating log files:
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"System": "Warning"
}
},
"WriteTo": [
{ "Name": "Console" },
{
"Name": "File",
"Args": {
"path": "Logs/log-.txt",
"rollingInterval": "Day"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
}More Info: See the official Serilog documentation for advanced scenarios: https://serilog.net
- .NET 9 SDK
- Docker (optional for containerized deployment)
# Restore dependencies
dotnet restore
# Build the solution
dotnet build
# Run the API
dotnet run --project GitIssueManager.ApiVisit Swagger UI at: https://localhost:7040/swagger
| Endpoint | Method | Description |
|---|---|---|
/issues |
POST |
Create a new issue |
/issues/{id} |
PUT |
Update an existing issue |
/issues/{id}/close |
PATCH |
Close an issue |
All API requests require an Authorization header with a Bearer token.
This token must be a Personal Access Token (PAT) from the respective provider (GitHub or GitLab), depending on the provider field in your request.
-
For GitHub:
Authorization: Bearer ghp_yourgithubtoken123 -
For GitLab:
Authorization: Bearer glpat-yourgitlabtoken456
Note: Make sure your token has the necessary scopes/permissions to create and update issues in the target repository.
POST /issues
Creates a new issue in the specified repository.
{
"provider": "GitHub",
"repository": "username/repository",
"title": "Bug: API not responding",
"description": "The API returns a 500 error when..."
}PUT /issues/{id}
Updates the title or description of an existing issue.
{
"provider": "GitLab",
"repository": "mygroup/myproject",
"title": "Bug: API timeout fixed",
"description": "Resolved by increasing timeout settings."
}PATCH /issues/{id}/close
Closes an open issue in the specified repository.
{
"provider": "GitHub",
"repository": "username/repository"
}To run the test suite:
dotnet testTests are located in the GitIssueManager.Tests project and cover service logic.