Skip to content

ci: don't run the full test suite for pure export additions to PiHoleShell.psm1 - #124

Merged
mikemadeja merged 1 commit into
developfrom
ci/scope-psm1-additions
Sep 29, 2026
Merged

mikemadeja merged 1 commit into
developfrom
ci/scope-psm1-additions

Conversation

@mikemadeja

Copy link
Copy Markdown
Owner

Summary

  • Every feature PR adds its new functions' names to PiHoleShell.psm1's Export-ModuleMember list - which previously always forced the full Pester suite to run on a PR build (via the "shared/core file changed" fallback). Since that's the one file nearly every PR touches, it was quietly defeating the changed-file scoping added in an earlier PR (chore: reorg tests to mirror module structure, scope CI to changed files #110): every recent feature PR ran the full suite regardless of how small its actual change was.
  • A pure addition to the export list can't break any existing, already-passing test, so this only falls back to the full suite when an existing export was actually removed.
  • Comparing whole diff lines doesn't work here since several exports share one line - adding a new function to an existing category's line shows as that whole line being removed and re-added, even though nothing already there was dropped. Instead, this extracts the quoted names from just the removed lines and just the added lines and compares those sets: a name that reappears in the added lines was only reformatted, not actually removed.
  • PiHoleShell.psd1, PiHoleShell/Private/, and the other existing "always run everything" triggers are untouched - this only changes the .psm1 export-list case specifically.

Test plan

  • Extracted the pipeline's PowerShell step in isolation and syntax-checked it.
  • Verified against real PR diffs from this session using a git worktree (without touching the live pipeline or pushing anything): a pure-addition change (adding Config's new functions to the Config category's existing export line) correctly skips the fallback and reports "no full-suite fallback needed"; a synthetic removal case correctly still triggers the fallback.
  • Note: PR feat: add Config write/property functions, completing the Config API area #123 (currently open) also touches PiHoleShell/Private/Misc.ps1, which is a separate, unrelated, intentionally-still-conservative trigger - so that PR will still run the full suite even after this change, exactly as expected.

🤖 Generated with Claude Code

…Shell.psm1

Every feature PR adds its new functions' names to PiHoleShell.psm1's
Export-ModuleMember list, which previously always forced the full
Pester suite to run on a PR build - the one file nearly every PR
touches was exactly the one that defeated the changed-file scoping
added in an earlier PR.

A pure addition to the export list can't break any existing,
already-passing test, so only fall back to the full suite when an
existing export was actually removed. Comparing whole diff lines
doesn't work here since several exports share one line - adding a new
function to an existing category's line shows as that whole line being
removed and re-added, even though nothing already there was dropped.
Instead, this extracts the quoted names from just the removed lines
and just the added lines and compares those sets: a name that
reappears in the added lines was only reformatted, not actually
removed.

Verified against real PR diffs from this session (via git worktree,
without touching the live pipeline): a pure-addition change (adding
Config's new functions to the Config category's existing line)
correctly skips the fallback, and a synthetic removal correctly still
triggers it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mikemadeja
mikemadeja merged commit e3d8ae0 into develop Sep 29, 2026
3 checks passed
@mikemadeja mikemadeja mentioned this pull request Sep 29, 2026
1 task done
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