Skip to content

fix: bundled extensions should not have download URLs#2155

Merged
mnriem merged 3 commits intogithub:mainfrom
mnriem:fix/2151-bundled-extensions-no-download-url
Apr 10, 2026
Merged

fix: bundled extensions should not have download URLs#2155
mnriem merged 3 commits intogithub:mainfrom
mnriem:fix/2151-bundled-extensions-no-download-url

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 10, 2026

Fixes #2151

Problem

Extensions from the default catalog (catalog.json) could not be installed because download_url pointed to GitHub release artifacts that don't exist. The git and selftest extensions are bundled with spec-kit and should never be downloaded from a URL.

When the bundled extension lookup failed (e.g., incomplete install), the code fell through to the catalog download path and hit a 404.

Changes

  • extensions/catalog.json — Removed selftest (not a published extension). Replaced download_url with "bundled": true on the git entry.
  • src/specify_cli/__init__.py — The extension add flow now checks for "bundled": true before attempting download. When a bundled extension can't be found locally, it shows a clear error with reinstall instructions.
  • src/specify_cli/extensions.pydownload_extension() checks for "bundled": true and raises a specific error instead of the generic "has no download URL".
  • tests/test_extensions.py — Added 3 regression tests:
    • CLI gives actionable error when bundled extension is missing locally
    • download_extension() rejects bundled extensions with a clear message
    • Non-bundled extensions without a URL still get the original error

Testing

All 1232 tests pass.

- Remove selftest from default catalog (not a published extension)
- Replace download_url with 'bundled: true' flag for git extension
- Add bundled check in extension add flow with clear error message
  when bundled extension is missing from installed package
- Add bundled check in download_extension() with specific error
- Direct users to reinstall via uv with full GitHub URL
- Add 3 regression tests for bundled extension handling
Copilot AI review requested due to automatic review settings April 10, 2026 13:28
Copy link
Copy Markdown
Contributor

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

Fixes installation failures for bundled core extensions by removing invalid download URLs from the default catalog and making the CLI/catalog logic explicitly treat bundled extensions as local-only.

Changes:

  • Update default extension catalog to mark git as bundled and remove selftest from the catalog.
  • Update extension add to detect bundled catalog entries and emit a reinstall-focused error when the bundled files aren’t present locally.
  • Update ExtensionCatalog.download_extension() to emit a clearer bundled-specific error (and add regression tests around bundled/no-URL cases).
Show a summary per file
File Description
extensions/catalog.json Marks git as bundled (no URL) and removes selftest entry from default catalog.
src/specify_cli/__init__.py Adds bundled-aware behavior in extension add with actionable error output when local bundled assets are missing.
src/specify_cli/extensions.py Adds a bundled-specific error path in download_extension() when download_url is absent.
tests/test_extensions.py Adds regression tests for bundled-missing CLI error and download_extension() error messaging.

Copilot's findings

Tip

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 2

mnriem added 2 commits April 10, 2026 09:04
…tall constant

- Move bundled check before download_url inspection in download_extension()
  so bundled extensions can never be downloaded even with a URL present
- Extract REINSTALL_COMMAND constant to avoid duplicated install strings
Bundled extensions should only be blocked from download when they have
no download_url. If a newer version is published to the catalog with a
URL, users should be able to install it to get bug fixes.

Add test for bundled-with-URL download path.
Copilot AI review requested due to automatic review settings April 10, 2026 14:06
Copy link
Copy Markdown
Contributor

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 fixes installation failures for bundled extensions in the default extension catalog by preventing the CLI/catalog download path from being used when an extension is intended to be shipped inside the Spec Kit package.

Changes:

  • Marked the git catalog entry as bundled (and removed the unpublished selftest entry) to avoid invalid release-artifact download URLs.
  • Updated specify extension add to detect bundled extensions from catalog metadata and emit an actionable reinstall error if the bundled payload is missing locally.
  • Updated ExtensionCatalog.download_extension() to explicitly reject bundled-without-URL entries with a specific error, and added regression tests for these behaviors.
Show a summary per file
File Description
extensions/catalog.json Removes selftest and marks git as "bundled": true to prevent broken download attempts.
src/specify_cli/__init__.py Adds bundled-aware handling in extension add with a clearer error when the bundled payload can’t be found locally.
src/specify_cli/extensions.py Adds a bundled-specific guard in download_extension() and centralizes reinstall guidance via REINSTALL_COMMAND.
tests/test_extensions.py Adds regression tests covering bundled-missing behavior and error messaging in both CLI and catalog download code paths.

Copilot's findings

Tip

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new

@mnriem mnriem merged commit d1b95c2 into github:main Apr 10, 2026
12 checks passed
@mnriem mnriem deleted the fix/2151-bundled-extensions-no-download-url branch April 10, 2026 16:29
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.

[Bug]: Extensions from default catalog can not be installed

2 participants