Skip to content

fix(presets): escape catalog metadata in discovery output - #3773

Open
marcelsafin wants to merge 1 commit into
github:mainfrom
marcelsafin:fix/preset-rich-output
Open

fix(presets): escape catalog metadata in discovery output#3773
marcelsafin wants to merge 1 commit into
github:mainfrom
marcelsafin:fix/preset-rich-output

Conversation

@marcelsafin

Copy link
Copy Markdown
Contributor

Description

Preset catalog values such as names, IDs, versions, descriptions, authors,
repository URLs, and licenses were interpolated directly into Rich output by
preset search and the catalog branch of preset info. Bracketed content was
therefore interpreted as markup instead of rendered literally.

This escapes those remaining catalog-derived fields with the module's existing
_escape_markup helper. Tag shape validation and tag rendering are intentionally
left to #3769, which already covers that separate crash path and overlapping tag
escape.

Regression tests assign distinct Rich tags to every field in scope and verify
literal rendering in both commands.

Testing

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

Full suite: 5423 passed, 172 skipped.

AI Disclosure

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

GitHub Copilot (GPT-5.6 Sol) autonomously identified, implemented, tested, and
self-reviewed this change on behalf of @marcelsafin.

Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@marcelsafin
marcelsafin requested a review from mnriem as a code owner July 28, 2026 07:53
Copilot AI review requested due to automatic review settings July 28, 2026 07:53

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.

Pull request overview

Escapes preset catalog metadata so Rich renders bracketed values literally in discovery output.

Changes:

  • Escapes catalog fields in preset search and catalog-backed preset info.
  • Adds CLI regression tests covering each affected field.

Reviewed changes

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

File Description
src/specify_cli/presets/_commands.py Escapes catalog-derived Rich output.
tests/test_presets.py Verifies literal rendering of markup-like metadata.

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

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.

2 participants