G
YouTube TikTok Games
Skip to content

fix(presets): render missing preset IDs as literal text - #5314

Merged
mnriem merged 1 commit into
github:mainfrom
xunguangzlj-cloud:fix/escape-missing-preset-id
Nov 9, 2026
Merged

mnriem merged 1 commit into
github:mainfrom
xunguangzlj-cloud:fix/escape-missing-preset-id

Conversation

@xunguangzlj-cloud

Copy link
Copy Markdown

Description

If an unknown preset ID contains a Rich closing tag, specify preset info raises MarkupError while trying to report the missing preset. Use the command's existing escaped ID when rendering that error. Lookups still use the literal ID.

Testing

  • The new cached-catalog regression fails on main with MarkupError and passes after the fix.
  • 185 related preset tests passed on Windows with Python 3.12.10.
  • The installed specify entry point passed --help and a sample-project check. A known cached preset rendered successfully and [/bold]missing returned exit code 1 with its literal ID in the error.
  • The changed test file passed Ruff and the diff check passed. The command file's import-order diagnostic is also present on main.

AI Disclosure

  • I did use AI assistance.

AI disclosure: OpenAI Codex (GPT-6, autonomous, reasoning setting not exposed to the agent) reproduced the issue, wrote and verified the fix and regression, and drafted this PR on behalf of @xunguangzlj-cloud.

Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Copilot AI dynamic review requested due to automatic review settings November 8, 2026 08:04

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 review identifies no active issues, and regression coverage confirms markup-containing unknown preset IDs render literally while preserving the expected failure exit code.

No open issues 🎉

What changed in this PR

This pull request fixes specify preset info so unknown preset IDs containing Rich markup are rendered as literal text instead of raising MarkupError, while preserving the original ID for lookups.

Changes:

  • Uses the escaped preset ID when rendering missing-preset errors.
  • Adds regression coverage for IDs containing a Rich closing tag.
  • Verifies the command reports the literal ID and exits with code 1.
File Description
tests/​specify_cli/​presets/​test_command_info.py Verifies markup-containing missing IDs render literally and return exit code 1.
src/​specify_cli/​presets/​command_info.py Renders escaped preset IDs in missing-preset errors.

Review effort: Lite (auto)

@mnriem mnriem added the triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate label Nov 9, 2026
@mnriem
mnriem requested a dynamic review from Copilot November 9, 2026 13:51

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 implementation escapes unknown preset IDs only for Rich rendering while preserving the original lookup value, and regression coverage verifies literal output with the existing exit code.

No open issues 🎉

Review effort: Lite (auto)

@mnriem
mnriem merged commit 83bddf0 into github:main Nov 9, 2026
19 checks passed
@mnriem

mnriem commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

kevinnguyenhoang91 pushed a commit to kevinnguyenhoang91/spec-kit that referenced this pull request Nov 10, 2026
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
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