Skip to content

Promote develop to main - #114

Merged
mikemadeja merged 4 commits into
mainfrom
develop
Sep 26, 2026
Merged

mikemadeja merged 4 commits into
mainfrom
develop

Conversation

@mikemadeja

Copy link
Copy Markdown
Owner

Summary

Promotes the following merged PRs from develop to main:

Test plan

  • Both source PRs passed PSScriptAnalyzer and the full Pester suite (including real-server integration tests) in CI before merging into develop

🤖 Generated with Claude Code

mikemadeja and others added 4 commits September 25, 2026 12:29
Implements the remaining "FTL information" endpoints, closing 10 of the
original 54 missing API operations:

- Get-PiHoleInfoClient (/info/client) - info about the requesting client
- Get-PiHoleInfoLogin (/info/login) - login page info
- Get-PiHoleInfoSystem (/info/system) - uptime, memory, CPU
- Get-PiHoleInfoFtl (/info/ftl) - gravity/group/list counts, dnsmasq metrics
- Get-PiHoleInfoSensors (/info/sensors) - temperature sensors
- Get-PiHoleInfoDatabase (/info/database) - long-term DB file/query stats
- Get-PiHoleInfoVersion (/info/version) - Core/Web/FTL/Docker versions
- Get-PiHoleInfoMetrics (/info/metrics) - live DNS/DHCP metrics
- Get-PiHoleInfoMessageCount (/info/messages/count)
- Remove-PiHoleInfoMessage (/info/messages/{id}) - supports comma-separated
  multiple IDs per the API

Get-PiHoleInfoClient and Get-PiHoleInfoLogin intentionally have no
-Password parameter and never call Request-PiHoleAuth: the live API spec
marks both with `security: []`, and this was confirmed against the real
server (both work with zero auth headers). This makes sense given their
purpose - info needed to render the login page has to be available before
you're logged in.

Get-PiHoleInfoDatabase's earliest_timestamp/earliest_timestamp_disk are
returned as $null (not epoch 1970) when the API sends 0, since the spec
documents 0.0 as meaning "no queries stored yet" - the same zero-guard
pattern already used for Get-PiHoleList's DateUpdated.

Also fixed Get-PiHoleInfoMessage while in the area: it had the same stray
break in its catch block fixed elsewhere in the module (silently aborts
the calling script on error), and was missing a real .DESCRIPTION/.EXAMPLE.

Verified all 10 new functions against a real Pi-hole v6 server: formatted
output, RawOutput, and (where applicable) bad-password/not-found error
handling. Added dedicated integration test files (33 tests total across
the FTLInformation folder). README regenerated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feat: complete the Info API area (10 new functions)
Implements PUT /api/lists/{list}, the last missing piece of List
management - Add-PiHoleList's own "already exists" error has referenced
this function by name since it was written. Updates an existing list's
Comment, Group(s), and/or Enabled state.

Like Update-PiHoleGroup, the underlying API replaces the entire list on
update, so this reads the list's current values first and only overrides
whichever of Comment/Group/Enabled was actually passed - using the same
$PSBoundParameters.ContainsKey() pattern (rather than checking parameter
values for $null), since that was the actual root cause of the bug fixed
in Update-PiHoleGroup: an unbound [string] binds to "", and [bool] can
never be $null, so value-based checks can't reliably detect "not passed".

Verified type only needs to be a query parameter (?type=block), not also
in the request body, by testing directly against the real server - the
API's own documented PUT body schema lists `type` as a body field too, but
(like the POST endpoint's documented schema, which turned out to expect
type in the query string only despite listing it in the body schema) the
server accepted both a query-only and query+body request identically.

The other remaining Lists gap, DELETE /lists/{list} (single item), isn't
being added as a separate function: Remove-PiHoleList already achieves the
same outcome via the batch endpoint (a batch of one) - same reasoning
already applied to skip the deprecated POST /action/flush/arp.

Verified against a real Pi-hole v6 server: partial updates (confirming the
untouched field is preserved), RawOutput, and not-found/missing-parameter/
bad-password errors. Added a dedicated integration test file (6 tests).
README regenerated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feat: add Update-PiHoleList, completing the Lists API area
@mikemadeja
mikemadeja merged commit b9288d9 into main Sep 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant