Skip to content

[airflow-ctl/v0-1-test] Escape server and user text in airflowctl command messages (#76265) - #76621

Merged
shahar1 merged 1 commit into
apache:airflow-ctl/v0-1-testfrom
shahar1:backport-abc3a20-airflow-ctl/v0-1-test
Nov 6, 2026
Merged

shahar1 merged 1 commit into
apache:airflow-ctl/v0-1-testfrom
shahar1:backport-abc3a20-airflow-ctl/v0-1-test

Conversation

@shahar1

@shahar1 shahar1 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Backport of #76265 to airflow-ctl/v0-1-test. The automatic backport failed on conflicts.

airflowctl printed server error text, Dag run ids and logical dates as Rich markup. A value containing a tag-like fragment such as [/x] raised MarkupError, so the user got a traceback instead of the error.

Conflict resolution:

  • This branch has no ctl/utils/dag_run.py. Its escapes go to the lookup helpers kept inline in dag_command.py and task_command.py, and its tests are rewritten against dags state and tasks states-for-dag-run.
  • dags clear and tasks failed-deps, state and logs do not exist here, so their escapes and tests are dropped.
  • "Error retrieving DAG" keeps this branch's wording.

Tests: all 743 airflowctl unit tests pass. Removing any escape fails a test, except the rejected value in the two logical-date not-found messages, which has already passed datetime.fromisoformat and cannot contain markup. This is the same exception as in #76265, and it appears twice because the helper exists twice here.

(cherry picked from commit abc3a20)


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5.5)

Generated-by: Claude Code (Opus 5.5) following the guidelines

🤖 Generated with Claude Code

https://claude.ai/code/session_01BVx6gA44HQY4GEf2fEAQwE

…mand messages (apache#76265)

Several airflowctl commands interpolated server error text, Dag run ids
and logical dates into Rich markup unescaped. A value containing a
tag-like fragment such as "[/x]" made rich.print raise MarkupError, so
the user saw a traceback instead of the actual error.

(cherry picked from commit abc3a20)

Conflict resolution: this branch has no ctl/utils/dag_run.py, so the escapes
from that module go to the lookup helpers it keeps inline in dag_command.py and
task_command.py, and its tests are rewritten against `dags state` and
`tasks states-for-dag-run`. `dags clear` and `tasks failed-deps`, `state` and
`logs` do not exist here, so their escapes and tests are dropped.
"Error retrieving DAG" keeps this branch's wording.

Generated-by: Claude Code (Opus 5.5)
Claude-Session: https://claude.ai/code/session_01BVx6gA44HQY4GEf2fEAQwE
@shahar1
shahar1 enabled auto-merge (squash) November 6, 2026 17:28
@shahar1
shahar1 merged commit cee1c58 into apache:airflow-ctl/v0-1-test Nov 6, 2026
14 checks passed
shahar1 added a commit to shahar1/airflow that referenced this pull request Nov 7, 2026
…mand messages (apache#76265) (apache#76621)

Several airflowctl commands interpolated server error text, Dag run ids
and logical dates into Rich markup unescaped. A value containing a
tag-like fragment such as "[/x]" made rich.print raise MarkupError, so
the user saw a traceback instead of the actual error.

(cherry picked from commit abc3a20)

Conflict resolution: this branch has no ctl/utils/dag_run.py, so the escapes
from that module go to the lookup helpers it keeps inline in dag_command.py and
task_command.py, and its tests are rewritten against `dags state` and
`tasks states-for-dag-run`. `dags clear` and `tasks failed-deps`, `state` and
`logs` do not exist here, so their escapes and tests are dropped.
"Error retrieving DAG" keeps this branch's wording.

Generated-by: Claude Code (Opus 5.5)
Claude-Session: https://claude.ai/code/session_01BVx6gA44HQY4GEf2fEAQwE

Co-authored-by: Rishabh <[email protected]>
@shahar1 shahar1 mentioned this pull request Nov 7, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants