Repository navigation
Escape Rich markup in airflowctl variable and pool commands - #76419
Merged
shahar1 merged 1 commit intoNov 4, 2026
Merged
Conversation
User-supplied inputs such as file paths, imported variable keys, and server error responses containing square brackets or Rich markup tags can cause unhandled rich.errors.MarkupError crashes when printed via rich.print or Console().print. Escaping these strings ensures special characters are treated as literal text rather than formatting tags.
Kaap10
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
November 4, 2026 07:23
shahar1
approved these changes
Nov 4, 2026
Contributor
Backport successfully created: airflow-ctl/v0-1-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
shahar1
pushed a commit
that referenced
this pull request
Nov 4, 2026
… pool commands (#76419) (#76476) User-supplied inputs such as file paths, imported variable keys, and server error responses containing square brackets or Rich markup tags can cause unhandled rich.errors.MarkupError crashes when printed via rich.print or Console().print. Escaping these strings ensures special characters are treated as literal text rather than formatting tags. (cherry picked from commit 6920d2c) Co-authored-by: Vardhman Gupta <[email protected]>
shahar1
pushed a commit
to shahar1/airflow
that referenced
this pull request
Nov 4, 2026
… pool commands (apache#76419) (apache#76476) User-supplied inputs such as file paths, imported variable keys, and server error responses containing square brackets or Rich markup tags can cause unhandled rich.errors.MarkupError crashes when printed via rich.print or Console().print. Escaping these strings ensures special characters are treated as literal text rather than formatting tags. (cherry picked from commit 6920d2c) Co-authored-by: Vardhman Gupta <[email protected]>
Rishabh00b
added a commit
to Rishabh00b/airflow
that referenced
this pull request
Nov 5, 2026
Take the upstream versions of variable_command.py and its tests: apache#76419 already escapes the variables import output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
User-controlled strings (file paths, imported variable keys, and API error responses) printed with
rich.print()orConsole().print()can triggerrich.errors.MarkupErrorwhen they contain square brackets (e.g.[/x]or directory names like[backup]).This change escapes:
file_pathinvariable_command._print_file_error(and closes unclosed[red]).result.create.errorsandresult.create.successinvariable_command.import_.args.fileinpool_command.export.Complements #76265 by covering the remaining unescaped commands in
airflowctl.Tests
test_print_file_error_containing_markuptotest_variable_command.py.test_import_success_prints_variable_keys_containing_markuptotest_variable_command.py.test_import_error_containing_markuptotest_variable_command.py.test_export_json_file_path_containing_markuptotest_pool_command.py.Was generative AI tooling used to co-author this PR?
Generated-by: Antigravity following the guidelines
Drafted-by: Antigravity; reviewed by @Kaap10 before posting