Fix Actions endpoint bugs, add real-server integration tests, CI pipeline, and modernized README - #77
Merged
Merged
Conversation
Invoke-PiHoleFlushNetwork posted to /api/action/flush/logs instead of
/api/action/flush/network. Both it and Restart-PiHoleDnsService built
the request URL via string interpolation of the [uri] PiHoleServer
value, which appends a trailing slash and produced a double slash
that the real API 404s on. Both now use .ToString().TrimEnd('/').
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds Pester integration tests for Invoke-PiHoleFlushNetwork, Restart-PiHoleDnsService, and Update-PiHoleActionsGravity that run against a live Pi-hole server instead of mocks. Tests are tagged 'Integration' and skip automatically unless tests/IntegrationConfig.local.ps1 is present; that file is gitignored so real server credentials never get committed. A tracked IntegrationConfig.example.ps1 documents the expected shape. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add badges, a table of contents, a command reference grouped by category (flagging work-in-progress functions), and a testing section covering the new unit/integration Pester split. Also fixes the Pi-hole app-password screenshot links, which used backslash paths that don't render on GitHub. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Runs on the mmadeja-dt self-hosted agent so it can reach the internal Pi-hole server and exercise both the mocked unit tests and the real-server integration tests. The integration config file is written from secret pipeline variables (PiHoleTestServer/PiHoleTestToken) and deleted after the run regardless of outcome. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… building
Matches the pattern already used elsewhere in the module. Building the
request URL from .OriginalString instead of ToString().TrimEnd('/')
needs PiHoleServer to actually be a [uri] object; it was previously
untyped, so a caller passing a plain string (as the function's own
.EXAMPLE showed) would have silently produced a broken relative URL.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Invoke-PiHoleFlushNetwork and Restart-PiHoleDnsService were the only functions in the module missing [Parameter(Mandatory = $true)] [string]$Password, unlike every other public function. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Fix Actions endpoint bugs, add real-server integration tests, modernize README
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Invoke-PiHoleFlushNetworkhitting the wrong endpoint (/api/action/flush/logsinstead of/api/action/flush/network) and a double-slash URL bug shared withRestart-PiHoleDnsService, both confirmed 404ing against a real server. Both functions now also type$PiHoleServeras[System.URI]and$Passwordas mandatory[string], matching every other function in the module.Actionsfunctions that run against a live Pi-hole server (taggedIntegration, skipped automatically without a local config file so no credentials are ever committed).azuredevops-pihole-pester-tests.yml) that runs on an on-prem self-hosted agent able to reach the internal Pi-hole server, running both unit and integration tests on push/PR.README.md: badges, a full command reference by category, a testing section, and fixed image links that used non-portable backslash paths.Test plan
Invoke-Pester -Path .\tests -TagFilter Integration— all integration tests pass against a live Pi-hole v6 serverInvoke-Pester -Path .\tests\Set-PiHoleDnsBlocking.Tests.ps1— confirmed its pre-existing failure predates this change (present onmaintoo)Invoke-ScriptAnalyzer -Path .\PiHoleShell\Public\Actions -Recurse— no findings🤖 Generated with Claude Code