Skip to content

fix(catalogs): name a scheme-less catalog URL instead of reporting "got ://" - #5251

Merged
mnriem merged 2 commits into
github:mainfrom
yxshee:fix/catalog-url-no-scheme-message
Nov 5, 2026
Merged

mnriem merged 2 commits into
github:mainfrom
yxshee:fix/catalog-url-no-scheme-message

Conversation

@yxshee

@yxshee yxshee commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adding a catalog URL without a scheme reports a confusing scheme in the error. The value isn't a valid catalog URL, but the message doesn't say what was wrong with it:

$ specify integration catalog add example.com/catalog.json
Error: Catalog URL must use HTTPS (got ://). HTTP is only allowed for localhost.

The same text comes from extension catalog add, preset catalog add, workflow catalog add and workflow step catalog add. All four _validate_catalog_url copies (the shared CatalogStackBase used by extensions and integrations, presets, workflows and steps) format the error with parsed.scheme, which is empty here.

This change keeps the message and, when there is no scheme, says so:

Error: Catalog URL must use HTTPS (got a URL with no scheme). HTTP is only allowed for localhost.

The value itself is deliberately not echoed. The integration, workflow and step commands render these errors as Rich markup, so input such as [/red]x would otherwise raise MarkupError (caught in review).

URLs that do have a scheme are reported exactly as before (got http://, got ftp://). Bundle catalogs are not changed: they accept local paths, so a scheme-less value never reaches their HTTPS check.

Testing

  • Tested locally with uv run specify --help

  • Ran existing tests with uv sync && uv run pytest

  • Tested with a sample project (if applicable)

  • New tests for the integration (shared base), preset, workflow and step catalog validators assert the scheme-less wording; all 3 test functions fail on main (got ://) and pass here.

  • Full suite: 13,916 passed, 442 skipped. uvx ruff@0.15.0 check src tests: all checks passed.

  • Ran the five catalog add commands above in a project from specify init --integration claude; each now prints the scheme-less wording, and [/red]x / [/x] print the same message instead of a MarkupError.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: Claude Code (model: Claude Opus 5.5, autonomous agent mode) opened this PR on behalf of @yxshee. It found the message while probing every specify command with invalid input, wrote the fix and tests, ran the new tests against main and the branch, ran the full suite and ruff, and checked the real CLI output. No human reviewed the change line by line before it was opened.

…ot ://"

Extension, integration, preset, workflow and step catalog URL validation built the HTTPS error from parsed.scheme, so a value without a scheme such as example.com/catalog.json was reported as "(got ://)". Show the value itself when there is no scheme.
@yxshee
yxshee requested a review from mnriem as a code owner November 5, 2026 11:29
Copilot AI auto review requested due to automatic review settings November 5, 2026 11:29

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.

🟢 Approval recommended

The recorded review state reports no active issues for the catalog URL error-message update.

No open issues 🎉

What changed in this PR

This pull request improves catalog URL validation errors by displaying the original value for scheme-less URLs instead of the misleading got ://, while preserving existing behavior for URLs with schemes.

Changes:

  • Updated shared, preset, workflow, and workflow-step validators to use the scheme-less URL value in errors.
  • Added regression tests for integration, preset, workflow, and workflow-step catalog validation.
  • Left bundle catalog path handling unchanged.
  • Rich-rendered error output must be escaped at the integration, workflow, and workflow-step command boundaries to prevent user-controlled markup from altering or breaking error output.

This pull request requires changes.

File Summary
tests/​test_workflows.py Adds regression coverage for workflow and workflow-step catalog validation messages.
tests/​specify_cli/​presets/​test_catalog.py Adds regression coverage for scheme-less preset catalog URLs.
tests/​specify_cli/​integrations/​test_catalog.py Adds regression coverage for the shared integration catalog validator.
src/​specify_cli/​workflows/​step/​catalog/​_domain.py Updates workflow-step catalog URL error formatting; the resulting error must be rendered as literal text.
src/​specify_cli/​workflows/​catalog/​_domain.py Updates workflow catalog URL error formatting; the resulting error must be rendered as literal text.
src/​specify_cli/​presets/​_catalog.py Updates preset catalog URL error formatting.
src/​specify_cli/​catalogs.py Updates shared extension/integration catalog URL error formatting; the resulting error must be rendered as literal text.

Review effort: Lite (auto)

…h output

Review: integration, workflow and step catalog commands print validation errors as Rich markup, so echoing the user value let input such as "[/red]x" raise MarkupError. Say "a URL with no scheme" instead.
Copilot AI auto review requested due to automatic review settings November 5, 2026 12:26
@yxshee

yxshee commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot note in 1fe145d. It was a real problem: echoing the value meant specify integration catalog add "[/red]x" (and the workflow and step equivalents) raised MarkupError instead of printing the error. The message now says "got a URL with no scheme" and doesn't include the value, so nothing user-controlled reaches Rich. Those inputs now print the normal error. Tests updated, ruff clean.

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.

🟢 Approval recommended

No active review issues block the catalog URL error-message clarification.

No open issues 🎉

Review effort: Balanced (auto)

@mnriem mnriem added the triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate label Nov 5, 2026
@mnriem
mnriem requested an auto review from Copilot November 5, 2026 14:56

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.

🟢 Approval recommended

No active review issues remain, with the updated validation messages covered by regression tests across the affected catalog areas.

No open issues 🎉

Review effort: Lite (auto)

@mnriem
mnriem merged commit 3e7b36d into github:main Nov 5, 2026
22 checks passed
@mnriem

mnriem commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants