Skip to content

fix: core and community extension catalogs should be searchable without override envvar#1769

Open
dhilipkumars wants to merge 4 commits intogithub:mainfrom
dhilipkumars:improve_ext_search
Open

fix: core and community extension catalogs should be searchable without override envvar#1769
dhilipkumars wants to merge 4 commits intogithub:mainfrom
dhilipkumars:improve_ext_search

Conversation

@dhilipkumars
Copy link
Contributor

@dhilipkumars dhilipkumars commented Mar 6, 2026

Description

uses DEFAULT_CATALOG_URLS to contain both core catalog and community one , so even for a simple search in the community catalog (which has a lot of extenions now) a user does not need to use the over-ride env var.

specify extension search
🔍 Searching extension catalog...

Found 7 extension(s):

Azure DevOps Integration (v1.0.0)
  Sync user stories and tasks to Azure DevOps work items using OAuth authentication.

  Author: pragya247
  Tags: azure, devops, project-management, work-items, issue-tracking
  Downloads: 0 | Stars: 0
  Repository: https://github.com/pragya247/spec-kit-azure-devops

  Install: specify extension add azure-devops

Cleanup Extension (v1.0.0)
  Post-implementation quality gate that reviews changes, fixes small issues (scout rule), creates tasks for medium issues, and generates analysis for large issues.

  Author: dsrednicki
  Tags: quality, tech-debt, review, cleanup, scout-rule
  Downloads: 0 | Stars: 0
  Repository: https://github.com/dsrednicki/spec-kit-cleanup

  Install: specify extension add cleanup
  .
  .
  .

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)
    Anti-gravity

Fixes : #1768

@dhilipkumars dhilipkumars requested a review from mnriem as a code owner March 6, 2026 04:19
Copilot AI review requested due to automatic review settings March 6, 2026 04:19
Copy link
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

Updates the extension catalog lookup so specify extension search (and related catalog-backed flows) query both the core and community catalogs by default, removing the need for a catalog URL override in common cases (Fixes #1768).

Changes:

  • Replaces the single default catalog URL with DEFAULT_CATALOG_URLS including both core + community endpoints.
  • Updates catalog fetching to download multiple catalogs and merge them into one in-memory (and cached) catalog.
  • Updates cache metadata to track the active catalog URL set (catalog_urls) and invalidates cache when URL configuration changes.
Comments suppressed due to low confidence (1)

src/specify_cli/extensions.py:1011

  • The docstring says SPECKIT_CATALOG_URL can be “comma-separated for multiple”, but the implementation treats the env var as a single URL (urlparse(env_value.strip())) and would break on comma-separated values. Either implement splitting/validation for multiple URLs (and return all of them) or update the docstring to reflect that only a single URL is supported.
        1. SPECKIT_CATALOG_URL environment variable (comma-separated for multiple)
        2. Default catalog URLs

        Returns:
            List of URLs to fetch catalogs from

        Raises:
            ValidationError: If custom URL is invalid (non-HTTPS)
        """
        import os
        import sys
        from urllib.parse import urlparse

        # Environment variable override (useful for testing)
        if env_value := os.environ.get("SPECKIT_CATALOG_URL"):
            catalog_url = env_value.strip()
            parsed = urlparse(catalog_url)


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

@dhilipkumars dhilipkumars changed the title feat: core and community extension catalogs merged seamlessly during … feat: core and community extension catalogs should be searchable without override envvar Mar 6, 2026
@dhilipkumars dhilipkumars changed the title feat: core and community extension catalogs should be searchable without override envvar fix: core and community extension catalogs should be searchable without override envvar Mar 6, 2026
Copilot AI review requested due to automatic review settings March 6, 2026 12:31
Copy link
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

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


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

Copy link
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

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


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

Comment on lines +1145 to +1147
catalog = ExtensionCatalog(project_dir)
catalog.DEFAULT_CATALOG_URLS = ["http://catalog1.test", "http://catalog2.test"]

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

These new tests override catalog.DEFAULT_CATALOG_URLS, but get_catalog_urls() will ignore that override if SPECKIT_CATALOG_URL is set in the runner environment. Clear SPECKIT_CATALOG_URL at the start of the test (e.g., monkeypatch.delenv(..., raising=False)) to ensure the intended URLs are exercised.

Copilot uses AI. Check for mistakes.
@dhilipkumars
Copy link
Contributor Author

@mnriem PTAL.

i will rebase and get this ready once this is merged.

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] specify extension search should query both core and community catalogs by default

2 participants