Skip to content

fix(self-update): pin installer ref to latest version#2026

Open
fallintoplace wants to merge 1 commit into
microsoft:mainfrom
fallintoplace:fix/self-update-installer-ref
Open

fix(self-update): pin installer ref to latest version#2026
fallintoplace wants to merge 1 commit into
microsoft:mainfrom
fallintoplace:fix/self-update-installer-ref

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pin self-update installer download to the latest release ref (v<latest_version>) instead of always using main.
  • Keep APM_INSTALLER_BASE_URL behaviour unchanged (enterprise mirror path still uses the provided mirror base).
  • Always set VERSION=v<latest_version> in installer env when not explicitly provided.
  • Add regression tests asserting installer URL is pinned to the resolved latest_version.

Testing

  • Not run in this change (per request).

Copilot AI review requested due to automatic review settings July 4, 2026 22:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the apm self-update flow to download the installer script from the release tag ref (v<latest_version>) instead of a moving branch ref (previously main) when using a custom GITHUB_URL/APM_REPO, and adjusts installer subprocess defaults to pass VERSION=v<latest_version> unless explicitly provided.

Changes:

  • Add a script_ref override to _get_update_installer_url() and use it in self_update() to pin installer downloads to v<latest_version>.
  • Change _build_self_update_installer_env() to always default VERSION to v<latest_version> (not prerelease-only).
  • Add unit tests covering script ref overrides and pinned installer URL behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/apm_cli/commands/self_update.py Pins installer URL to the release tag ref and changes default installer env to always set VERSION when unset.
tests/unit/commands/test_self_update_air_gapped.py Adds regression tests for the new script-ref override and for tag-pinned installer downloads.

Comment on lines 156 to 160
channel = _get_effective_self_update_channel()
if _ENV_SELF_UPDATE_CHANNEL not in env:
env[_ENV_SELF_UPDATE_CHANNEL] = channel
if channel == "prerelease" and _ENV_VERSION not in env:
if _ENV_VERSION not in env:
env[_ENV_VERSION] = f"v{latest_version}"
Comment on lines 271 to 278
# Download install script to temp file
try:
import requests

try:
install_script_url = _get_update_installer_url()
installer_ref = f"v{latest_version}"
install_script_url = _get_update_installer_url(installer_ref)
except RuntimeError as e:
@fallintoplace fallintoplace force-pushed the fix/self-update-installer-ref branch 2 times, most recently from 1a52ed6 to a582830 Compare July 4, 2026 23:12
@fallintoplace fallintoplace changed the title Pin self-update installer to release ref fix(self-update): pin installer ref and harden dashboard path checks Jul 4, 2026
@fallintoplace fallintoplace changed the title fix(self-update): pin installer ref and harden dashboard path checks fix(self-update): pin installer ref to latest version Jul 4, 2026
@fallintoplace fallintoplace force-pushed the fix/self-update-installer-ref branch from a582830 to 50d2b5b Compare July 4, 2026 23:16
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.

2 participants