Fix rich MarkupError in workflow-config on dependabot PR bodies#69398
Closed
dwoz wants to merge 1 commit into
Closed
Fix rich MarkupError in workflow-config on dependabot PR bodies#69398dwoz wants to merge 1 commit into
dwoz wants to merge 1 commit into
Conversation
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.
2 tasks
Contributor
Author
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.
What
Wrap
pprint.pformatoutputs intools/ci.pywithrich.markup.escape, so thePrepare Workflow Runstep'sctx.infocalls do not parse literal
[...]substrings as rich markup tags.Why
Dependabot PR bodies contain
[//]: # (dependabot-automerge-start)/[//]: # (dependabot-automerge-end)HTML-comment markers. Theworkflow-configcommand pretty-printsdict(os.environ)andgh_event(which includes the PR body) viactx.info.ctx.inforoutes through rich, which parses
[//]as an unmatched closing tagand 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
MarkupError).