Skip to content

Fix rich MarkupError in workflow-config on dependabot PR bodies#69398

Closed
dwoz wants to merge 1 commit into
saltstack:3008.xfrom
dwoz:dwoz/fix/dependabot-69394-tools-ci
Closed

Fix rich MarkupError in workflow-config on dependabot PR bodies#69398
dwoz wants to merge 1 commit into
saltstack:3008.xfrom
dwoz:dwoz/fix/dependabot-69394-tools-ci

Conversation

@dwoz

@dwoz dwoz commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What

Wrap pprint.pformat outputs in tools/ci.py with
rich.markup.escape, so the Prepare Workflow Run step's ctx.info
calls do not parse literal [...] substrings as rich markup tags.

Why

Dependabot PR bodies contain [//]: # (dependabot-automerge-start) /
[//]: # (dependabot-automerge-end) HTML-comment markers. The
workflow-config command pretty-prints dict(os.environ) and
gh_event (which includes the PR body) via ctx.info. ctx.info
routes through rich, which parses [//] as an unmatched closing tag
and raises MarkupError: closing tag '[//]' at position N doesn't match any open tag. The whole CI matrix never starts.

Same fix as #69395 (3006.x sibling) and the equivalent commit on
master / the 3008.x dependabot PR #69394 itself. This PR back-ports
the tooling fix to the 3008.x base branch so other dependabot PRs
(and any future PR whose body has unbalanced brackets) survive
Prepare Workflow Run.

Test plan

  • CI green on this PR (Prepare Workflow Run renders without
    MarkupError).

The workflow-config step pretty-prints dicts (os.environ, gh_event,
testrun, build matrices) and labels via ctx.info, which routes through
rich. When the source string contains '[//]: # (...)' (dependabot's
HTML-comment markers in PR bodies), rich parses '[//]' as an unmatched
closing tag and raises MarkupError, killing 'Prepare Workflow Run' and
blocking the whole CI matrix.

Wrap each pprint.pformat output with rich.markup.escape so any '[' in
the rendered text is treated as literal.
@dwoz

dwoz commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by direct push of ab9027b to dependabot/pip/3008.x/all-pip-updates-84e47d00ed (PR #69394).

@dwoz dwoz closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant