Skip to content

Conversation

Copy link

Copilot AI commented Jan 12, 2026

PR #21 upgrades asdf-vm/actions from v3 to v4, which exposed two issues in the plugin:

  1. Ubuntu tests fail with "There is no such version: latest"
  2. macOS tests fail when zigtools.org API returns HTTP 500

Changes

  • lib/utils.py: Resolve 'latest' to actual version number before lookup

    if version == 'latest':
        versions = list(k for k in index.keys() if k != 'master')
        versions.sort(key=lambda v: tuple(map(int, v.split('.'))))
        version = versions[-1]
  • lib/utils.py: Wrap optional zls download in try-except to prevent installation failures

  • .gitignore: Exclude Python cache files

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ziglang.org
    • Triggering command: /usr/bin/python3 python3 lib/utils.py latest-version (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Pull request: #21


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update Zig version installation instructions in README Fix 'latest' version resolution and zls error handling for asdf-vm/actions v4 Jan 12, 2026
Copilot AI requested a review from jiacai2050 January 12, 2026 22:35
@jiacai2050 jiacai2050 marked this pull request as ready for review January 13, 2026 00:03
Copilot AI review requested due to automatic review settings January 13, 2026 00:03
@jiacai2050 jiacai2050 requested a review from a team as a code owner January 13, 2026 00:03
@jiacai2050 jiacai2050 merged commit b6f3493 into dependabot/github_actions/asdf-vm/actions-4 Jan 13, 2026
6 checks passed
@jiacai2050 jiacai2050 deleted the copilot/update-zig-version-instructions branch January 13, 2026 00:03
Copy link

Copilot AI left a comment

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 addresses two issues exposed by the asdf-vm/actions v4 upgrade: handling of the 'latest' version string and preventing installation failures when the zls download service is unavailable.

Changes:

  • Added logic to resolve 'latest' version string to an actual version number before lookup
  • Added error handling to make zls download optional, preventing installation failures
  • Added Python cache files to .gitignore

Reviewed changes

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

File Description
lib/utils.py Added 'latest' version resolution logic and wrapped zls download in try-except for graceful failure handling
.gitignore Added Python bytecode cache exclusions (*.pyc and pycache/)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Resolve 'latest' to the actual latest version
if version == 'latest':
versions = list(k for k in index.keys() if k != 'master')
versions.sort(key=lambda v: tuple(map(int, v.split('.'))))
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The version sorting logic will fail if any version string contains non-numeric components (e.g., "0.11.0-dev.1234+abc"). The map(int, v.split('.')) will raise a ValueError when trying to convert non-numeric strings to integers. This logic is duplicated from the all_versions() function at line 83, which has the same issue. Consider using a more robust version parsing approach or catching and handling malformed version strings appropriately.

Copilot uses AI. Check for mistakes.
Comment on lines +145 to +148
if version == 'latest':
versions = list(k for k in index.keys() if k != 'master')
versions.sort(key=lambda v: tuple(map(int, v.split('.'))))
version = versions[-1]
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

This version resolution logic duplicates the functionality already present in the all_versions() function (lines 80-84). Consider refactoring to call all_versions() directly and return the last element, which would reduce code duplication and ensure consistency.

Copilot uses AI. Check for mistakes.
download_tarball(zls_outfile, tarball_info, use_mirror=False)
tarball_info = zls_links[link_key]
download_tarball(zls_outfile, tarball_info, use_mirror=False)
except Exception as e:
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The broad exception handler catches all exceptions, including programming errors like AttributeError, NameError, or KeyboardInterrupt. Consider catching more specific exceptions (e.g., HTTPAccessError, HTTPError, URLError) to avoid silently suppressing unexpected errors that should be addressed.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants