Skip to content

fix: restore alias compatibility for community extensions (#2110)#2125

Merged
mnriem merged 1 commit intogithub:mainfrom
mnriem:fix/restore-alias-compat-2110
Apr 8, 2026
Merged

fix: restore alias compatibility for community extensions (#2110)#2125
mnriem merged 1 commit intogithub:mainfrom
mnriem:fix/restore-alias-compat-2110

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 8, 2026

Summary

Fixes #2110 — Community extensions that use 2-part aliases (e.g., speckit.verify) fail to install with:

Validation Error: Invalid alias 'speckit.verify': must follow pattern 'speckit.{extension}.{command}'

Root cause

Commit #1994 ("fix: prevent extension command shadowing") added strict 3-part pattern enforcement to aliases in _collect_manifest_command_names(). Before #1994, aliases had no pattern validation — only primary command names were checked. This broke all community extensions using short aliases.

Changes

src/specify_cli/extensions.py

  • In _collect_manifest_command_names(), the 3-part speckit.{ext}.{cmd} pattern, namespace check, and core command shadowing check are now only applied to primary command names (kind == "command")
  • Aliases retain type checking and duplicate detection but are otherwise free-form, restoring pre-fix: prevent extension command shadowing #1994 behavior

tests/test_extensions.py

  • test_install_rejects_alias_without_extension_namespacetest_install_accepts_short_alias — now verifies that 2-part aliases are accepted instead of rejected

Test plan

  • All 1195 tests pass
  • Community extensions like spec-kit-verify (which uses aliases: ["speckit.verify"]) can install again

Relax alias validation in _collect_manifest_command_names() to only
enforce the 3-part speckit.{ext}.{cmd} pattern on primary command
names. Aliases retain type and duplicate checking but are otherwise
free-form, restoring pre-github#1994 behavior.

This unblocks community extensions (e.g. spec-kit-verify) that use
2-part aliases like 'speckit.verify'.

Fixes github#2110
Copilot AI review requested due to automatic review settings April 8, 2026 16:57
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

Restores backward compatibility for community extensions that declare legacy 2-part aliases (e.g., speckit.verify) by relaxing alias validation during extension installation.

Changes:

  • Update extension manifest validation so only primary command names must match speckit.{extension}.{command} and the extension namespace.
  • Allow aliases to bypass the strict 3-part pattern validation (while still checking type and duplicates).
  • Adjust the extension install test to assert that short aliases are accepted.
Show a summary per file
File Description
src/specify_cli/extensions.py Limits canonical pattern/namespace validation to primary command names; relaxes alias validation.
tests/test_extensions.py Renames/updates a test to expect successful install with a 2-part alias.

Copilot's findings

Tip

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

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

@mnriem mnriem merged commit 4deb90f into github:main Apr 8, 2026
12 checks passed
@mnriem mnriem deleted the fix/restore-alias-compat-2110 branch April 8, 2026 17:03
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]: Not able to add the extensions

2 participants