⚙️ [Maintenance]: Pinned PowerShell Gallery module versions kept current automatically - #156
Open
Marius Storhaug (MariusStorhaug) wants to merge 8 commits into
Open
Conversation
Dependabot has no PowerShell Gallery ecosystem, so nothing on the platform moves a pin like the Pester one in Invoke-PesterSuite.ps1. The script reads the pinned version through a caller-supplied pattern, asks the Gallery which versions exist, and rewrites the pin to the newest one inside the allowed range. The pattern must match exactly once and an unreachable Gallery is an error, so a broken lookup can never be mistaken for 'already up to date'. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…et otherwise The Gallery is served from an in-process HttpListener on a loopback port, so both outcomes are demonstrated without waiting for Pester to release and without network access. Also fixes a bug the suite found: a feed reporting exactly one version unrolled to a bare [version], which has no Count under Set-StrictMode, so a single-version module would have crashed the check. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Runs on a schedule, on demand, and on every push to main. The push trigger is there because GitHub silently disables a scheduled workflow after 60 days of inactivity in a public repository: it does not cover the quiet window, but it guarantees the first push after one re-checks the pin. The pull request is labelled and left for a human, because identity-plus-exact pins are the one track the Dependencies standard says is never auto-merged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Records that the gap is Dependabot having no PowerShell Gallery ecosystem rather than a choice made here, so if the platform ever ships one the right response is to delete this and add a package-ecosystem entry. Names the risk that a scheduled workflow is disabled silently after 60 days of inactivity in a public repository, and what distinguishes that from a run that found nothing to do. Also settles the analyzer findings on the new files and stops the new tests depending on member enumeration, which broke them under the full suite. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…t check Reverted in the next commit. 5.7.1 is outside the range the suites' #Requires lines declare, which is what a bad bump would look like. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reverts the temporary 5.7.1 pin now that run 31266574992 has shown a breaking bump fails the Test check. The updater's checkout no longer persists the token into .git/config, which zizmor's artipacked audit flagged. The one push that needs credentials supplies them itself, so no later step in the job can read them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Marius Storhaug (MariusStorhaug)
marked this pull request as ready for review
August 8, 2026 16:26
7 tasks
The existing-pull-request guard looked only at open ones, so a version a reviewer had closed to decline would be proposed again on the next run, every week, once the branch was gone. Checking every state means closing is how you say no, and the bot listens. The guard stays per version because the branch name carries it: declining 6.1.0 says nothing about 6.1.1. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Pinned PowerShell Gallery module versions now move on their own. The Pester version this repository's test suites run against is pinned exactly and verified by module GUID, which is the right posture for a CI pipeline — but only while something keeps that pin current. Dependabot has no PowerShell Gallery ecosystem, so nothing ever did, and the pin could only drift further behind the fixes Pester ships.
New: pinned Gallery versions are raised by an automated pull request
A workflow checks the Gallery for a newer release inside the range the test suites declare, and opens a labelled pull request when it finds one. Nothing changes about how tightly the pin is set — exact plus GUID stays exactly as it was, and only its movement is new. The update is reviewed and gated like any other change: a bump that breaks the suite turns the
Testcheck red before it can merge.The check runs weekly, on demand, and on every push to
main. The last of those is deliberate: GitHub silently disables a scheduled workflow after 60 days of inactivity in a public repository, and a workflow that has stopped running looks exactly like one that ran and found nothing to do.New: the gap is written down for every other repository
The Dependency Updates capability now records that the PowerShell Gallery is an ecosystem the platform updater does not cover, the pattern that fills the gap, how to notice if the schedule lapses, and the steps another repository follows to adopt it. It says plainly that the gap is Dependabot's, not a preference of this organization — so if the platform ever ships that ecosystem, the right response is to delete the bespoke updater and add a
package-ecosystementry.Technical details
Decision. Of the three candidates in #136, the first was chosen — a scheduled workflow here, with the logic in a parameterised script so promoting it later is a move rather than a rewrite. The decision and the evidence are recorded in the issue's Technical decisions section.
dependabot/dependabot-corehas no PowerShell ecosystem directory, and Renovate'slib/modules/datasourcehas no PowerShell Gallery datasource. Renovate could be coerced via acustomManagersregex over thenugetdatasource, but that is bespoke automation plus a second updater and an org-level app install.RequiredVersionreturns exactly one pin — this repository's.PSModule/Invoke-Pesteruses NuGet ranges, not exact pins, so it is not a waiting consumer. GitHub Actions → "Start local; promote when it is reused" is explicit about not paying for a shared release surface before there is a second consumer.Files.
.github/scripts/Update-GalleryModulePin.ps1— parameterised by module name, target file, pin pattern (a regex with aversioncapture group), allowed range, and-GalleryUri. Only the captured group is rewritten; byte-order mark and line endings are preserved, and theGUIDis never touched. A pattern matching nothing, a pattern matching several places, and an unreachable Gallery are all hard failures, so a broken lookup can never read as "already up to date"..github/workflows/Update-ModulePin.yml—permissions: {}floor,contents: write+pull-requests: writeon the job, idempotent against an already-open pull request or an existing branch, and no auto-merge because identity-plus-exact is the one track Dependencies says is never auto-merged.tests/Update-GalleryModulePin.Tests.ps1— 10 cases against an in-processHttpListeneron a loopback port.src/docs/Capabilities/dependency-updates/design.md— extended rather than adding a page, so nosrc/zensical.tomlnav entry was needed and the generated indexes stay valid.The pin stays in
Invoke-PesterSuite.ps1. A single-key data file would be a dependency manifest in all but name, which #136's non-goals forbid, and a parameter default is no harder to rewrite.-PinPatternis what makes the script indifferent to where a pin lives.Verification.
dependencies+powershell+update:patch+Maintenance, GUID untouched. Closed in the same session, branches deleted.updated=false, working tree clean, open pull-request count unchanged at 12TestTestfailed, every suite's#Requiresrejected it. Reverted in c6ea08e.tests/Update-GalleryModulePin.Tests.ps1.github/scripts/Invoke-PesterSuite.ps1Invoke-ScriptAnalyzerwith.github/linters/.powershell-psscriptanalyzer.psd1zizmorUpdate-DocumentationIndex.ps1 -Check,Test-DocumentationLink.ps1, markdownlintTwo bugs were found by this work and fixed in it: a Gallery reporting exactly one version unrolled to a bare
[version]and crashed underSet-StrictMode; and the new tests relied on member enumeration over the script's mixed output, which passed in isolation and failed under the full suite.zizmor'sartipackedaudit also flagged the updater's checkout persisting credentials — rather than suppress it, the checkout now setspersist-credentials: falseand the single push that needs a token supplies it itself.Labels.
dependencies,powershell,update:major,update:minorandupdate:patchdid not exist in this repository and were created once withgh label create; the workflow applies them but does not create them.Branch name deviation.
maintenance-136-gallery-pin-updatesrather thanmaintenance/136-…. The app'srename_branchtool strips/and fires once per session, so the<type>/<issue>-<slug>form in Branching and Merging is unreachable from an app session. Nothing in CI keys off the branch name.Standards and framework alignment
.github/scripts/**(PowerShell).github/workflows/**tests/**src/docs/**Implementation plan progress. All seven items of #136's plan are complete and ticked.
Issue convergence sweep. Scope: open issues touching
.github/dependency automation and the Dependency Updates capability. #136 is the only one this diff satisfies; no additional closing keywords are used.Related issues