develop #7

Merged
Arnike merged 4 commits from develop into main 2026-01-19 17:35:20 +03:00
Owner

Summary

Major refactoring of the PS.IPAM C# class library to improve code quality, maintainability, and follow C# best practices.

Key Changes:

  • Model classes converted to C# records - Address, Subnetwork, Vlan, Vrf, Section, Tag, Domain, Session now use concise record syntax with immutable properties

  • Enum naming conventions fixed - All enums now use PascalCase (ApiController, ApiSubController, ModelType, AuthType)

  • New SessionStatus enum - Replaces magic strings ("NoToken", "Expired", "Valid") with strongly-typed enum values

  • Base cmdlet class extracted - BaseCmdlet provides shared functionality (WriteResult, ConvertCustomFields, ExecuteAsync) eliminating code duplication across 20 cmdlets

  • RequestHelper refactored - Split into smaller methods, added HttpMethod-based overload, improved error handling

  • SessionManager improved - Renamed methods to follow async naming conventions, added XML documentation

  • Removed unnecessary inheritance - Vlan no longer inherits from DynamicObject

Test plan

  • All 114 unit tests pass

  • Build succeeds for both classlib and classlib.tests projects

  • Manual testing of cmdlets against a phpIPAM instance

  • Verify PowerShell module loads correctly with Import-Module

## Summary Major refactoring of the PS.IPAM C# class library to improve code quality, maintainability, and follow C# best practices. Key Changes: - Model classes converted to C# records - Address, Subnetwork, Vlan, Vrf, Section, Tag, Domain, Session now use concise record syntax with immutable properties - Enum naming conventions fixed - All enums now use PascalCase (ApiController, ApiSubController, ModelType, AuthType) - New SessionStatus enum - Replaces magic strings ("NoToken", "Expired", "Valid") with strongly-typed enum values - Base cmdlet class extracted - BaseCmdlet provides shared functionality (WriteResult, ConvertCustomFields, ExecuteAsync) eliminating code duplication across 20 cmdlets - RequestHelper refactored - Split into smaller methods, added HttpMethod-based overload, improved error handling - SessionManager improved - Renamed methods to follow async naming conventions, added XML documentation - Removed unnecessary inheritance - Vlan no longer inherits from DynamicObject ## Test plan - [x] All 114 unit tests pass - [x] Build succeeds for both classlib and classlib.tests projects - [ ] Manual testing of cmdlets against a phpIPAM instance - [ ] Verify PowerShell module loads correctly with Import-Module
Arnike self-assigned this 2026-01-19 17:33:36 +03:00
Arnike added 4 commits 2026-01-19 17:33:37 +03:00
Update Gitea CI workflow to restore class library and test project dependencies separately
Some checks failed
CI/CD Pipeline / Build and Test (push) Failing after 1m6s
CI/CD Pipeline / Package Module (push) Has been skipped
CI/CD Pipeline / Create Release (push) Has been skipped
df30851a3a
Update Gitea CI workflow to downgrade upload and download artifact actions from v4 to v3
All checks were successful
CI/CD Pipeline / Build and Test (push) Successful in 1m18s
CI/CD Pipeline / Package Module (push) Has been skipped
CI/CD Pipeline / Create Release (push) Has been skipped
694822f0d6
Add IsExternalInit type, BaseCmdlet class, and SessionStatus enum
All checks were successful
CI/CD Pipeline / Build and Test (push) Successful in 1m3s
CI/CD Pipeline / Package Module (push) Has been skipped
CI/CD Pipeline / Create Release (push) Has been skipped
CI/CD Pipeline / Build and Test (pull_request) Successful in 1m7s
CI/CD Pipeline / Package Module (pull_request) Has been skipped
CI/CD Pipeline / Create Release (pull_request) Has been skipped
bc86ad2965
Introduce the IsExternalInit type for C# 9 records compatibility in .NET Standard 2.1. Implement BaseCmdlet class to provide common functionality for cmdlets, including methods for writing results and handling async operations. Add SessionStatus enum to represent API session states.
Arnike merged commit 7b9d229289 into main 2026-01-19 17:35:20 +03:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Arnike/ps.ipam#7
No description provided.