Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
466bc93
feat(tests): add unit tests for Invoke-HaloRequest with various scena…
homotechsual Apr 28, 2026
b433658
feat(tests): add routing tests for Get-Halo cmdlets in HaloAPI
homotechsual Apr 28, 2026
76d02c4
feat(tests): add routing tests for Get-HaloProject, Get-HaloTemplate,…
homotechsual Apr 28, 2026
569abf4
feat(tests): add routing tests for Get-HaloCustomField, Get-HaloDistr…
homotechsual Apr 28, 2026
03a6cb0
feat(ci): increase minimum coverage threshold for Unit suite to 30%
homotechsual Apr 28, 2026
1d5ce25
feat(tests): add unit tests for Invoke-HaloBatchItem to validate comm…
homotechsual Apr 28, 2026
6f068dc
feat(ci): increase minimum coverage threshold for Unit suite to 35%
homotechsual Apr 28, 2026
db894fa
fix(workspace): remove unused folder reference for NinjaOne
homotechsual Apr 28, 2026
b3a3902
feat(tests): enhance Connect-HaloAPI tests for Key Vault integration …
homotechsual Apr 28, 2026
ec509a9
feat(tests): add tests for Connect-HaloAPI to validate Key Vault inte…
homotechsual Apr 28, 2026
f82da16
feat(ci): increase minimum coverage threshold for Unit suite to 40%
homotechsual Apr 28, 2026
54c5b50
feat(tests): add routing tests for Get-HaloAction, Get-HaloField, Get…
homotechsual Apr 28, 2026
0cfa3a3
feat(ci): increase minimum coverage threshold for Unit suite to 45%
homotechsual Apr 28, 2026
ddb4992
feat(ci): increase minimum coverage threshold for Unit suite to 50%
homotechsual Apr 28, 2026
1212123
feat(ci): increase minimum coverage threshold for Unit suite to 50%
homotechsual Apr 28, 2026
1d0b8d5
feat(ci): increase minimum coverage threshold for Unit suite to 55%
homotechsual Apr 28, 2026
124456a
feat(ci): increase minimum coverage threshold for Unit suite to 60%
homotechsual Apr 28, 2026
cbecb89
feat(ci): update minimum coverage threshold for Unit suite to 63% and…
homotechsual Apr 28, 2026
c1615f6
feat(tests): add tests for Set-HaloSoftwareLicence and Set-HaloArticl…
homotechsual Apr 28, 2026
bbdafbb
feat(tests): add tests for New-HaloTicketType, New-HaloProject, New-H…
homotechsual Apr 28, 2026
d7cde84
feat(ci): increase minimum coverage threshold for Unit suite to 64%
homotechsual Apr 28, 2026
7b78b18
feat(ci): increase minimum coverage threshold for Unit suite to 65%
homotechsual Apr 28, 2026
ab9d947
feat(tests): add tests for New-HaloCategory, New-HaloClient, New-Halo…
homotechsual Apr 28, 2026
ed13912
Refactor code structure for improved readability and maintainability
homotechsual Apr 28, 2026
8cafc40
feat(tests): add tests for New-HaloFAQList, New-HaloInvoice, New-Halo…
homotechsual Apr 28, 2026
aab5040
feat(ci): increase minimum coverage threshold for Unit suite to 70%
homotechsual Apr 28, 2026
e0804e8
fix(New-HaloOpportunityBatch): correct parameter names for opportunit…
homotechsual Apr 28, 2026
2da1788
fix(README): update HaloPSA Community Discord link
homotechsual Apr 28, 2026
72a037f
feat(cspell): add cspell configuration file for spell checking
homotechsual Apr 28, 2026
b86aad3
feat(Get-HaloTicket): enhance pagination handling and add related tests
homotechsual Apr 29, 2026
a3093ee
chore: update version to 1.23.1 and document pagination fix in changelog
homotechsual Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This file is generated by DevOps/Quality/Generate-CodecovComponents.ps1
# Source of truth: DevOps/Quality/codecov-components-map.json
component_management:
individual_components:
- component_id: tickets
name: Tickets
paths:
- Public/**/*Ticket*.ps1
- Private/**/*Ticket*.ps1
- Classes/**/*Ticket*.psm1
- component_id: actions
name: Actions
paths:
- Public/**/*Action*.ps1
- Private/**/*Action*.ps1
- Data/Templates/Action.json
- component_id: assets
name: Assets
paths:
- Public/**/*Asset*.ps1
- Private/**/*Asset*.ps1
- Data/Templates/Asset.json
- component_id: clients
name: Clients
paths:
- Public/**/*Client*.ps1
- Public/**/*Site*.ps1
- Public/**/*Supplier*.ps1
- Data/Templates/Client.json
- Data/Templates/Site.json
- Data/Templates/Supplier.json
- component_id: billing
name: Billing
paths:
- Public/**/*Invoice*.ps1
- Public/**/*Quote*.ps1
- Public/**/*BillingTemplate*.ps1
- Public/**/*SalesOrder*.ps1
- Data/Templates/Invoice.json
- Data/Templates/Quote.json
- component_id: knowledge
name: Knowledge
paths:
- Public/**/*KB*.ps1
- Public/**/*FAQ*.ps1
- Public/**/*Article*.ps1
- Data/Templates/KBArticle.json

8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ jobs:
$ErrorActionPreference = 'Stop'
& "$env:GITHUB_WORKSPACE\Bootstrap.ps1"

- name: Validate Codecov component config
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
pwsh -NoProfile -File "$env:GITHUB_WORKSPACE\DevOps\Quality\Generate-CodecovComponents.ps1" -Validate

- name: Run metadata tests
shell: pwsh
run: |
Expand Down Expand Up @@ -141,7 +147,7 @@ jobs:
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
pwsh -NoProfile -File "$env:GITHUB_WORKSPACE\DevOps\Quality\test.ps1" -Suite Unit -Verbosity Detailed -CodeCoverage -MinimumCoveragePercent 20
pwsh -NoProfile -File "$env:GITHUB_WORKSPACE\DevOps\Quality\test.ps1" -Suite Unit -Verbosity Detailed -CodeCoverage -MinimumCoveragePercent 70

- name: Upload unit test results
if: always()
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Sign-Module.ps1
.artifacts/
TestResults.xml
resource_mappings*.csv
test_output.txt
cmdlets.txt
tests_content.txt
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

If you contributed one of these and there's no credit in the line PR to add it or let me know!

## 2026-04-29 - Version 1.23.1

* Fix `Get-HaloTicket` pagination behavior so explicitly providing `-PageNo` and/or `-PageSize` no longer auto-fetches all pages.

## 2026-04-26 - Version 1.23.0

* Add new cmdlets and endpoints including Sales Orders, Templates, Distribution Lists, Controls, Asset Groups, and Custom Field removal.
Expand Down
98 changes: 98 additions & 0 deletions DevOps/Quality/Generate-CodecovComponents.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<#
.SYNOPSIS
Generates the repository Codecov components configuration from a JSON map.
.DESCRIPTION
Produces .codecov.yml from DevOps/Quality/codecov-components-map.json.
When -Validate is provided, compares generated content to the checked-in
file and fails if drift is detected.
#>
[CmdletBinding()]
param(
[string]$MapPath,
[string]$OutputPath,
[switch]$Validate
)

$repoRoot = Resolve-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath '..\..')

if (-not $MapPath) {
$MapPath = Join-Path -Path $PSScriptRoot -ChildPath 'codecov-components-map.json'
}
if (-not $OutputPath) {
$OutputPath = Join-Path -Path $repoRoot -ChildPath '.codecov.yml'
}

if (-not (Test-Path -Path $MapPath)) {
throw ('Codecov component map file not found: {0}' -f $MapPath)
}

$map = Get-Content -Path $MapPath -Raw | ConvertFrom-Json
if ($null -eq $map.components -or $map.components.Count -eq 0) {
throw 'Codecov component map does not contain any components.'
}

$generatedLines = @(
'# This file is generated by DevOps/Quality/Generate-CodecovComponents.ps1',
'# Source of truth: DevOps/Quality/codecov-components-map.json',
'component_management:',
' individual_components:'
)

foreach ($component in $map.components) {
if ([string]::IsNullOrWhiteSpace($component.id)) {
throw 'A component id is missing in the map file.'
}
if ([string]::IsNullOrWhiteSpace($component.name)) {
throw ('Component ''{0}'' is missing a name in the map file.' -f $component.id)
}
if ($null -eq $component.paths -or $component.paths.Count -eq 0) {
throw ('Component ''{0}'' does not define any paths in the map file.' -f $component.id)
}

$generatedLines += (' - component_id: {0}' -f $component.id)
$generatedLines += (' name: {0}' -f $component.name)
$generatedLines += ' paths:'

foreach ($pathPattern in $component.paths) {
if ([string]::IsNullOrWhiteSpace($pathPattern)) {
continue
}
$generatedLines += (' - {0}' -f $pathPattern)
}
}

$generatedContent = ($generatedLines -join "`n") + "`n"

function Normalize-TextForComparison {
param(
[string]$Text
)

if ($null -eq $Text) {
return ''
}

$normalized = $Text -replace "`r`n", "`n"
if ($normalized.Length -gt 0 -and $normalized[0] -eq [char]0xFEFF) {
$normalized = $normalized.Substring(1)
}

return $normalized.TrimEnd("`n")
}

if ($Validate) {
if (-not (Test-Path -Path $OutputPath)) {
throw ('Codecov config file is missing: {0}' -f $OutputPath)
}

$existingContent = Get-Content -Path $OutputPath -Raw
if ((Normalize-TextForComparison -Text $existingContent) -ne (Normalize-TextForComparison -Text $generatedContent)) {
throw 'Codecov component config drift detected. Run: pwsh -File .\DevOps\Quality\Generate-CodecovComponents.ps1'
}

Write-Host 'Codecov component config validation passed.' -ForegroundColor Green
return
}

Set-Content -Path $OutputPath -Value $generatedContent -Encoding utf8
Write-Host ('Generated Codecov component config at: {0}' -f $OutputPath) -ForegroundColor Green
65 changes: 65 additions & 0 deletions DevOps/Quality/codecov-components-map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"components": [
{
"id": "tickets",
"name": "Tickets",
"paths": [
"Public/**/*Ticket*.ps1",
"Private/**/*Ticket*.ps1",
"Classes/**/*Ticket*.psm1"
]
},
{
"id": "actions",
"name": "Actions",
"paths": [
"Public/**/*Action*.ps1",
"Private/**/*Action*.ps1",
"Data/Templates/Action.json"
]
},
{
"id": "assets",
"name": "Assets",
"paths": [
"Public/**/*Asset*.ps1",
"Private/**/*Asset*.ps1",
"Data/Templates/Asset.json"
]
},
{
"id": "clients",
"name": "Clients",
"paths": [
"Public/**/*Client*.ps1",
"Public/**/*Site*.ps1",
"Public/**/*Supplier*.ps1",
"Data/Templates/Client.json",
"Data/Templates/Site.json",
"Data/Templates/Supplier.json"
]
},
{
"id": "billing",
"name": "Billing",
"paths": [
"Public/**/*Invoice*.ps1",
"Public/**/*Quote*.ps1",
"Public/**/*BillingTemplate*.ps1",
"Public/**/*SalesOrder*.ps1",
"Data/Templates/Invoice.json",
"Data/Templates/Quote.json"
]
},
{
"id": "knowledge",
"name": "Knowledge",
"paths": [
"Public/**/*KB*.ps1",
"Public/**/*FAQ*.ps1",
"Public/**/*Article*.ps1",
"Data/Templates/KBArticle.json"
]
}
]
}
4 changes: 2 additions & 2 deletions Docs/HaloAPI/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_position: 0
[![GitHub contributors](https://img.shields.io/github/contributors/homotechsual/haloapi?style=for-the-badge&logo=github)](https://github.com/homotechsual/haloapi/)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/homotechsual/HaloAPI/release.yml?style=for-the-badge&label=Release)](https://github.com/homotechsual/HaloAPI/actions/workflows/release.yml)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/homotechsual/HaloAPI/ci.yml?style=for-the-badge&label=CI)](https://github.com/homotechsual/HaloAPI/actions/workflows/ci.yml)
![Codecov (with branch)](https://img.shields.io/codecov/c/github/homotechsual/HaloAPI/develop?style=for-the-badge)
[![Codecov (with branch)](https://img.shields.io/codecov/c/github/homotechsual/HaloAPI/develop?style=for-the-badge)](https://codecov.io/gh/homotechsual/HaloAPI)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/HaloAPI?style=for-the-badge)](https://www.powershellgallery.com/packages/HaloAPI/)
[![License](https://img.shields.io/github/license/homotechsual/HaloAPI?style=for-the-badge)](https://mit.license.homotechsual.dev)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/homotechsual?style=for-the-badge)](https://github.com/sponsors/homotechsual/)
Expand All @@ -26,7 +26,7 @@ This module provides a PowerShell interface to the Halo API. It's designed to fo

Code coverage is generated in CI for the `Meta` and `Unit` suites.

CI enforces a minimum 20% coverage threshold for the `Unit` suite.
CI enforces a minimum 70% coverage threshold for the `Unit` suite.

Coverage artifacts are uploaded for each run as:

Expand Down
20 changes: 15 additions & 5 deletions HaloAPI.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"folders": [
{
"path": ".",
},
{
"path": "../NinjaOne",
},
}
],
"settings": {
"editor.tabSize": 4,
Expand Down Expand Up @@ -227,8 +224,21 @@
"matchCommandLine": true,
},
"PSObject": true,
"/^pwsh -File \\.\\\\DevOps\\\\Quality\\\\test\\.ps1 -Suite Unit -Verbosity Detailed -CodeCoverage -MinimumCoveragePercent 20$/": {
"approve": true,
"matchCommandLine": true,
},
Comment on lines +227 to +230

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The terminal auto-approve rule is still keyed to running unit tests with -MinimumCoveragePercent 20, but CI/docs in this PR raise the unit minimum to 70. Update this regex to match the new minimum (or remove it) so local runs align with CI expectations.

Copilot uses AI. Check for mistakes.
},
"cSpell.words": ["HAPI"],
"cSpell.words": [
"Analyzed",
"dorny",
"HALOTESTINGCLIENTID",
"HALOTESTINGTENANT",
"HALOTESTINGURL",
"HAPI",
"pscustomobject",
"vars",
],
"codeQL.githubDatabase.download": "never",
},
}
2 changes: 1 addition & 1 deletion HaloAPI.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = '.\HaloAPI.psm1'

# Version number of this module.
ModuleVersion = '1.23.0'
ModuleVersion = '1.23.1'

# Supported PSEditions
CompatiblePSEditions = @('Core')
Expand Down
Loading