ci: don't run the full test suite for pure export additions to PiHoleShell.psm1 - #124
Merged
Merged
Conversation
…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]>
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
PiHoleShell.psm1'sExport-ModuleMemberlist - 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.PiHoleShell.psd1,PiHoleShell/Private/, and the other existing "always run everything" triggers are untouched - this only changes the.psm1export-list case specifically.Test plan
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.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