Skip to content

⚙️ [Maintenance]: Pinned PowerShell Gallery module updates are proposed automatically - #156

Closed
Marius Storhaug (MariusStorhaug) wants to merge 8 commits into
mainfrom
maintenance-136-gallery-pin-updates
Closed

⚙️ [Maintenance]: Pinned PowerShell Gallery module updates are proposed automatically#156
Marius Storhaug (MariusStorhaug) wants to merge 8 commits into
mainfrom
maintenance-136-gallery-pin-updates

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Aug 8, 2026

Copy link
Copy Markdown
Member

MSX maintainers can now receive a reviewable pull request when this repository's pinned Pester version has a newer compatible PowerShell Gallery release. The exact version-and-GUID pin remains unchanged in posture; only its maintenance becomes automated.

New: Automated Pester pin proposals

A weekly, manually runnable, and main-push-triggered workflow checks the PowerShell Gallery and opens a labelled pull request for the newest compatible stable Pester release. The proposed update must pass the repository's existing test gate before it can merge, and the workflow never auto-merges it.

The update check fails explicitly when it cannot identify the pin or reach the Gallery, so an unavailable check cannot be mistaken for an up-to-date dependency. Closed update pull requests are treated as a decision not to propose that exact version again.

Changed: PowerShell Gallery coverage is documented

The Dependency Updates design now identifies PowerShell Gallery as unsupported by Dependabot and records the local workflow pattern, including the 60-day scheduled-workflow lapse and the evidence used to distinguish a lapsed schedule from a successful no-op run.


Technical details
  • Adds Update-GalleryModulePin.ps1, a parameterised updater that preserves the target file's encoding, line endings, and Pester module GUID while changing only the version capture.
  • Adds Update-ModulePin.yml and Pester coverage for version selection, ceilings, prereleases, feed paging, idempotency, workflow outputs, and hard failures.
  • The workflow uses least-privilege job permissions and retains no checkout credential after checkout.
  • Standards and framework alignment: the implementation follows the local-action-first guidance, but it is not aligned with Dependency Updates FR3/NFR3: it creates a repository-local updater rather than consuming a centrally managed exception and shared mechanism. This PR is therefore a validated local prototype, not the completed organization-wide design. Before merge, either establish the central exception and shared mechanism or revise the capability requirements through its owning issue.
Changed surface Standards checked Framework docs checked Result
.github/scripts/** (PowerShell) PowerShell scripts, functions, naming, documentation Dependency Updates Exception — local updater conflicts with FR3/NFR3
.github/workflows/** GitHub Actions least privilege and credential handling Dependency Updates Exception — local updater conflicts with FR3/NFR3
tests/** Testing, PowerShell testing None (no framework-specific docs) Aligned
src/docs/** Markdown, Documentation Model Dependency Updates Exception — records a local pattern that conflicts with FR3/NFR3
Relevant issues (or links)

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>
@MariusStorhaug Marius Storhaug (MariusStorhaug) added the Maintenance Internal maintenance change label Aug 8, 2026
…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>
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>
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title ⚙️ [Maintenance]: Pinned PowerShell Gallery module versions kept current automatically ⚙️ [Maintenance]: Pinned PowerShell Gallery module updates are proposed automatically Aug 9, 2026
@MariusStorhaug
Marius Storhaug (MariusStorhaug) deleted the maintenance-136-gallery-pin-updates branch August 9, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Internal maintenance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep pinned PowerShell Gallery module versions current without Dependabot

1 participant