DevOps Assistant is a comprehensive solution designed to streamline and automate DevOps workflows. This AI-powered assistant helps teams manage repositories, pull requests, workflows, and other DevOps operations through a user-friendly interface and RESTful API.
This solution follows Clean Architecture principles with clear separation of concerns:
DevOpsAssistant/
βββ π DevOpsAssistant.Api/ # REST API layer
βββ π― DevOpsAssistant.Application/ # Business logic & use cases
βββ ποΈ DevOpsAssistant.Domain/ # Domain entities & enums
βββ π§ DevOpsAssistant.Infrastructure/ # External services & data access
βββ π» DevOpsAssistant.Web/ # Blazor web application
- Repository Management: List and manage public repositories
- Pull Request Operations: Create, merge, decline, and review pull requests
- Branch Management: Create and manage git branches
- Workflow Automation: Trigger and monitor GitHub Actions workflows
- AI-Powered Chat: Interact with DevOps operations through natural language
- π List public repositories
- π Create and manage branches
- π Create and review pull requests
- π¬ Add comments to pull requests
- β Merge pull requests
- β Decline pull requests
- β‘ Trigger GitHub workflows
- π List available workflows
- Backend: .NET 9.0 / ASP.NET Core
- Frontend: Blazor Server
- API Documentation: OpenAPI/Swagger with Scalar
- HTTP Client: Refit
- Architecture: Clean Architecture
- AI Integration: Microsoft Semantic Kernel
- DevOps Integration: GitHub API (Octokit), GitHub GraphQL
- .NET 9.0 SDK
- Git
- GitHub account with appropriate permissions
- OpenAI API key for AI functionality
-
Clone the repository
git clone <repository-url> cd DevOpsAssistant
-
Restore dependencies
dotnet restore
-
Configure settings Update
appsettings.jsonfiles in both API and Web projects with your:- GitHub token (for repository access)
- OpenAI API key (for AI functionality)
- API endpoints
- Other configuration values
-
Run the API
cd DevOpsAssistant.Api dotnet run -
Run the Web Application
cd DevOpsAssistant.Web dotnet run
The API provides a conversational interface for all DevOps operations through AI-powered chat:
POST /api/v1/devops/chat- Chat with the DevOps assistant (main endpoint)GET /info- API information and health status
All DevOps operations are performed through natural language commands sent to the chat endpoint:
- π List repositories: "Show me all repositories"
- π Create branch: "Create a new branch called feature/auth from main"
- π List workflows: "What workflows are available in owner/repo?"
- β‘ Trigger workflow: "Run the CI/CD pipeline on main branch"
- π List pull requests: "Show me all pull requests in owner/repo"
- π Review pull request: "Review pull request #123 in owner/repo"
- π¬ Add comment: "Add comment 'LGTM' to pull request #123"
- β Merge pull request: "Merge pull request #123 in owner/repo"
- β Decline pull request: "Decline pull request #123 in owner/repo"
POST /api/v1/devops/chat
{
"message": "Create a new branch called feature/user-authentication from main in luisiitodev/my-repo",
"userId": "developer123"
}Response:
{
"message": "β
Branch created successfully!\n\nπ Branch Details:\nβ’ Repository: luisiitodev/my-repo\nβ’ Branch: feature/user-authentication\nβ’ Created from: main\nβ’ Status: Ready for development",
"userId": "developer123"
}POST /api/v1/devops/chat
{
"message": "Trigger the ci-cd-pipeline workflow on main branch in luisiitodev/my-repo",
"userId": "developer123"
}POST /api/v1/devops/chat
{
"message": "Show me all my repositories",
"userId": "developer123"
}POST /api/v1/devops/chat
{
"message": "List all pull requests in luisiitodev/my-repo",
"userId": "developer123"
}{
"GitHub": {
"Token": "your-github-token",
"BaseUrl": "https://api.github.com"
},
"SemanticKernel": {
"ApiKey": "your-openai-api-key"
}
}The web application connects to the API at https://localhost:7062/ by default.
- Controllers: API endpoints and routing
- DTOs: Data transfer objects for API communication
- Handlers: Request/response processing
- Configuration: OpenAPI and service configuration
- Use Cases: Business logic implementation
- Interfaces: Contracts for services and repositories
- Extensions: Dependency injection configuration
- Entities: Domain models
- Enums: Domain enumerations
- Services: External service implementations
- SemanticKernel: AI integration
- Configuration: Infrastructure setup
- Components: Blazor UI components
- Interfaces: API service contracts
- DTOs: Web-specific data models
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with .NET 9.0 and Blazor Server
- Powered by GitHub APIs (Octokit & GraphQL)
- Enhanced with AI capabilities through Microsoft Semantic Kernel
- API documentation with Scalar and OpenAPI
Happy DevOps! π