Skip to content

rbmathis/Demo1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ASP.NET Core MVC Project

Build & Test Deploy Copilot Agents Targeted Coverage Playwright Ready

Welcome to the glam corner of .NET 9 where MVC meets main-character energy. This repo is our stage for building production-ready web apps with a confident strut, buttery-smooth tooling, and telemetry that keeps the spotlight exactly where we want it.

Highlights

  • Turnkey pipelines – CI keeps the runway green with linting, unit tests, and smoke checks.
  • Feature-flag finesse – Azure App Configuration flips features faster than a costume change.
  • Observability drip – Application Insights, custom telemetry, and coverage gates keep the receipts.

Getting Started

Prerequisites

  • .NET 9 SDK
  • Visual Studio Code with C# Dev Kit extension

Running the Application

  1. Build the project:

    dotnet build
  2. Run the project:

    dotnet run
  3. Run with hot reload (development):

    dotnet watch run

The application will be available at https://localhost:7XXX and http://localhost:5XXX (ports will be displayed in the terminal).

VS Code Tasks

This project includes VS Code tasks that you can run via:

  • Ctrl+Shift+P β†’ "Tasks: Run Task"
  • Available tasks: build, run, watch

Versioning

This project uses automatic semantic versioning based on PR merge activity:

  • Current Version: See VERSION file in repo root
  • Version Format: MAJOR.MINOR.PATCH (e.g., 0.27.9)
  • Automatic Updates: When a PR is merged to main, the version is automatically bumped based on PR body content:
    • Major bump (1.0.0): PR body contains BREAKING CHANGE or #major
    • Minor bump (0.28.0): PR body contains #minor, feat:, or feature
    • Patch bump (0.27.10): Default for all other PRs
  • Artifacts: Each version bump creates:
    • Updated VERSION file
    • Git tag (e.g., v0.27.10)
    • GitHub Release with auto-generated notes
    • Docker images with version labels
    • .NET assemblies with embedded version

See .github/workflows/version.yml for implementation details.

Project Structure

  • Controllers/: MVC controllers
  • Views/: Razor view templates
  • Models/: Data models
  • wwwroot/: Static files (CSS, JS, images)
  • Program.cs: Application entry point
  • appsettings.json: Configuration settings

Development

To debug the application in VS Code:

  1. Press F5 to start debugging
  2. Or use Ctrl+Shift+P β†’ "Debug: Start Debugging"

The debugger will launch the application and open it in your default browser.

Testing

  • dotnet test triggers all suites, including the Playwright smoke tests in Demo1.PlaywrightTests.
  • On the first run Playwright downloads headless browser binaries automatically; alternatively, install them explicitly by executing pwsh tests/Demo1.PlaywrightTests/bin/Debug/net9.0/playwright.ps1 install from the repository root after a build (ensure your working directory is the solution root).
  • The GitHub Actions workflow installs the Playwright CLI (Microsoft.Playwright.CLI) so CI runs the same headless checks.

Documentation

XML Documentation

  • The project generates XML docs on build: bin/<Configuration>/<TargetFramework>/Demo1.xml
  • All public APIs should include /// XML comments (enforced by the Documentation Helper CI agent)

Additional Notes

Client-side libraries

  • Client-side libraries (Bootstrap, jQuery, validation) are managed with LibMan. Run libman restore to populate wwwroot/lib/ when working locally.
  • The repository currently contains restored files in wwwroot/lib/ so Docker builds and CI do not need to fetch from CDNs at build time. If you prefer not to commit vendor files, update the Dockerfile and CI to run libman restore during the build.

Optional: Swagger / OpenAPI

  • The docs include an example for enabling Swagger, but it is not enabled by default in Program.cs.
  • To enable Swagger locally during development, you can add the minimal services and middleware in Program.cs (or set a feature flag):
// Example: enable when configuration flag is set or in Development
if (app.Environment.IsDevelopment() || builder.Configuration.GetValue<bool>("EnableSwagger", false))
{
   app.UseSwagger();
   app.UseSwaggerUI();
}

Code Coverage

  • CI may produce coverage artifacts used by badges and checks. To generate coverage locally with Coverlet (example):
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

Check your CI workflow for the exact coverage collector and reporting steps if you rely on published coverage reports.

Docker and client libraries

  • The Docker build expects wwwroot/lib/ to contain client libs (this repository currently tracks them). If you change that approach, ensure CI installs LibMan or restores client libraries during the Docker build to avoid publish failures.

GitHub Actions & Copilot Integration

This project is configured with GitHub Actions workflows and Copilot Custom Agents:

Automated Workflows

  • πŸ”¨ Build & Test: Runs on every push and PR
  • πŸš€ Deploy: Handles production deployments
  • πŸ€– Copilot Agents: Custom agents for code review and quality checks

Copilot Custom Agents

  • Code Reviewer: Reviews PRs for MVC best practices
  • Build Validator: Ensures successful builds
  • Security Auditor: Scans for vulnerabilities (weekly + PRs)
  • Documentation Helper: Maintains docs quality

Getting Started with CI/CD

  1. Push your code to trigger automated builds
  2. Create a pull request to activate code review agents
  3. Agents provide feedback and suggestions automatically
  4. Configure deployment secrets for production releases

See .github/copilot-instructions.md for detailed agent configuration.

πŸ€– Using Custom Copilot Agents

This project includes custom GitHub Copilot agents that you can chat with directly in VS Code!

Available Agents

Use @agent-name in Copilot Chat to invoke them:

@code-reviewer πŸ’–

Reviews your code for quality and best practices.

@code-reviewer look at this controller
@code-reviewer check my security implementation

@build-validator πŸ”§

Validates project files and dependencies.

@build-validator check my .csproj file
@build-validator analyze dependencies

@security-auditor πŸ›‘οΈ

Scans for security vulnerabilities.

@security-auditor scan this file
@security-auditor check for SQL injection risks

@doc-helper πŸ“š

Helps improve documentation.

@doc-helper generate XML comments
@doc-helper check documentation coverage

@issue-helper 🎯

Helps triage GitHub issues.

@issue-helper classify this issue
@issue-helper suggest labels

Quick Start

  1. Open Copilot Chat (Ctrl+Shift+I)
  2. Type @ to see available agents
  3. Select an agent and ask your question
  4. Get intelligent, context-aware assistance!

Examples

# Review current file
@code-reviewer analyze this controller for MVC best practices

# Check security
@security-auditor scan for authentication issues

# Validate build
@build-validator check package versions

# Improve docs
@doc-helper add XML comments to selected code

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 5