Skip to content

fix(jsii-pacmak): Python target crashes on h5 and h6 Markdown headings - #5292

Merged
mergify[bot] merged 2 commits into
aws:mainfrom
Thanatos9404:fix/pacmak-md2rst-h5-h6-headings
Nov 12, 2026
Merged

mergify[bot] merged 2 commits into
aws:mainfrom
Thanatos9404:fix/pacmak-md2rst-h5-h6-headings

Conversation

@Thanatos9404

@Thanatos9404 Thanatos9404 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

A level 5 or 6 Markdown heading (##### or ######) in a doc comment makes jsii-pacmak fail when it generates the Python package, with TypeError: Cannot read properties of undefined (reading 'repeat'). md2rst looks up an underline character for each heading level in a list with only four entries, so levels 5 and 6 read past the end. Only the Python target uses md2rst.

This adds ~ and + for levels 5 and 6. Output for levels 1 to 4 doesn't change.

Tests: added a level %d heading case for levels 1 to 6 to test/python.test.ts. On main levels 5 and 6 fail with the TypeError, and with this change all six pass.

Side note: the underline never actually shows up in the output at any level, because textOf(node) is empty for heading nodes. I left that alone so existing docstrings don't change.

Fixes #4418


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

md2rst picks a reStructuredText underline character for each heading
level from a list that only had four entries. A level 5 or 6 heading in
a doc comment therefore threw "TypeError: Cannot read properties of
undefined (reading 'repeat')", and jsii-pacmak failed to generate the
Python package.

Add underline characters for levels 5 and 6. Output for levels 1 to 4
does not change.

Fixes aws#4418
@mergify

mergify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

mrgrain
mrgrain previously approved these changes Nov 12, 2026
@mergify

mergify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue · pull request branch update failed

1 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Thu 12 Nov, 16:29 · rule default-squash · triggered by @mrgrain with the merge queue checkbox
  • 🚫 Left the queue 16:29 · 5a9566a

Reason

The pull request can't be updated

GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/main.yml without workflows permission
GitHub only lets Mergify write to .github/workflows/ with the workflows permission. An organization owner can accept Mergify's pending permissions at https://dashboard.mergify.com/orgs/aws/repositories.

To get back in the queue

  • Update or rebase the branch yourself: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, tick the box below to queue it again as it is.

Requeue requested — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

@mergify

mergify Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify Bot added pr/ready-to-merge This PR is ready to be merged. queued dequeued and removed queued labels Nov 12, 2026
@mergify

mergify Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Merging (with squash)...

@mergify
mergify Bot dismissed mrgrain’s stale review November 12, 2026 16:52

Pull request has been modified.

@mergify mergify Bot removed the dequeued label Nov 12, 2026
@Thanatos9404

Copy link
Copy Markdown
Contributor Author

Updated the branch with main, since Mergify couldn't do it without the workflows permission. The new CI runs on 45e0139 are waiting for approval.

@mrgrain mrgrain left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Thanatos9404 ! FYI please don't update this PR from now on, it resets the review approval and everything is much easier for me if I handle any blockers directly. This is just an annoyance of how the system is setup.

@mergify

mergify Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Merging (with squash)...

@mergify mergify Bot added the queued label Nov 12, 2026
@mergify
mergify Bot merged commit ee85d06 into aws:main Nov 12, 2026
31 of 32 checks passed
@mergify

mergify Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

✅ Merged into main as ee85d06 at 19:51 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Thu 12 Nov, 19:51 · rule default-squash · triggered by rule Synchronize that PR to upstream and merge it (squash)
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 19:51 · ee85d06 · squash
7 merge conditions met
  • github-review-approved · required by GitHub branch protection
  • label!=pr/no-squash
  • status-success=Integration test (jsii-pacmak)
  • status-success=Unit Tests
  • any of · required by GitHub branch protection:
    • check-success = Integration test (jsii-pacmak)
    • check-neutral = Integration test (jsii-pacmak)
    • check-skipped = Integration test (jsii-pacmak)
  • any of · required by GitHub branch protection:
    • check-success = Build
    • check-neutral = Build
    • check-skipped = Build
  • any of · required by GitHub branch protection:
    • check-success = Unit Tests
    • check-neutral = Unit Tests
    • check-skipped = Unit Tests

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot removed pr/ready-to-merge This PR is ready to be merged. queued labels Nov 12, 2026
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.

jsii-pacmak: H5 tags on Markdown files break Python packaging

2 participants