mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-07-26 07:58:14 +00:00
a8a9cc28b1
- Add CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md - Add .gitattributes for line ending normalization - Add GitHub issue templates (bug report, feature request) - Add pull request template - Add publish.yml workflow for PSGallery publication on tag push Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.6 KiB
3.6 KiB
Contributing to PSProxmoxVE
Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to PSProxmoxVE.
Development Setup
Prerequisites
- .NET SDK 9.0+
- PowerShell 7.2+ (for running Pester tests)
- Pester 5 (
Install-Module Pester -MinimumVersion 5.0 -Force) - An IDE with C# support (Visual Studio, VS Code with C# Dev Kit, Rider)
Building
# Clone the repository
git clone https://github.com/goodolclint/PSProxmoxVE.git
cd PSProxmoxVE
# Restore and build
dotnet build
# Publish for local testing
dotnet publish src/PSProxmoxVE/PSProxmoxVE.csproj --framework netstandard2.0 --output ./publish/netstandard2.0
Running Tests
# xUnit unit tests (C# core library)
dotnet test tests/PSProxmoxVE.Core.Tests
# Pester cmdlet tests (requires built module)
pwsh -Command "Invoke-Pester -Path tests/PSProxmoxVE.Tests -ExcludeTag Integration"
# Integration tests (requires live PVE node -- see tests/infrastructure/README.md)
pwsh -Command "Invoke-Pester -Path tests/PSProxmoxVE.Tests/Integration -Tag Integration"
Coding Standards
C# Style
- Use C# 10.0 language features.
- Enable nullable reference types (
#nullable enable). - Follow standard .NET naming conventions (PascalCase for public members, camelCase for locals).
- Use 4-space indentation (see
.editorconfig).
Cmdlet Design
- Verb-Noun naming: Use approved PowerShell verbs (
Get-Verbto see the list). Noun prefix is alwaysPve. - ShouldProcess: All mutating cmdlets must implement
SupportsShouldProcess = trueand callShouldProcess(). - ConfirmImpact: Set
ConfirmImpact.Highon destructive operations (Remove, Stop, Reset). - OutputType: Every cmdlet must have an
[OutputType]attribute. - Pipeline support: Use
ValueFromPipelineByPropertyName = trueonNode,VmId, and similar parameters. - WriteVerbose: Add a
WriteVerbosecall describing the API operation before making API calls. - HelpMessage: All
[Parameter]attributes should include aHelpMessage. - ValidateRange: VmId parameters should have
[ValidateRange(100, 999999999)].
Commit Convention
This project uses Conventional Commits:
feat:-- new featurefix:-- bug fixtest:-- test additions or changesci:-- CI/CD changesdocs:-- documentation changesrefactor:-- code refactoringchore:-- maintenance tasks
Pull Request Process
- Fork the repository and create a feature branch from
main. - Make your changes following the coding standards above.
- Add or update tests for your changes.
- Ensure
dotnet buildsucceeds with zero warnings. - Ensure all existing tests pass.
- Update
CHANGELOG.mdunder[Unreleased]with a description of your change. - Submit a pull request with a clear description of the change and its motivation.
Adding a New Cmdlet
- Create the cmdlet class in the appropriate
Cmdlets/subdirectory. - Create or extend a service class in
PSProxmoxVE.Core/Services/. - Add model classes in
PSProxmoxVE.Core/Models/if needed. - Add the cmdlet name to
CmdletsToExportinPSProxmoxVE.psd1. - Add Pester unit tests in
tests/PSProxmoxVE.Tests/. - Add integration test coverage in
Integration.Tests.ps1if applicable. - Update
README.mdcmdlet reference table.
Reporting Issues
- Use GitHub Issues for bug reports and feature requests.
- For security vulnerabilities, see SECURITY.md.