fix: finish all 3 remaining in-construction functions - #117
Merged
Merged
Conversation
Get-PiHoleList: was fully functional already (heavily exercised all
session as a dependency of Add/Remove/Update-PiHoleList), just had the WIP
flag lingering and an incomplete docstring (missing -List param docs,
.DESCRIPTION, .EXAMPLE).
Get-PiHoleLogWebserver: wasn't exported at all, had the stray break bug,
and its formatted-output branch was a literal empty stub
(`#$ObjectFinal = @()`, did nothing). Also fixed a real bug found while
rewriting it: the nextID query parameter was sent as `nextId` (wrong
case) - confirmed against the live API spec, which names it `nextID`.
Rewrote the formatted output as {Log, NextID, Pid, File}, preserving the
NextID field so incremental polling (the endpoint's whole reason for
existing) actually works from PowerShell. Exported it.
Get-PiHoleTeleporterDownload: wasn't exported, had the stray break bug, a
copy-pasted wrong .SYNOPSIS ("Get info about logs for webserver"), and
assumed the downloaded backup was a .tar.gz - the live API spec documents
the response as application/zip, confirmed by actually downloading a file
and checking its magic bytes (50 4B 03 04, a real ZIP) and opening it with
System.IO.Compression.ZipFile. Removed the RawOutput parameter, since the
API always returns a binary archive rather than JSON - there's no
alternate raw representation for it to toggle to. Exported it.
Verified all three against a real Pi-hole v6 server. Added dedicated
integration test files for the latter two (Get-PiHoleList already had
one). README regenerated to drop the WIP flag and list the two newly
exported functions.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 task done
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
Fixes the last 3 functions still flagged as "in construction" (🚧 or unexported):
Get-PiHoleListwas fully functional already (heavily exercised all session as a dependency ofAdd/Remove/Update-PiHoleList) - just had the WIP flag lingering and an incomplete docstring (missing-Listparam docs,.DESCRIPTION,.EXAMPLE).Get-PiHoleLogWebserverwasn't exported at all, had the straybreakbug, and its formatted-output branch was a literal empty stub (#$ObjectFinal = @(), did nothing). Also fixed a real bug found while rewriting it: thenextIDquery parameter was sent asnextId(wrong case) - confirmed against the live API spec, which names itnextID. Rewrote the formatted output as{Log, NextID, Pid, File}, preservingNextIDso incremental polling (the endpoint's whole reason for existing) actually works from PowerShell. Now exported.Get-PiHoleTeleporterDownloadwasn't exported, had the straybreakbug, a copy-pasted wrong.SYNOPSIS("Get info about logs for webserver"), and assumed the downloaded backup was a.tar.gz- the live API spec documents the response asapplication/zip, confirmed by actually downloading a file and checking its magic bytes (50 4B 03 04, a real ZIP) and opening it withSystem.IO.Compression.ZipFile. Removed the-RawOutputparameter, since the API always returns a binary archive rather than JSON - there's no alternate raw representation for it to toggle to. Now exported.With this merged, there are no more "in construction" functions in the module.
Test plan
Invoke-ScriptAnalyzer -Path .\PiHoleShell -Recurse- cleanGet-PiHoleListalready had one) - 8 new tests, all passingREADME.md🤖 Generated with Claude Code