Skip to content

fix: escape Rich markup in workflow error output - #3837

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/workflow-escape-markup
Open

fix: escape Rich markup in workflow error output#3837
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/workflow-escape-markup

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

Escape exception text with _escape_markup() to prevent Rich from interpreting square brackets as markup tags.

Changes

  • _commands.py: Added _escape_markup(str(exc)) in ValueError and Exception handlers

Escape user-controlled exception text with _escape_markup() to prevent
Rich from interpreting square brackets as markup tags, which could
corrupt output or raise MarkupError. Matches the pattern used in
workflow_resume and all other err.print() calls in this file.

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.

🟡 Not ready to approve

The earlier workflow-loading error handler remains vulnerable to Rich markup interpretation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Escapes Rich markup in workflow execution error messages.

Changes:

  • Escapes ValueError and generic execution exception text.
File summaries
File Description
src/specify_cli/workflows/_commands.py Escapes runtime error output.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

)
except ValueError as exc:
err.print(f"[red]Error:[/red] {exc}")
err.print(f"[red]Error:[/red] {_escape_markup(str(exc))}")
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.

3 participants