Skip to content

[Bug]: Update information source mismatch #138

Description

@stiwicourage

Plan: Update information source mismatch

Problem statement

CI may install 2.0.0-beta while nova update reports 2.0.0-preview9920 as the newest release. This plan treats the issue as an update information source bug: installation and self-update lookup appear to query PowerShell Gallery differently, so Nova may be comparing against a candidate that is not the one actual installs resolve.

Evidence

  • scripts/build/ci/Install-CiPowerShellModules.ps1 installs CI dependencies with Install-Module -AllowPrerelease, then reports the installed version via Get-InstalledModule.
  • .github/workflows/Publish.yml and .github/workflows/Tests.yml both rely on that CI install script.
  • src/resources/update/ModuleUpdateLookup.ps1.txt looks up update candidates with separate Find-Module and Find-Module -AllowPrerelease calls.
  • src/private/update/InvokeNovaModuleUpdateLookup.ps1 uses that lookup script as the data source for self-update decisions.
  • src/private/cli/FormatNovaCliCommandResult.ps1 presents the result as newest version available, which can hide source inconsistency.
  • The installed nova launcher currently imports a local module instance that reports version 2.0.0-preview9920 from /Users/stiwi.courage/.local/share/powershell/Modules/NovaModuleTools/2.0.0.
  • The gallery currently reports Find-Module NovaModuleTools -AllowPrerelease as 2.0.0-beta.

Suspected root cause

Nova uses one information source and query shape for installation (Install-Module / Get-InstalledModule) and another for update discovery (Find-Module in a separate script). If PowerShell Gallery or PowerShellGet surfaces prereleases differently across those commands, nova update can advertise a candidate that CI does not actually install.

Files likely involved

  • scripts/build/ci/Install-CiPowerShellModules.ps1
  • src/resources/update/ModuleUpdateLookup.ps1.txt
  • src/private/update/InvokeNovaModuleUpdateLookup.ps1
  • src/private/update/GetNovaModuleSelfUpdatePlan.ps1
  • src/private/cli/FormatNovaCliCommandResult.ps1
  • tests/UpdateNotification.Tests.ps1
  • .github/workflows/Publish.yml

Implementation steps

  1. Compare the exact repository and query path used by CI install and self-update lookup.
  2. Reproduce the mismatch with mocked or captured results where install resolves 2.0.0-beta but lookup returns 2.0.0-preview9920.
  3. Introduce a single update-candidate resolver shared by CI-oriented install reporting and nova update.
  4. Prefer repository APIs and command combinations that mirror real install behavior.
  5. Expose source details in the update result so Nova can distinguish a lookup candidate from an actually installable latest version.
  6. Adjust CLI wording to avoid claiming a universal newest version when the result is source-dependent.

Validation steps

  • Add regression tests for divergent Install-Module vs Find-Module results.
  • Add tests that verify the resolver returns the same effective latest prerelease as the install path.
  • Add tests that no-update messaging stays accurate when lookup and install sources disagree.
  • Verify workflow scripts and update helpers reference the same repository assumptions.

Risks

  • PowerShellGet and PSGallery behavior may vary by environment and module provider state.
  • Aligning lookup with install behavior may require broader adapter changes.
  • If gallery metadata is inconsistent, Nova may still need defensive wording even after resolver changes.

Success criteria

  • CI install behavior and nova update point to the same effective latest prerelease for the same repository context.
  • Nova no longer reports preview9920 as the newest version when CI installs beta from the same source path.
  • Tests cover both source-alignment and message-accuracy regressions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions