6.4 KiB
Contributing to MaksIT.Core
Thank you for your interest in contributing to MaksIT.Core! This document provides guidelines for contributing to the project.
Getting Started
- Fork the repository
- Clone your fork locally
- Create a new branch for your changes
- Make your changes
- Submit a pull request
Development Setup
Prerequisites
- .NET10 SDK or later
- Git
Building the Project
cd src
dotnet build MaksIT.Core.sln
Running Tests
cd src
dotnet test MaksIT.Core.Tests
Commit Message Format
This project uses the following commit message format:
(type): description
Commit Types
| Type | Description |
|---|---|
(feature): |
New feature or enhancement |
(bugfix): |
Bug fix |
(refactor): |
Code refactoring without functional changes |
(chore): |
Maintenance tasks (dependencies, CI, documentation) |
Examples
(feature): add support for custom JWT claims
(bugfix): fix multithreading issue in file logger
(refactor): simplify expression extension methods
(chore): update copyright year to 2026
Guidelines
- Use lowercase for the description
- Keep the description concise but descriptive
- No period at the end of the description
Code Style
- Follow standard C# naming conventions
- Use XML documentation comments for public APIs
- Keep methods focused and single-purpose
- Write unit tests for new functionality
Pull Request Process
- Ensure all tests pass
- Update documentation if needed
- Update CHANGELOG.md with your changes under the appropriate version section
- Submit your pull request against the
mainbranch
Versioning
This project follows Semantic Versioning:
- MAJOR - Breaking changes
- MINOR - New features (backward compatible)
- PATCH - Bug fixes (backward compatible)
Release Process
The release process is automated via PowerShell scripts in the src/scripts/ directory.
Prerequisites
- Docker Desktop running (for Linux tests)
- GitHub CLI (
gh) installed - Environment variables configured:
NUGET_MAKS_IT- NuGet.org API keyGITHUB_MAKS_IT_COM- GitHub Personal Access Token (needsreposcope)
Release Scripts Overview
| Script | Purpose |
|---|---|
Generate-Changelog.ps1 |
AI-assisted changelog generation and license year update |
Release-NuGetPackage.ps1 |
Build, test, and publish to NuGet.org and GitHub |
Force-AmendTaggedCommit.ps1 |
Fix mistakes in tagged commits |
Release Workflow
-
Update version in
MaksIT.Core/MaksIT.Core.csproj -
Generate changelog (uses AI with Ollama if available):
cd src/scripts .\Generate-Changelog.ps1 # Updates CHANGELOG.md and LICENSE.md year .\Generate-Changelog.ps1 -DryRun # Preview without changes -
Review and commit all changes:
git add -A git commit -m "(chore): release v1.x.x" -
Create version tag:
git tag v1.x.x -
Run release script:
cd src/scripts .\Release-NuGetPackage.ps1 # Full release .\Release-NuGetPackage.ps1 -DryRun # Test without publishing
Generate-Changelog.ps1
AI-assisted changelog generation using a 3-pass LLM pipeline with Ollama.
What it does:
- Analyzes uncommitted changes and converts them to changelog items
- Consolidates similar items and removes duplicates
- Formats output in Keep a Changelog format
- Updates LICENSE.md copyright year if needed
Usage:
.\Generate-Changelog.ps1 # Generate and update files
.\Generate-Changelog.ps1 -DryRun # Preview without changes
Configuration: changelogsettings.json
- LLM models for each pass
- Prompt templates
- File paths
Release-NuGetPackage.ps1
Builds, tests, and publishes the package to NuGet.org and GitHub.
The script is IDEMPOTENT - you can safely re-run it if any step fails. It will skip already-completed steps and only create what's missing.
What it does:
- Validates prerequisites and environment
- Checks if already released on NuGet.org (skips if exists)
- Checks if GitHub release exists (skips if exists)
- Runs security vulnerability scan
- Builds and tests on Windows
- Builds and tests on Linux (via Docker)
- Analyzes code coverage
- Creates NuGet package (.nupkg and .snupkg)
- Pushes to NuGet.org
- Creates GitHub release with assets
Usage:
.\Release-NuGetPackage.ps1 # Full release
.\Release-NuGetPackage.ps1 -DryRun # Test without publishing
Idempotent behavior:
| Target | Already Released | Action |
|---|---|---|
| NuGet.org | Yes | Skip |
| NuGet.org | No | Publish |
| GitHub | Yes | Skip |
| GitHub | No | Create release |
Validation checks:
- Version source: Reads latest version from
CHANGELOG.md - Tag required: Must have a tag matching the changelog version (e.g.,
v1.2.3) - Branch validation: Tag must be on configured branch (default:
main) - Clean working directory: No uncommitted changes allowed
Configuration: scriptsettings.json
Force-AmendTaggedCommit.ps1
Fixes mistakes in the last tagged commit by amending it and force-pushing.
When to use:
- You noticed an error after committing and tagging
- Need to add forgotten files to the release commit
- Need to fix a typo in the release
What it does:
- Verifies the last commit has an associated tag
- Stages all pending changes
- Amends the latest commit (keeps existing message)
- Deletes and recreates the tag on the amended commit
- Force pushes the branch and tag to origin
Usage:
.\Force-AmendTaggedCommit.ps1 # Amend and force push
.\Force-AmendTaggedCommit.ps1 -DryRun # Preview without changes
Warning: This rewrites history. Only use on commits that haven't been pulled by others.
Fixing a Failed Release
If the release partially failed (e.g., NuGet succeeded but GitHub failed):
-
Just re-run the release script:
.\Release-NuGetPackage.ps1The script will skip NuGet (already released) and create the GitHub release.
-
If you need to fix the commit content:
# Make your fixes, then: .\Force-AmendTaggedCommit.ps1 .\Release-NuGetPackage.ps1
License
By contributing, you agree that your contributions will be licensed under the MIT License.